This site has been generated using Pelican 3.3 for over two years - and I finally found some time to upgrade to the current version of Pelican, 3.6.3. This is how I did the upgrade.

I decided to be lazy and do the upgrade in-place, instead of creating a new virtualenv and copying the content & settings over. Luckily, this worked out OK, after a bit of fiddling around.

I also decided, rather cavalierly, to upgrade all the packages ...


Read More

To create image thumbnails from a PDF document, run this in a terminal window:

convert -thumbnail x300 -background white -alpha remove input_file.pdf[0] output_thumbnail.png

The parameters to convert do the following things:

Parameter Effect
-thumbnail Similar to -resize, but optimized for speed and strips metadata.
x300 Make the thumbnail 300px tall, and whatever width maintains the aspect ratio.
-background white Sets the thumbnail background to white.
-alpha remove Removes the alpha channel from the thumbnail output.
input_file.pdf ...

Read More

There are quite a few changes in Pelican 3.3 - most of them minor, but a few which might mean making some changes to your site in order to upgrade. This is what I did to move my site from Pelican 3.2 to 3.3.

The change that had the biggest impact and took the most work was around image linking - caused by a combination of things. I think I was doing it wrong before and things changed in ...


Read More

I’m going to build on Jamie Zawinski’s excellent advice about backups, which you should read first. This is basically that, but with some extra bits. If this seems too complex, then just do what he says.

The plan is to use Backupninja to backup everything to an external USB drive — and also to Amazon S3 or Dropbox, depending on what it is. Backupninja provides a centralized way to configure and schedule many different backup utilities, just by dropping ...


Read More

I recently needed to convert some FLAC music files from the increasingly common 48 bit encoding, down to 16 bit at 44100 kHz, so that they’ll play on my Sonos. Here’s how to do it:

If you don’t already have sox installed, do this to install it:

$ sudo apt-get install sox

Then run this to do the conversion, in the folder with music in:

$ mkdir resampled
$ for flac in *.flac; do sox -S "${flac}" -r 44100 -b ...

Read More

Compressing Limited Colour PNG images

Most of the .PNG files on this site are the ‘blueprint’ style diagrams, like this one:

Blueprint style diagram showing an optical microscope. The sample inside is magnified in a bubble to 2,500 times, showing it to be a complex, detailed paisley pattern.

This illustration is a large 5.6MB SVG file, mostly because of the very detailed paisley pattern that I used.

Exported to PNG - and then compressed using the process below, you can get this down to 118.5kB.

I create these in Inkscape as vector .SVG files & export them to bitmap .PNG files. I then re-compress them, to ensure ...


Read More
Thunar's icon, a beautifully rendered, stylized version of Thor's hammer, Mjölnir.

Thunar - XFCE & XUbuntu’s small but perfectly formed file manager - has a simple mechanism that allows you to easily add new commands to the right click menu of files and folders. These are called Custom Actions and are easy to create… here’s how to do it.

Click the Edit menu, then click ‘Configure custom actions…‘. This will take you to the Custom Actions Manager, where you can create, edit or delete your custom actions.

You can enter anything into ...


Read More

I switched my XFCE machines over to use Compton for window compositing today - and it’s a noticeable improvement.

A compositor glues your stacks of windows together to form the final image that you see on screen. It’s responsible for any fancy effects like drop-shadows, as well drawing windows while dragging, resizing and minimizing or maximizing them. [1]

Compton does this beautifully. It does one thing and it does it well. It provides glassy smooth, tear free compositing and ...


Read More