duncan­lock­.net

How to find a git repositories default branch name


Hand-drawn map of the Kingdom of Hyrule.
Figure 1. Our hand-drawn map of the Kingdom of Hyrule. I drew a 2x1 grid in Inkscape and printed it out, then we filled it in as we went along.

It’s been about six months since the last update. We’ve mostly been camping, playing outside and generally enjoying the summer - although we have also squeezed in some gaming, here and there.

Favourite Games So Far

We spent almost all of our game time playing Legend of Zelda. It’s a towering achievement – a truly great game. I’m amazed that this thing is from 1986 – it doesn’t feel like it.

It’s also a great example of a different kind of co-op game. One where you play together by collaborating: discussing what to do & where to go next, how to tackle things, etc…​ We also took turns …

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

Two screenshots of the nginx Welcome page, side-by-side, showing the page before the change and afterwards. The one on the left is dark-on-light and the one on the right is light-on-dark.
Figure 1. The nginx “Welcome” page, before & after my intended change.

I wanted to add dark mode support to the default nginx “Welcome to nginx” page. This is about the simplest change I could choose to make - it’s a simple, backwards compatible, small additive change to one single index.html file. My initial version of this change looks like this, and is added to the files <style> element, in the <head> section:

@media (prefers-color-scheme: dark) {
  body {
    background-color: #363839;
    color: #d1cec9;
  }
  a {
    color: #c4c4ff;
  }
}

So, this is the process of getting that change from my brain, into the upstream nginx codebase. 

Continue reading “How to Contribute a Change to Nginx”

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


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

Continue reading “Custom Per Page CSS With Pelican”

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


They will dig up your garden to get them.


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


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.