We use CentOS VM’s at work to emulate our production environment - and it took me a while to figure out how to get the VirtualBox Guest Additions to build reliably on CentOS 6.4/5. This is what I’ve currently settled on as a reliable method.

First, make sure that you’ve got the kernel headers and tools installed that you need to build stuff:

sudo yum update -y
sudo yum install gcc kernel-devel kernel-headers dkms make bzip2 ...

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

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
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

Ever tried to copy something onto a USB flash drive, only to discover that the file was to big to copy?

This is because most USB Flash drives are formatted using the FAT32 [1] filesystem - which only supports individual files up to 4GB in size, no matter how much free space you’ve got. It also only supports drives up to 2TB, can’t store symbolic links, can’t store files with these characters in the name: "*/:<>?\| — and is generally ...


Read More

I recently needed to convert some Apple Lossless music files to FLAC. Here’s how to do it:

If you don’t already have ffmpeg or libav-tools installed, do this:

$ sudo apt-get install libav-tools

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

$ for f in *.m4a; do avconv -i "$f" "${f%.m4a}.flac"; done

And that’s it - it will convert all the .m4a files in that folder to .flac files, preserving the metadata. You ...


Read More
Blueprint style diagram showing the compose key sequence for the Euro currency symbol.

Just hold down your chosen compose key, then press the other keys in turn: [compose key] + e + = gets you a Euro symbol.

The compose key on Linux is incredibly useful, but not configured by default - and on XFCE there’s currently no graphical UI to change it. However, it’s pretty simple to change… here’s how to make the Caps Lock key your compose key:

In the file /etc/default/keyboard, change XKBOPTIONS to look like this:

XKBOPTIONS="compose ...

Read More