Friday, March 20, 2009

As unexpected as it seems right now... I can't complain how life has turned out.

Tuesday, March 17, 2009

php 5.2.9 + mysql + pdo_mysql on leopard



** Click here for PHP 5.3.0 **

This is a brief explanation of how you might be able to get pdo_mysql working on Leopard (OS X 10.5.6 and 10.5.7) with the stock Apache installation, on a Core 2 based Mac, while conveniently updating PHP as well. I was able to scrape this together from a few blog posts, mostly this one, and also some guess work.

This installation only covers 64-bit capable Intel Macs: those with the Core 2 processor. I might be able to guess at 32-bit (original Core) instructions; comment here if you need them.

1. Make a backup copy of this file: /usr/libexec/apache2/libphp5.so

2. Download and install MySQL from the MySQL website. Make sure to download the x86_64 package.

3. Download and unzip the PHP source code from the PHP website. I used the latest, PHP 5.2.9, at the time of this writing.

4. Open a terminal window and move to the unzipped directory, then execute the following commands.

MACOSX_DEPLOYMENT_TARGET=10.5 \
CFLAGS='-O2 -arch x86_64' \
LDFLAGS='-O2 -arch x86_64' \
CXXFLAGS='-O2 -arch x86_64' \
./configure '--prefix=/usr/local/php-5.2.9' \
'--with-apxs2=/usr/sbin/apxs' \
'--with-ldap=/usr' \
'--with-kerberos=/usr' \
'--enable-cli' \
'--with-zlib-dir=/usr' \
'--enable-exif' \
'--enable-ftp' \
'--enable-mbstring' \
'--enable-mbregex' \
'--enable-sockets' \
'--with-iodbc=/usr' \
'--with-curl=/usr' \
'--with-config-file-path=/etc' \
'--sysconfdir=/private/etc' \
'--with-mysql-sock=/var/mysql' \
'--with-mysqli=/usr/local/mysql/bin/mysql_config' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl' '--with-xmlrpc' \
'--with-xsl=/usr' \
'--without-pear' \
--enable-pdo=static \
--with-pdo-mysql=/usr/local/mysql


make

sudo make install

sudo apachectl restart

Take a look at your phpinfo(), and if all went well, you will see MySQL listed in the drivers under PDO. If it doesn't work, the bailout is to put the original libphp5.so back into place... you know, the one you backed up in step 1... you did back it up, right?

PHP CLI users: If you are getting this warning:
PHP Warning: PHP Startup: Unable to load dynamic library './pdo_mysql.so' - (null) in Unknown on line 0

Comment out the following line in /etc/php.ini:
extension=pdo_mysql.so

Sunday, March 15, 2009

php is scalable

Back in the day I had plenty of stuck-in-their-ways Java and J2EE developers tell me that PHP isn't scalable. They were wrong, and I politely told them that. It was a classic case of people reciting opinions without really having explored the truth. I never heard anything like it from any developer that had actually used PHP for developing a project.

PHP's interpreter is written in very fast C; it has an extremely low memory footprint, and its execution leaves no traces behind. What's there that won't scale? Slap an opcode cache on the server, parameterize your SQL queries, and it gets even better.

Today, thankfully, I don't hear much of that nonsense anymore, but I felt compelled to reiterate the point today when I was reminded that Wikipedia is built on PHP and MySQL, both major open-source projects. As of this writing, Wikipedia is the 7th most popular website in the world according to Alexa. I believe a great deal of Facebook is also PHP, if not all of it.

PHP is definitely not the answer to everything, and as an architect I generally rather prefer the rigidity of a Java or a C# when creating a system. But to say that PHP is not scalable is absolute nonsense.

Wednesday, February 18, 2009

emeco aluminum chairs

Emeco makes cool chairs out of recycled aluminum. In addition to great design, they are rather comfortable and extremely light! Discovered at LAS today.

emeco chairs at mccarran

Thursday, February 12, 2009

opfton key

What is that for?

opfton key

Wednesday, January 28, 2009

your move

I used to be bad at chess. I'd get in this habit of making a move before understanding, well as I should have, all of the implications.

Later in life I watched the Bourne movies. I began to learn the importance of Forethought. Consideration. Preparation.

It seems that time invested into thinking ahead always reduces the time to the end goal, anyway. So why not?

Sunday, January 18, 2009

circumventing the cricket um100c software on mac

This article describes using the UTStarcom UM100C modem with Cricket's wireless broadband service on the Mac, without using the very flawed software that comes with the device. Well, sort of.

I wasn't the first person to notice that using the software resulted in the computer fans spinning up and sounding like it was clearing for take-off. My girlfriend actually complained about it before I knew myself. Some flaw in the software causes it to use most of the available CPU cycles even when doing nothing. That means your computer gets really slow and hot. Oops.

After I installed it, the Cricket card worked fine, but my Sprint card refused to work at all after that! Thank you, incompatible mess.

Also the interface is ugly. Who knows what else is wrong with it.

Enough already. Here's how to get this done on OS X Leopard. These instructions won't be the same for older versions of the operating system.

DISCLAIMER I can't guarantee that these will work for you or that nothing will go wrong. Performing unofficial hacks on your computer, like this one, can be risky. That said, if there is a problem with any of these instructions, I'd like to know about them so I can fix them. Please let me know if you do not have success.

1. Install the QuickLink software. What?! you say. Don't worry, you'll be removing most of it, but there are a couple pieces that you do need from the package. I recommend that you download this version which I have reposted from the Smith Micro site so that we're all on the same page.

2. Let the installer restart your computer.

3. Use the software to connect up at least once to Cricket's network. Doing this downloads a modem script that is necessary later in the process. Browse to a couple of websites and then verify that it is working. Then disconnect and continue on.

4. Open your System Preferences, select Accounts, choose your account on the left hand side and select the "Login Items" tab. Select "qlmwirelessd" and hit the minus button below the list to remove it. This will keep the software from running automatically.

5. Restart your computer again.

6. Open your System Preferences, and select Network. It should have added two new devices on the left-hand side called "UTStarcom" or the like. I'm not sure why it adds two of them, but it appears that one of them works and one does not. You'll need to identify which one is the working one. Pick one and punch in the following:

Telephone Number: #777
Account Name: [your phone number]@mycricket.com (example: 8005551212@mycricket.com)
Password: cricket

7. Click the "Advanced..." button and apply the following specifications:

Vendor: Other
Model: Cricket 1xEVDO Modem Script
Enable error correction and compression in modem: Yes

8. Click the PPP tab. For "Settings", select "Session" and note the options. Most of these are up to your personal preferences.

9. Now go back to the "Settings" drop down menu and select "Configuration". Uncheck "Send PPP echo packets" and click "OK".

10. Try connecting by clicking "Connect". If it works, yay! You are in business. If it does not work, try configuring the other "UTStarcom" device using the same instructions.

If still you have no luck, you might also try this hint, which I discovered after toiling with this nonsense myself. The idea listed is similar to what I devised.

If the Cricket card is not your only aircard, simply reinstalling your other aircard's software after all of this ought to get it working again.