duncanlock.net

My new favourite thing in JS is Nullish coalescing: The nullish coalescing operator (??) is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.

Time for another update on the Retro Gaming project. It’s been roughly a month since the last update and we’ve been playing a bit more often this time.

Favourite Games So Far

Roughly in order of playtime:

Gauntlet is far and away the kids favourite game so far. Almost nothing else got a look in since I put it on. Even Super Mario Bros is a pretty distant second place, and the other games have barely been played at all.

I think there are two reasons for this. Firstly, Gauntlet is a 4 player co-operative game. So far we’ve only played with two players, but even then, co-op games are just really fun. I think the other reason is that Gauntlet is an arcade game and Super Mario Bros isn’t …

Read More

Time for an update on the Retro Gaming project. It’s been almost four months since we started and it’s been, predictably, lots of fun. What with work and school and everything else, we have very little time for playing computer games. That, combined with a fairly dry winter & spring letting us get outside more, means that even with the Covid-19 pandemic curtailing activities, we haven’t clocked very many hours of playtime.

Favourite Games So Far

Roughly in order of playtime:

In the end, we didn’t actually play any ZX Spectrum or C64 games at all, sadly. I played a lot of these when I was a kid, so I was secretly disappointed …

Read More
Asciidoc
Figure 1. Asciidoc.

I’ve been using reStructuredText for writing on this blog, because it has lots of built-in features that markdown doesn’t.

However, reStructuredText’s actual syntax is a bit…​ fiddly - particularly its non-atx headings, too many things relying on lining up white space, etc…​ If I don’t use it for a bit, I have to look up or copy & paste all the advanced syntax.

I’d prefer to use AsciiDoc, as it has all the extra features, and if you use Asciidoctor, all the simple stuff is the same as markdown - which isn’t (currently) standard AsciiDoc, but is a nice simplification.

The subset of features from reStructuredText (or Asciidoc) that Markdown doesn’t have – and that I’m actually using on this blog, are:

  • Figure/Images with captions
  • Admonitions
  • Front-matter/Metadata
  • Footnotes
Read More
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.

Read More
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 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, topping up with brine.

Start be 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:

  • 45g salt per …
Read More
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 …

Read More
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 I …

Read More

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 …
Read More

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
kernel-2 …
Read More