ruby, rails, textmate, automation, etc.

Building do_mysql on a 64-bit Mac

Posted on October 02, 2008

Whilst installing merb with edgy I’ve had run into some trouble building the do_mysql gem on my Macbook Pro. It’s a 64-bit machine, so I installed the 64-bit version of MySQL, and that was my first mistake…

Debugging JavaScript in WebKit

Posted on October 02, 2008

If you do much web development you’re probably a big fan of the Firebug plugin for Firefox. It really is a rare gem in the web developer’s arsenal. When I’m not developing I prefer to use Safari – it seems faster and leaner, so I often find that I’ve got both browsers open at once.

A couple of days ago something rather fantastic happened – Safari got a makeover…

Removing an entry from /etc/hosts on a Mac

Posted on June 09, 2008

I was testing a freshly deployed web site for a client the other day before they’d setup their DNS entry, and added the server to my Mac’s /etc/hosts file. It looked something like this:

208.75.85.73    www.clientsite.com

When I’d finished my testing I removed the entry from /etc/hosts. On most Unix systems that’s enough to eradicate all traces of your meddling, but not on the Mac. Any IP address that you add to /etc/hosts gets cached by the operating system.

After a bit of poking around I discovered lookupd. On Tiger you can flush the cache by entering this in the terminal:

lookupd -flushcache

On Leopard the lookupd command appears to have been replaced with dscacheutil. I’ve not had to clear my cache on Leopard yet, so whether it works in quite the same way remains to be seen.

Update: The HostsWidget Dashboard widget appears to solve the same problem rather well.