Running Ubuntu on Mac OS X

One of the first things I did when I got my MacBook is install Parallels, CPU virtualization software that lets me run Windows XP in a window on Mac OS X, so I can easily test our site with Internet Explorer. It's very fast, and very, very friendly.

Recently I was tasked with discovering whether it is possible to do non-blocking file reads and writes to a filesystem that is mounted over NFS. I tried on OS X, and I was unable to get a read to return EWOULDBLOCK. So, I decided to install Ubuntu on Parallels. I downloaded the iso, burned it to a CD, created a new virtual machine, and installed it.

Everything worked flawlessly. Ubuntu has always been incredibly high quality, and it has only gotten nicer in the year since I used it last. It's polished, beautiful, and just works. It is definitely something that I could install on my machine for my Mom with a web browser and mail reader.

Here's a screenshot:


Writing your Python REPL history to a file

Something I have often wished for is the ability to save the history of a Python interactive session to a file. I often screw around in the interpreter to figure out how I am going to implement something, and it is tedious to go through and copy/paste all the lines out of the terminal into an editor and clean it up. Luckily, I discovered there is an easier way in the readline module:

import readline

I'm sure this is going to come in handy many times.