Deduplicating zsh Command History Automatically Once a Day

Automatically Deduplicating zsh Command History in zshrc

With daily terminal work, the same commands pile up in ~/.zsh_history over and over. History searches with peco / Ctrl-R end up full of noise, and the file tends to grow. The zshrc I use every day is part of a dotfiles repository where I keep all my dot files together under Git. This time I decided to touch that zshrc and add settings that cut down the duplicates. Deciding the requirements first Before doing any work, I settled on the following specification. [Read More]

Migrating beautifulhugo from Legacy to Current: Dark Mode, Search and TOC

Redoing the theme upgrade in stages after the first attempt was reverted in 34 minutes

When I looked into the beautifulhugo repository, I noticed that the current master (referred to as the current version below), which is separate from the legacy version I have been using, bundles dark mode, search and a table of contents (TOC) all together. I had actually tried once before, in a commit called “Update Beautifulhugo”, to bump only the pin in go.mod, but 34 minutes later I reverted it. The commit log does not record what happened, but at that time I swapped only the pin without thinking about things like the breaking changes from Bootstrap 3 to 5, so the display probably broke and I rolled it back immediately. This time, as a rematch, I decided to redo the migration from the legacy version to the current version in separate stages. [Read More]

Running phpIPAM on Docker to Automate LAN IP Address Management

Building phpIPAM with Docker for Automated LAN IP Address Management

The IP address ledger I had been keeping in GoogleSpreadSheet was no longer keeping up as the number of devices grew. The IP addresses actually in use and what the sheet said drifted apart more and more, and I was reaching the limit of taking stock by hand, so I decided to start phpIPAM with Docker and move IP management there. Starting it with Docker I settled on the following docker-compose.yml. [Read More]

Things to Decide First When You Start a Hugo Site

Items worth deciding before you build a site with Hugo

A note to myself on the items I want to decide first in Hugo Choosing a theme The way front matter and shortcodes are written differs from theme to theme, and layout and CSS matter too, so I want to take my time at the start and settle on a theme that is easy to customize Hugo Themes: Complete List Since a Hugo version upgrade can turn some syntax invalid, it may be better to pick a theme that is updated frequently My personal recommendations would be Academic, Tranquilpeak, Learn and Beautifulhugo [Read More]

How to Make Hugo Output .html URLs with uglyURLs

How do you make the site output .html?

The output format of a site differs from theme to theme, but when you write an article called content, the output format is normally something like the following. Copy https://your-site/post/content/ https://your-site/content/ When you want to make this your-site/content.html, that is, end it in .html Add the following inside config.toml Copy uglyURLs = true Note: If “url:xxxx” is written in the front matter of an article, it takes precedence, so uglyURLS has no effect and you do not get the html format. If it is written, only that article gets output as something like your-site/xxxx/ [Read More]