Ubuntu: Lock Screen and Pause Spotify

When I used a mac I had a shonky little applescript to pause iTunes when I locked the screen. These days I mostly listen to Spotify (running under wine) on Ubuntu which of course doesn't have applescript. What I wanted was a similar script so I can hit a keystroke…

Open Redirects and Phishing Vectors

There was an interesting article on the Google Webmaster Central blog back in Jan talking about open redirects being abused by spammers. One point they didn't go into too much detail on is that of phishing vectors. If you're running a site with any kind of user registration and you…

PHP: Multiple DNS Queries Using fopen

Whilst working on some inherited PHP code that used fopen I noticed an interesting comment in the PHP manual which pointed out that fopen always makes a DNS lookup for every request. Taking the following code as an example: <?php $handle = fopen("http://muffinresearch.co.uk/robots.txt", "r"…

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 {3858b1b1-c306-4505-8264-235af812f337}…

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. This is based on Pocoo's Zine which we've really enjoyed using. The only downside so…

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 less often is a…