How Figures & Images work in Pelican, by default

By default Pelican does a great job with figures and images, thanks to built-in support in ReStructuredText [1]. Pelican will turn this rst input:

.. figure:: {filename}/images/better-figures-images-plugin-for-pelican/dummy-200x200.png
    :align: right

    This is the caption of the figure.

    The legend consists of all elements after the caption. In this case, the legend consists of this paragraph.

into this HTML output:

<div class="figure align-right">
    <img alt="/static/images/dummy-200x200.png" src ...

Read More

As I mentioned previously, this site was put together using Pelican - a static site generator, written in Python.

Blueprint style diagram showing a brown Pelican, flying. The diagram point out it's Yellow Head, Large beak and pouch for fishing, long neck, white chest and grey body.

Pelecanus Occidentalis - the Brown Pelican.

Static site generators take your content, pour it into your templates and output the result as static pre-generated HTML, CSS, JS & image files. You can then just upload the resulting folder of output to your server and you’re done. All you ...


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

I’ve been meaning to consolidate my personal websites onto this domain for a long, long time. My original personal website, dflock.co.uk, started in the late nineties - and has been getting a bit long in the tooth of late.

Screenshot of the current version of the dflock.co.uk website homepage, at the time of publishing this post. It's kinda green and nineties looking.

Static text files - the gift that keeps on giving.

That site has been up, looking mostly like that, for ~15 years - with zero maintenance or downtime. Nice to know it’s still valid CSS 1.0 :)

When I created ...


Read More