duncanlock.net

Ninja is a surprisingly nice build system for tiny projects. That's more or less the opposite of what it's designed for, but it works really well for tiny things.


The content-type guessing done by AWS CLI is based on the mimetype definitions available on your system. You can improve the mimetype guessing by updating these definitions.


I had an issue where the AWS CLI wasn't guessing the content-type of SVG files correctly on sync and was setting them to `application/octet-stream` - the default "I don't know" mimetype. This is a quick fix for that.


Three mason jars, full of fermenting things. Two Bánh Mì(ish) and one eggs.
Figure 1. Three mason jars, full of fermenting vegetables. Two Bánh Mì(ish) and one eggs.

I’ve been fermenting vegetables of various kinds (and occasionally other things) at home for a little over two years. It’s a fun, interesting & nutritious hobby. On the whole it’s pretty easy and low stakes – the worst thing that happens is a few cucumbers go mouldy.

Because it doesn’t involve any heat – but does include pouring, measuring, stirring, spiralizing, grating (and some chopping) – it’s ideal to do with little kids.

According to my notes (which I didn’t start initially), I’ve made ~56 batches of ferments, ranging in size from a single 1l mason jar, to three 2l ones.

These are my lessons so far:

The difference between science & screwing around, is writing it down

As they say, the …

Continue reading “Lessons from Two Years of Fermenting”

How to slugify strings in bash, using a fairly simple function.


Sometimes I want to resolve several promises at once, then do something when they're all done. For example, make several API calls, then do something with all the results. Promise.allSettled is a better way to do this.


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.


Gauntlet Screenshot
Figure 1. Gauntlet, by far and away the kids favourite game so far.

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 …

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

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 …

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

Switch on logging for cron

Edit the /etc/rsyslog.conf or /etc/rsyslog.d/50-default.conf (on Ubuntu) file and make sure you have the following line un-commented (or add it if it’s missing):

cron.*                         /var/log/cron.log

Then restart rsyslog and cron:

$ sudo service rsyslog restart
$ sudo service cron restart

Cron jobs will now log to /var/log/cron.log. What cron actually outputs to this log looks something like this:

Jan 31 07:30:01 duncan-desktop CRON[3971464]: (duncan) CMD (/home/duncan/bin/backup-chrome-window-placement.sh 2>&1 # JOB_ID 3)
Jan 31 07:31:04 duncan-desktop anacron[3971646]: Anacron 2.3 started on 2021-01-31
Jan 31 07:31:04 duncan-desktop anacron[3971646]: Will run job `cron.daily' in 5 min.
Jan 31 07:31:04 duncan-desktop anacron[3971646]: Jobs will be executed sequentially
Jan 31 07 …
Continue reading “Debugging cron jobs”