Automatically generating usermap and groupmap for rsync

I recently had to restore a server from backup after rebuilding it, and ran into a problem I've only encountered occasionally: The user and group IDs were different on the new server configuration compared to the backup. For example, the user "prosody" was user 121 on the old build and 109 on the new one. Just restoring with rsync would leave files with the wrong owners and groups, which could lead to various security issues (and downtime and bugs, of course.) The backup was full of mystery-meat owners and groups.

Luckily, I also had a backup of /etc/passwd and /etc/group, and I was able to write a script to work these into an rsync command.

Read more

Eating black walnut

A few weeks back I collected 40 black walnut fruits at the farm where we get our CSA. This is the eastern American black walnut, Juglans nigra. (The usual kind I see in stores is English walnut or Persian walnut, Juglans regia.) I smashed off the husks to make dye (perhaps more on that another time) and dried the nuts inside for food. Today I finally smashed them open, collecting a little over a half cup of nutmeats. I made two remarkable discoveries:

  1. They taste pleasantly like blue cheese
  2. They don't hurt my mouth

Read more

Making redo rebuild when directory contents change

I recently discovered redo, a replacement for make. It is based on a totally different and far simpler concept of rebuilding, but it has one deficiency in common with Makefiles: There's no built-in way to rebuild when a directory has been modified.

Updated 2020-09-10 with a much, much faster version.

Read more

From WordPress to my static site generator

I used WordPress for about 15 years, and while it was absolutely a great way to get started, it eventually became too great of a security and maintenance burden. Now I've switched my blog over to a static site generator, and I think it was a great decision.

Read more