Archive for January, 2011

Building OpenSSL on your Mac (MacOS X)

Saturday, January 15th, 2011

This posting is intended for my team of iPhone Developers only:

Steps to Build OpenSSL 1.0.0c under your MacOS X:

01. Visit http://www.openssl.org/source/,
and download: openssl-1.0.0c.tar.gz

02. Open a Terminal Console (where you can enter Unix command)

03. Create a new folder as follow:
mkdir opensources
cd opensources

04. Copy openssl-1.0.0c.tar.gz under /opensources as follow:
cp /Users/{your login name}/Downloads/openssl-1.0.0c.tar.gz .

05. Unzip openssl-1.0.0c.tar.gz as follow:
tar -zxvf openssl-1.0.0c.tar.gz

06. cd into openssl-1.0.0c as follow:
cd openssl-1.0.0c

07. Find out your CPU architecture: 32 bits or 64 bits
I am not sure how, but you have to find it out

08. Back to Terminal Console, and under
/opensources/openssl-1.0.0c, and do this:
./Configure

You should see the followings:
MacBook-Pro:openssl-1.0.0c oscar$ ./Configure
Usage: Configure [no- …] [enable- …] [experimental- …] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [–prefix=DIR] [–openssldir=OPENSSLDIR] [–with-xxx[=vvv]] [–test-sanity] os/compiler[:flags]

pick os/compiler from:
… darwin-i386-cc darwin-ppc-cc darwin64-ppc-cc
darwin64-x86_64-cc dgux-R3-gcc dgux-R4-gcc ….

For my MacBook MacOS X, I have Intel Core 2 Duo 64 bits which is:
“darwin64-x86_64-cc” from the list. If you have a new (after 2006) MacBook Pro with Intel processor, most likely you will use “darwin64-x86_64-cc”

09. Configure OpenSSL as follow:
./Configure darwin64-x86_64-cc  –prefix=/usr no-threads shared
(Note: there are two “minus signs” in front of “prefix” like –)
This will take a few minutes.

10. make
(if you see an error such as Permission Denied, you should do:
sudo make, and it will ask for the
machine’s administrative password)
This will build OpenSSL, and it will take a few minutes
up to 30 minutes.

11. make install (or, sudo make install)
This will take a few minutes

12. Close the Terminal Console

13. Open a new Terminal Console, and type the followings:
openssl

14. Then, you should see a OpenSSL> command prompt, and then,
enter: version
Check to see if the version is 1.0.0c.

15. Enter quit to exit the OpenSSL> command prompt.

16. Then, check if the libraries are there by doing the following:
ls -l /usr/lib/*ssl*

And, you should see:
-r-xr-xr-x  1 root  wheel  401168 Jan 15 11:36 /usr/lib/libssl.1.0.0.dylib
-rw-r–r–  1 root  wheel  534408 Jan 15 11:36 /usr/lib/libssl.a
lrwxr-xr-x  1 root  wheel      18 Jan 15 11:36 /usr/lib/libssl.dylib -> libssl.1.0.0.dylib

17. And, you see that *.dylib ?
Remember, we did a similar step to load sqlite3.dylib before ?
Please do the same for your iPhone app.
Just try it, and let me know when you are done.

18. If Step 17 is successful, I will continue to show you how to include
the necessary OpenSSL C Header file, and write a simple example
for AES data encryption and decryption.

Email me at my hotmail email account if you have any issues…

Oscar
Founder of FoodPicky.com

Starbucks coffee at 200 F degrees

Saturday, January 15th, 2011

I recently learned from someone that I could order Starbucks coffee, and request it to be made at 200 F degrees. Originally, this temperature is for those who order coffee to go for some other people. Since the coffee temperature is high, when it gets to the destination, it will be back to it’s normal temperature.

As for myself, I order it just to make myself special, and distinguishable from other customers. I also bring my own ceramic coffee cup. I always order “Grande Latte 200 Degrees” with that cup. After a while, all Starbucks employee recognize my mug, my face, and they know exactly what I want to order. At this cold weather, 200 F degrees make sense. However, you must now drink too fast. Drink slowly, sip slowly…. Otherwise, you will definitely get your tongue burned. CAUTION !!!! It’s HOT !!!!!!!!

Oscar
Founder of FoodPicky.com