Headless virtual machines with Oracle VirtualBox

Like any other well-respected geek, I would love to have many computers all around me. However, money constraints make that hard, yet it’s still possible to have extra machines around… if they are virtual.

For those unfamiliar with the concept, virtualization is exactly what it sounds like: an entire computer is created in software, possibly with some help from the hardware. In practice, what this means is that you are able to have a “computer in a window,” as if it were any other program. The actual physical computer is called the host, and the virtual machine is called the guest. Note that virtualization is radically different from emulation; the former takes place when the host and the guest share their architecture (e.g. x86/amd64), the latter implies that they are different (e.g. a PowerPC host with an x86 guest.)

A very retro-futuristic word to describe the virtualization software on the host is hypervisor. Go figure.

Continue reading “Headless virtual machines with Oracle VirtualBox”

Batch-converting images for an HDTV

A couple of days ago, my parents bought their first HDTV. Since it has a USB port that can be used to show pictures stored on a flash drive, I found myself in the position of finally using an old 512 MB stick I had lying around.

I scouted my iPhoto Libraries for pictures, and simply dragged them into a folder I had created. I quickly stumbled across two problems:

  1. The Finder almost immediately reported that the drive was full, even when it still had over 350 MB available, or that one or more files couldn’t “be read or written”;
  2. 8-megapixel images are just too big for a Full HD screen, so you end up wasting a lot of space and possibly slowing down the TV.

Did I fix them? You bet I did. Read on to find how.

Continue reading “Batch-converting images for an HDTV”

Installing the MySQLdb Python module on Snow Leopard

Needing to access a MySQL database through Python, I was faced by the inability to easily install the MySQLdb module. I do use MacPorts, but after running the obvious
sudo port install py26-mysql
I realized that I would be downloading, compiling and installing a new instance of Python, a new instance of MySQL (I prefer the simplicity of MAMP), and who knows what else.

Installing the module alone doesn’t work, because MAMP installs no headers; and copying the headers from the vanilla MySQL distribution doesn’t help either, because a few of the required files are generated on the fly during the installation of MySQL itself.

The solution, it turns out, is relatively simple. Follow along. Continue reading “Installing the MySQLdb Python module on Snow Leopard”