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

This is a Pelican plugin to calculate various statistics about a post and store them in an article.stats dictionary. You can see this in action in the sidebar on the left of this site.

Nice touch from medium.com - now available in Pelican.

I wanted to implement the nice little “X min read” thing from Medium - and it turned out that it was easy to provide a few other interesting stats at the same time, for people to use ...


Read More

How much does a a software bot weigh, anyway?

Heavily modified & adapted from the original public domain robot on openclipart, posted by johnny_automatic.

reddit, the insanely popular internet community, had 71,435,935 unique visitors last month, with over 2,360,783 people logged in [1].

I say people - but it turns out that not all of the denizens of reddit are human. There are also bots. Lots and lots of bots. How many? No-one really knows. [2]

This is ...


Read More

StackOverflow is made of people - lots and lots and lots of people.

Seemingly like every­thing else in the world, Stack Overflow is getting more & more competitive as time passes. Gaining a good reputation - and even finding good questions to answer - is becoming harder and harder, as more and more people compete for less and less unanswered questions.

This is fantastic if you want to find an answer - but makes it much harder for newcomers to get started and ...


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
Schmatic diagram showing two phones, linked by a magic cloud, calling from the UK to Canada - via the cloud - for free.

In an ideal world, I’d like something like this - and vice versa, please.

My wife and I currently live in Canada, and our families are back in the UK. We’d been using Skype to chat with people in the UK, but I was getting frustrated with Skype’s limitations: it either ties you to a computer and WiFi, or running a battery hungry app which slows down your phone. It doesn’t work very well over the 3G ...


Read More