ruby, rails, textmate, automation, etc.

Learning Erlang with the Pragmatic Programmer Screencasts

Posted on June 18, 2008

I’ve been meaning to get around to playing with Erlang for a while now. Tonight I set aside 30 minutes to watch the first of the Pragmatic Programmer’s Erlang Screencasts by Kevin Smith: Erlang By Example.

Each screencast is very reasonably priced at $5 a piece. I bought the first one, in which you learn how to build a simple chat system. I downloaded it immediately, excited to think that in only 30 minutes time I’d know lots more about Erlang than I did when I woke up this morning.

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.