PHP: Multiple DNS Queries Using fopen

Whilst working on some inherited PHP code that used fopen I noticed an interesting comment [http://uk3.php.net/manual/en/function.fopen.php#73132] in the PHP manual which pointed out that fopen always makes a DNS lookup for every request. Taking the following code as an example: <…

VirtualBox: Error: Cannot register the hard disk

If when cloning VirtualBox VMs you get an error like this: $ VBoxManage clonehd WinXP-IE7.vdi WinXP-IE8.vdi VirtualBox Command Line Management Interface Version 2.2.4 (C) 2005-2009 Sun Microsystems, Inc. All rights reserved. ERROR: Cannot register the hard disk '/home/scol/.VirtualBox/VDI/WinXP-IE7.vdi' with UUID…

Project Fondue Blog

Last weekend I was in Paris with Cyril and Ed spending some time on Project Fondue Projects. One of the things we got done was putting out the initial iteration of the Project Fondue Blog [http://blog.projectfondue.com/]. This is based on Pocoo's Zine [http://zine.pocoo.…

BASH: Using brace expansion

There's a nice feature of BASH which is to use a comma delimited list of strings inside of curly braces to reduce the amount of typing: here's an example of using brace expansion to create log files for apache: sudo touch {access,error}.log Something seen…

vim: automatically highlight long lines

This .vimrc snippet highlights lines when you exceed 77 columns - this is especially useful if you are trying to adhere to PEP8 [http://www.python.org/dev/peps/pep-0008/] with Python development. The if statement makes this work for older vims as well as more recent versions which is…

Running VMware images under VirtualBox

I use the excellent VirtualBox on Ubuntu but I had a specific Debian dev environment VM that I'd previously run under VMware Fusion on my work mac when it used to have OSX on it ;-). The current versions of VirtualBox (2.2.4 in my case) support…

Ubuntu: Turn off changing workspace with mouse wheel

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System → Preferences → CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck "Viewport Switcher" which is under the "Desktop" heading.…