Skip to main content

· 2 min read
Drupal site logo

I've thought about creating my own Drupal theme for this site for sometime now, but haven't really found the time and motivation to get started. That is, until my friend Mike recently radically altered his blog by creating his own Drupal theme. Well, that inspired me to finally have a go at replacing this site's much-loved default "Garland" theme.

Well, after some initial head-scratching, I was pleasantly surprised to find out just how easy it can be to theme Drupal sites! My new theme, for example, is done entirely with three CSS files, and two images.

· 2 min read
PDF Alchemy logo

PDF Alchemy is an interesting new service that I've helped to build. It's a PDF conversion service aimed at developers - that is, it's entirely API based, and not intended for end users. But what makes PDF Alchemy interesting to me, is the way it uses a number of Amazon's cloud services.

To start with, the PDF conversion servers themselves run on Amazon EC2. EC2 is an excellent match here, since it allows PDF Alchemy to easily, and rapidly, scale to handle almost any possible volume, but also to then scale back again during off-peak periods.

· 4 min read
Subversion logo

If you've used Subversion for any significant length of time, then you've probably run into the following message (or one just like it), near the end of a svn diff command.

\ No newline at end of file

Of course, you would have realised that this is because your editor has added a newline character to the end of the file in question, where the original had no such newline character.

· 4 min read
IBM DB2 logo

Sometimes you just want to extract a single BLOB from a DB2 database... you don't want to write any software... you don't want to pull out some scripting language with a true DB2 database driver binding... you just want to get a BLOB from the database, and write it to a file - using nothing but the command line.

Well, there are two ways, that I know of, to do so. The first one, is the officially "correct" method, and should always work. The second method is even easier, but only works for very small BLOBs (which is all you need sometimes).

· 2 min read

I've been using the excellent PyODConverter (aka Python OpenDocument Converter) for quite some time now. It's a very small Python script that uses OpenOffice's Python-UNO bridge to convert documents between formats. For example, to convert test.doc to a PDF file, you could execute:

python test.doc test.pdf

For the Python-UNO bridge (and thus PyODConverter) to work, you do need to use the python binary that installs with OpenOffice, so you will most likely need to full-qualify the python command like:

/opt/openoffice.org3/program/python test.doc test.pdf

Anyway, PyODConverter always tries to talk to OpenOffice via (the somewhat arbitrary) port 8100. But today I found myself needing to able to tell PyODConverter which port to use via the command line. So, I went about modifying the PyODConverter code - which was very easy, thanks to it being already very well written.

· 3 min read

There are many ways to determine local IP addresses on Linux platforms. They almost always involve piping ifconfig into a number of grep, awk, cat, and/or tr commands.

Well, my new favorite approach is to pipe ifconfig into a single sed command :)

ifconfig | sed -n -e 's/:127\.0\.0\.1 //g' -e 's/ *inet addr:\([0-9.]\+\).*/\1/gp'

Neat, huh?! :)

So, how does it work? Well, there are two filters (aka scripts, ie the parameters after the -e flags). The first one, 's/:127\.0\.0\.1 //g', simply strips out all occurrences of the local loopback address ( - this can be left out if you want to include the loopback address in the results. And the second filter, 's/ *inet addr:\([0-9.]\+\).*/\1/gp' matches all lines with IP addresses, strips all but the IP address itself, and prints the matching line (note the p at the end of the filter, which works in with the -n flag at the start of the sed command).

· 2 min read

When creating HTTP web forms to allow browser-based uploads to an S3 bucket, you need to create and sign upload policies. Now if that statement lost you, then you should read over either of the following introductions to browser-based uploads to S3:

· 10 min read
Media PC

As a mentioned back in this post, I am building a completely solid-state, dual-core, 64-bit media PC. I won't go into any of th "planning" details here (refer back to the original post for that). However, this post will show some of the progress so far (using lots of pics), and give some idea of the project's feasibility :)

So, without any further distraction, let's bring on the pictures!! :)

First up, we have the case... it's a Thermaltake Lanbox HT, and I must say, I am quite impressed with the build quality of this case! :)

· 3 min read

During the past three years, I've often been amazed at just how difficult it can be to get IBM's DB2 to successfully restore from its own backups. Even in the most simple case ( offline backups, with circular logging) you can run into difficulty, but it can be incredibly difficult if the database has been configured to use log shipping, and especially if the backups were taken "online" - that, it seems, can be most the difficult DB2 backup / restore scenario. And, of course, DB's error messages usually offer very little (to the untrained eye) to explain what's going wrong.

However, over time, I have finally figured out most of the problems, and so most restorations work quite smoothly for me now. So, I thought I'd quickly share the most useful (for me) backup and restore commands.

· 4 min read

For a little while now, we've been seeing ads on TV for a new soon-to-be-upon-us service called Freeview. Well okay, my interest was raised... mainly because of the promised "15 new free to air channels". Note, the "new" part was my misunderstanding - ie it was implied, but not declared, as we shall soon see.