duncanlock.net

Archive

2021

August

14th August, 2021
5 min read

How to Contribute a Change to Nginx

I wanted to add dark mode support to the default nginx "Welcome to nginx" page. This is the process of getting that change from my brain, into the upstream nginx codebase.

5th August, 2021
1 min read

Cssmin is Unmaintained & has a Bug with Complex :is Selectors

cssmin is unmaintained & has a bug with complex :is selectors

July

24th July, 2021
2 min read

Custom Per Page CSS With Pelican

Sometimes I want to have a just _a tiny bit_ of CSS that's unique, just for one page or post. I don't want a whole new stylesheet, or to have to add this to my site-wide theme, just for one post - I want a simple way to add it in the post itself. This is how I did it.

19th July, 2021
1 min read

The CSS :is selector is pretty neat

You can use the new CSS :is selector to write complex CSS selectors in a much more compact way

13th July, 2021
1 min read

Don’t Put Eggs Under Your Tomatoes, if you have Raccoons

They will dig up your garden to get them.

11th July, 2021
1 min read

Running python webservers on port 80 without root

How to allow python (or anything else) to listen/bind to port 80 without being root

June

22nd June, 2021
1 min read

Ninja is a surprisingly nice build system for tiny projects

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.

21st June, 2021
1 min read

Better content-type guessing in AWS CLI

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.

21st June, 2021
1 min read

Fixing content types in s3 using the AWS CLI

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.

16th June, 2021
3 min read

Lessons from Two Years of Fermenting

Here's what I've learned from fermenting vegetables of various kinds (and occasionally other things) at home for a little over two years. It's a fun, interesting & nutritious hobby.

15th June, 2021
1 min read

Good, simple, Bash slugify function

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

15th June, 2021
1 min read

Promise.allSettled in JavaScript

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.

9th June, 2021
1 min read

Nullish coalescing in JavaScript (??)

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.

April

25th April, 2021
3 min read

Speedrunning Computer Games History with a 6yr Old - Part 3

The one where we just play Gauntlet over and over.

March

27th March, 2021
4 min read

Speedrunning Computer Games History with a 6yr Old - Part 2

It's been almost four months since we started and it's been, predictably, lots of fun.

January

12th January, 2021
12 min read

Using AsciiDoc & Asciidoctor for blogging

Using AsciiDoc & Asciidoctor for blogging.

2020

December

27th December, 2020
7 min read

Speedrunning Computer Games History with a 6yr Old - Part 1

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.

April

28th April, 2020
3 min read

Fermented Bánh Mì/Đồ Chua(ish) Recipe

My very loose adaptation of traditional Vietnamese Bánh Mì/Đồ Chua, honed by trial and error into this simple & delicious form.

2019

August

10th August, 2019
3 min read

Basic Pickles or Fermented Cucumbers Recipe

Here's my fermented cucumbers recipe, honed to perfection over many trials.

2016

March

22nd March, 2016
3 min read

I finally figured out my mysterious 418/Unused HTTP Status Code

I've had a mysterious broken page on this site for a while - but been too busy to look into it. I finally made the time to figure it out.

5th March, 2016
3 min read

How I upgraded this website to Pelican 3.6

This site has been generated using Pelican 3.3 for over two years. I finally found some time to upgrade to the current version of Pelican, 3.6.3. This is how I did the upgrade.

2014

January

22nd January, 2014
2 min read

Reliably Building VirtualBox Guest Additions on CentOS 6.x

It took me a while to figure out how to get the VirtualBox Guest Additions to build reliably on CentOS 6.x - here's how to do it.

2013

November

22nd November, 2013
1 min read

It was a Good Week

I am a very, very lucky guy - and I have a lot to be thankful for.

18th November, 2013
1 min read

How to create thumbnails for PDFs with ImageMagick on Linux

How to create image thumbnails for PDFs, on Linux, using ImageMagick - a simple explanation, with examples.

October

19th October, 2013
4 min read

The Better Figures & Images Pelican plugin now supports Figure Numbering

My Better Figures & Images Pelican plugin now supports automatic Figure Numbering - Yay! Here's how it works.

18th October, 2013
4 min read

How I upgraded this website to Pelican 3.3

A few of the changes in Pelican 3.3 might mean making some changes to your site in order to upgrade. Here's how I upgraded my site from Pelican 3.2 to 3.3.

September

13th September, 2013
1 min read

Obrigado Deny!

I've recently been corresponding with Denny Dias, from Brazil - and we've been helping each other out a bit with building themes and whatnot...

August

27th August, 2013
9 min read

Comprehensive Linux Backups with etckeeper & backupninja

Having an easy to setup, comprehensive, automated backup strategy is very relaxing - here's how to create one.

19th August, 2013
1 min read

How to convert FLAC files from 24/48 bit to 16 bit on Ubuntu Linux

How to convert FLAC files from 24/48bit to 16bit - converting all the files in a folder, preserving the metadata.

July

17th July, 2013
10 min read

Sunshine Coast: Thormanby Islands & Smuggler Cove Kayak Trip

Trip Report from our Canada Day 2013 long weekend kayak camping trip to Thormanby Islands, Smuggler Cove & Secret Cove, on the Sunshine Coast, BC.

5th July, 2013
3 min read

How I compress PNG files on this website

Using a careful combination of compression techniques, I can get up to 3x compression over regular PNG files, for my use case. Here's how...

June

28th June, 2013
3 min read

Useful Thunar Custom Actions

Here's how to add useful custom actions to Thunar's right click menu - and a collection of handy actions to get you started.

23rd June, 2013
2 min read

Post Statistics Plugin for Pelican

A Pelican plugin to calculate various statistics about a post and store them in an `+article.stats+` dictionary. Includes time to read, word count, word frequency and Flesch-kincaid stats.

19th June, 2013
14 min read

A Marvellous & Incomplete Compendium of reddit Automatons & Bots

Reddit had 71.4m visitors last month, with over 2.3m people logged in. 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...

14th June, 2013
11 min read

The Smart Guide to Stack Overflow: Zero to Hero

How to use Stack Overflow effectively, how to gain reputation and become a valued, successful member of the community.

7th June, 2013
9 min read

How to switch to Compton for beautiful tear free compositing in XFCE

How to quickly & easily setup & configure Compton in XFCE for beautiful, tear free, glassy smooth window dragging, drop shadows, etc...

May

31st May, 2013
7 min read

Magic Phone Numbers: My VOIP Setup, with voip.ms

I wanted something better than Skype, exactly like a regular local phone number - just call it and ring a phone on the other side of the world, for free.

29th May, 2013
8 min read

Better Figures & Images Plugin for Pelican

How to get perfect and responsive images and figures with Pelican - using the Better Images & Figures Plugin.

17th May, 2013
9 min read

How I built this website, using Pelican: Part 1 - Setup

I take you from zero to a complete, fully functional website, built the way a professional web developer would do it, using Pelican.

13th May, 2013
4 min read

Using UDF as an improved filesystem for USB Flash Drives

Most USB Flash drives are formatted using the FAT32 filesystem - which only supports files up to 4GB each, no matter how much free space you've got.

7th May, 2013
1 min read

How to convert Apple Lossless/ALAC/.m4a files to FLAC with avconv, on Ubuntu Linux

How to convert from ALAC to FLAC - converting all the .m4a files in a folder to .flac files, preserving the metadata.

3rd May, 2013
2 min read

How to set your Compose Key on XFCE/Xubuntu & LXDE Linux

The compose key on Linux is _incredibly_ useful, but not set by default - and on XFCE there's currently no GUI to change it. Here's how to do it...

April

26th April, 2013
3 min read

Welcome to the New Site; same as the Old Site.

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.