I encountered the following error when installing the mysql gem on a shiny new Macbook Pro running OS X Leopard.
Note: I have ~/.gem set as my GEM_HOME and GEM_PATH to avoid needing to sudo
> gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
The workaround was fairly simple. Since I had installed MySQL from source the situation was resolved with a few command line options:
> export ARCHFLAGS="-arch x86_64"
> gem install mysql -- \
--with-mysql-dir=/usr/local/mysql \
--with-mysql-lib=/usr/local/mysql/lib \
--with-mysql-include=/usr/local/mysql/include \
--with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed

Facebook used to be a site that I visited when I was bored or had downtime. It was a diversion that could be accessed at any given moment, and then put back away when it’s purpose was served. The problem is that now, you can’t put Facebook away. You can close your browser window and continue on to surf other sites, but no matter where you go, you’re back at Facebook again. If I’m reading an article on cnn.com, my friends’ comments are listed to the right of the article. If I’m visiting (seemingly) random blogs, I’m being encouraged to be the first of my friends to “Like” the posting. Enough. I’m unplugging from the Facebook version of The Matrix.
Read the rest of this entry »
Facebook’s recent modifications to their privacy policies is causing concern for a lot of people, and for good reason. Facebook is encouraging third-party sites and developers to leverage their developer platform to gain deliver a more social experience for their users. Facebook is referring to this new practice as “Instant Personalization”, and it means that sites will be able to pull profile information about their visitors, as well as about the visitor’s friends. That last sentence deserves some attention because it is possibly one of the bigger threats to privacy that I have seen done out-in-the-open on the web.
Essentially what this means is that if your friend visits a site that you have no affiliation with whatsoever, that friend can pass your personal information on to that site. Meaning that whatever permission that you had previously extended to your friend to use your profile details have now been extended to a site with which you have no affiliation, and with whom you have no knowledge.
This attempted increase in reach is startling. Not starting because Facebook is doing it (research has shown that adding personal information to advertisements results in significantly higher click-thru) but startling because it’s being allowed in the first place. Google received FAR more attention for their Buzz Privacy Snafu, and that was a much smaller risk to my privacy than what Facebook is attempting.
Read the rest of this entry »
Gruber over at Daring Fireball posted a great writeup on the Gizmodo iPhone debacle. It’s a great read: Daring Fireball: Gizmodo and the Prototype iPhone.
More discussion about Gizmodo’s potential problems related to their “good fortune” of stumbling upon an iPhone prototype…
Finders Keepers?
What he never did, however, was notify anyone who worked at the bar, according to its owner, Volcker Staudt. That would have been the simplest way to get the phone back to the Apple employee who lost it, who “called constantly trying to retrieve it” in the days afterward, recalls Volcker. “The guy was pretty hectic about it.”
Nor did the finder report it to the Redwood City Police Department, says Sgt. Dan Mulholland. To be fair, no one from Apple told the police the phone was lost, either. I contacted a company spokeswoman to ask why not but never heard back.
Assuming the jury in a hypothetical criminal or civil suit consisted of locals like Volcker, the claim that the sellers actions constituted a “reasonable effort” to contact the owner wouldnt hold much water. “The most reasonable effort would have been to bring it back to us, because he knows that person would be going back to us first,” says Volcker. “Why not just make it simple and bring it back?”
Buyers Burden
And make no mistake: In this case, it was up to Gawker to establish that the seller legally possessed the property. Paul J. Wallin, a founding partner at the California law firm Wallin & Klaritch, offers an analogy. “If you purchase a Rolex watch at a swap meet for $200, a reasonable person would be put on notice that it might be stolen goods,” he says. The buyer would thus be required to take extra measures to determine that it wasnt.
via Why Apple Could Sue Gawker Over Lost iPhone Story – DailyFinance.
The scoop of a lifetime occurred for Gizmodo recently when, through intense research and journalistic savvy they managed to uncover the highly anticipated iPhone — months before it’s release. It would be a great day for Gizmodo were that the case, but in fact it’s not. Gizmodo Forrest Gumped their way into possession of the top-secret device by being willing to pay $5,000 for stolen property.

The top headlines on their site right now read like the front page of a supermarket tabloid:
- How Apple lost the next iPhone!
- How Apple missed chances to get the device back
- Why Apple didn’t leak the iPhone to us
- And finally, how Apple asked to get their phone back
- How we put the phone in an envelope and sent it to them
Okay, I made the last one up, but it isn’t too much of a departure from those that it followed.
Read the rest of this entry »
Was looking for a quick and easy way to deal with refreshing my db schema in Django. A bit of googling turned up
stonemind consulting » Small Django tips from one newbie to another.
Worth bookmarking as it solved that problem for me, and has a lot of other useful tips and scripts.

While MAMP has proven to be very convenient for doing local development, not having the MySQL header files around sometimes causes difficulty when it comes time to install/compile something that needs those header files to be in place.
Getting Ready
I always set up a src directory under my user account for these installations.
> cd ~
> mkdir src
> cd src
Download MySQL Community Edition
At the time of this writing, it could be found at http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.1/mysql-5.1.45.tar.gz
Download this file into your src directory.
> curl -O http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.1/mysql-5.1.45.tar.gz
Untar, configure, and install
> tar -xvzf mysql-5.1.45.tar.gz
> cd mysql-5.1.45
> ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=innobase
> make
> sudo make install
> cd /usr/local/mysql
> sudo ./bin/mysql_install_db --user=mysql
> sudo chown -R mysql ./var
> cd ..
MAMP specific issue
Given that I had installed MAMP previously, I had modified my /etc/my.cnf to specify that the mysql.sock was located in /Applications/MAMP/tmp/mysql/mysql.sock. I modified this line to point to /usr/local/mysql/var/mysql.sock, and then set the sticky bit on the var directory.
> chmod 1777 /usr/local/mysql/var
There are other steps that can be added so that mysqld launches on startup, but I prefer to start it manually when it is needed.
I host a lot of simple sites on Dreamhost. Imagine my surprise when I went to log into my control panel and was informed that google had listed one of my sites as being a suspected malware site.
The site that it referenced was a very rarely used site, that only housed a custom built app (more of a script than an actual app) so I was puzzled as to how this site could have become infected.
I logged into the host, and did a quick check of the directory structure, and immediately noticed some suspicious things. Read the rest of this entry »