duncan­lock­.net
Galaxians vector
Figure 1. Galaxians.

As a family gift for Christmas 2020, I set up a Raspberry Pi 400 with Retropie. The plan is to load a selection of the “best of the best” games from computer game history, starting with games up to, roughly, 1985.

The kid doesn’t really know any better, so we can play Space Invaders unsullied by time and expectations and enjoy a speedrun through gaming history, playing just the highlights.

I’ll add more games as we go along, progressing through gaming history, one classic game at a time.

Continue reading “Speedrunning Computer Games History with a 6yr Old - Part 1”

Spiralized carrots & daikon radish, with halved Jalapeno, in the brine ready to ferment.
Figure 1. Spiralized carrots & daikon radish, with halved Jalapeno, in the brine ready to ferment.

This is a rather loose adaptation of a traditional Vietnamese recipe, often used as a filling in Bánh Mì. You can google for lots of variations. Đồ Chua is often made as a vinegar pickle, with added sugar – this recipe is a keto/paleo & sugar-free lacto-fermented version.

The basic idea is to spiralize (or grate) & mix everything, except the chilies. Then pack all the spiralized vegetables into jars, with the halved chilies slid down the side, topped up with brine.

Start by making the basic brine and leave to dissolve while you prepare the vegetables.

Basic Brine

Important to measure carefully. This is the brine I use for most simple ferments, unless I find a recipe that has a good reason for using something different …

Continue reading “Fermented Bánh Mì/Đồ Chua(ish) Recipe”

Two mason jars, full of fermenting cucumbers.
Figure 1. Two mason jars, full of cucumbers, just gone in. Both using this recipe, one with added chilli flakes, one with added Sichuan pepper.

Here’s my lacto-fermented cucumbers recipe. This is adapted from the great Wild Fermentation book. I’ve honed this recipe to perfection over many trials – but you’ll need to try it a few times and adjust it to your particular cucumbers, climate & tastes, I expect.

Although mini-cucumbers are the archetypal “pickle”, this recipe is not limited to just cucumbers. Pretty much any crunchy vegetable can be fermented like this. Basically, any vegetable that’s crunchy will ferment well this way.

This is essentially two recipes: one for making the “basic brine” – which I use for lots of similar ferments – and one for making the fermented cucumbers, using the brine. Both recipes are very simple …

Continue reading “Basic Pickles or Fermented Cucumbers Recipe”

Blueprint style diagram showing a Teapot.
Figure 1. A teapot, cut in half. Sort of. Original clipart Kitchen Utensils Silhouette, by GDJ, Public Domain. More on Teapots.

I’ve had a mysterious broken page on this site for a while - but been too busy to look into it. My Comprehensive Linux Backups with etckeeper & backupninja article has been refusing to load, and returning a weird HTTP 418 Unused status code instead. I finally made the time to figure out the cause.

It turned out that this was being caused by the Apache/PHP mod_security module. This is a static website - there’s no PHP anywhere - so why would that be a problem? Well, so far I’ve been very happily hosting the site on my old DreamHost shared hosting account - which comes with Apache & PHP installed whether you want it or not. At some point …

Continue reading “I finally figured out my mysterious 418/Unused HTTP Status Code”

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 in the virtualenv to their latest versions while I was at it. To do this, I upgraded pip, then used pip-review. To upgrade pip & install pip-review system wide, run this on the command line:

$ sudo -H pip install --upgrade pip
$ sudo -H pip install pip-review

Then upgrade eveything in the sites virtualenv:

$ sudo apt-get install libjpeg-dev
$ workon duncanlock.net
$ pip-review …
Continue reading “How I upgraded this website to Pelican 3.6”

We use CentOS VMs 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 perl

Make sure that you’ve only got the current set of kernel headers installed - the one for the kernel you’re actually running. Having more than one set installed prevents this working properly. Running this should show you one version of each kernel package:

$ rpm -qa | grep kernel | sort

It should look something like this:

dracut-kernel-004-336.el6_5.2.noarch …
Continue reading “Reliably Building VirtualBox Guest Additions on CentOS 6.x”

IMG 20131119 095456 small
Figure 1. Taken from my Wife’s office window, around 10am.

The weather was great this week - crisp and autumnal, with beautiful sunshine all week. It snowed a little on the local mountains and Cypress Mountain has opened for (limited) Skiing already, using the lower temperatures to make lots of extra snow. Whistler also opened this week, along with Grouse.

IMG 20131119 161127 small
Figure 2. Taken from my Wife’s office window in the afternoon, during the Golden Hour, which is now around 4pm.

In other, even better news, I’m starting a fantastic new job with PHEMI Health Systems on Monday - allowing me to afford to actually go skiing. I’ll be working as a front-end web developer, helping to build their healthcare information system, directly helping to improve clinical productivity, patient outcomes and medical research. Very excited to be using my …

Continue reading “It was a Good Week”

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:

ParameterEffect
-thumbnailSimilar to -resize, but optimized for speed and strips metadata.
x300Make the thumbnail 300px tall, and whatever width maintains the aspect ratio.
-background whiteSets the thumbnail background to white.
-alpha removeRemoves the alpha channel from the thumbnail output.
input_file.pdfThe PDF file to use as input.
[0]The page number of the input file to use for the thumbnail.
output_thumbnail.pngThe output thumbnail file to create.

If you want larger thumbnails, just change the x300 parameter to match. If you want to output .jpg’s (or anything else, like .gif), just change the file …

Continue reading “How to create thumbnails for PDFs with ImageMagick on Linux”

A dummy placeholder image, 200x200 pixels square.
Figure 1. This figure has automatic figure numbering.

I had a feature request for automatic figure numbering, like latex. I was revamping this plugin for Pelican 3.3 anyway - and this didn’t seem too hard - so I decided to add it.

So, the Better Figures & Images plugin now supports automatic figure numbering. To enable this for all posts, just add this to your config file:

FIGURE_NUMBERS = True

If you want to enable this per post, just add this to the metadata at the top of the post:

for restructuredText add this:

:figure_numbers: true

and for Markdown add this:

figure_numbers: true
Caution:

Can you have Figures in Markdown?

I use reStructuredText for this site, and I’m not sure if you can even have Figures in Markdown documents - and I haven’t tested it, so caveat emptor …

Continue reading “The Better Figures & Images Pelican plugin now supports Figure Numbering”

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 a way that meant this no longer worked. I also had to update my Better Figures & Images plugin to take this into account.

Previously, I’d been linking to my images like this, both in my theme:

/* Theme CSS Image Link */
background: #2C71B8 url(/static/images/blueprint-background.png) repeat;
{# Theme HTML/Jinja image link #}
<meta name="twitter:image" content …
Continue reading “How I upgraded this website to Pelican 3.3”