Articles

A collection of articles and snippets I've collected over the years.


Mashups and Music

January 6, 2010

On my old site I had a couple of tracks that I have mashed up in the past and one track created with fruityloops.  Since the blog has gone in these tracks have disappeared.  Time to put 'em back....

Correct VAT calculations in PHP

January 4, 2010

Due to the so called 'Credit Crunch' the British government had decided to change the VAT rate for one year between December 2008 and Jan 2010.  Many developers in the UK had made the mistake of...

Rename files in bash

December 19, 2009

If you ever need to rename a batch of files using a regex or similar you can use the <code>rename</code> command:

PHP number_format gotcha

December 19, 2009

Be careful when doing any kind of calculations with numbers that have been passed through PHP's number_format function as they can lead to unexpected results. The problems lie with the thousands...

Unicode PHP functions and files

November 4, 2009

This is nothing amazing, just a bit of fun.  One of the more useful features of the upcoming PHP6 is full unicode support throughout.  However, did you know that PHP supports unicode already and...

Set Fixed IP Address on Ubuntu

August 13, 2009

I often find that I need to fix an IP address using Ubuntu Server and then have to search for the correct format for /etc/network/interfaces.  For record, here it is:

Timesheet Prompt

July 31, 2009

A simple script to prompt for a Timesheet entry on Ubuntu

MySQL Stored Procedure tutorial

July 30, 2009

How to create and use a stored procedure in MySQL: To call this use the 'call' keyword and pass the parameters:

Share mouse and keyboard across computers

July 30, 2009

As a website developer I have a need to use multiple operating systems at the same time.  I have a laptop that dual boots Windows Vista and Ubuntu 9.04 and I use this to test websites in Internet...

A day in the life of Spinnaker Tower, Portsmouth

July 17, 2009

Please allow time for this to load. Size is 18mb.

Install PDFLib with PHP

July 9, 2009

To install the PDFLib functionality you need to do the following (on an Ubuntu box). Then install PDFLib using pecl: This will ask for the path to PDFlib headers. Select '1' and enter: Then...

Drawing an Arc in Imagick

June 19, 2009

Here's how to draw an arc using PHP Imagick Produces:

Zend_Cache to cache an object

June 18, 2009

Here's how to cache an object using Zend_Cache: Note: The reason that "automatic&#95;serialization" is set to false and then I manually serialize and unserialize is that...

Creative Zen and Rhythmbox (and Banshee)

June 8, 2009

I've never liked using Rhythmbox (Gnome's default music player) as I found previous versions to be slow, buggy and crashed a lot.  I'm trying to keep my system as close as possible to the default...

Upload files with ncftpput

May 18, 2009

ncftp is a great set of command line ftp utilities.  It supports a fully fledged FTP client as well as utilities for putting, fetching and batching files. Here's how to use ncftpput to upload a...