I ran into a weird problem where I couldn’t access the OPNsense web UI using an OPT1
interface. The fix is easy, but it can be very confusing and it’s all caused by an
unintuitive default.
I’ve been playing around with OPNsense inside a VM as I prepare to replace my current
pfSense router which is no longer fast enough. I have a quad network card which is
passed through at the hardware level and, in addition, I have the virtual network
interface provided by the hypervisor, xcp-ng.
The title of this post isn’t supposed to be provocative. After all, it’s simply the
textbook definition of what git is. So why bother stating it? Well, I’ve worked with a
fair few junior developers now and I’m starting to see a pattern. Many of these
developers have never programmed without git and they see git simply as “the way to
get new code into a repository”. A glorified copy, essentially—but an annoying one
that is prone to going wrong.
The Norfolk Coast Path (NCP) is a waymarked, long-distance footpath and National Trail
in England. It stretches from Hunstanton all the way along the Norfolk coastline to
Hopton. I walked it with my partner Vicki over the course of seven days in
September 2022.
Planning
The NCP is around 135 km (83 miles) long and quite flat. The way is mostly on good, well
trodden paths with some slower sections on sandy and shingle beaches (but you can often
choose to walk inland on firmer ground instead). Fortunately there are no pebbles and
the shingles didn’t become too tiring.
At first glance, undo seems like a simple thing expected of most software these days and
hardly worth writing about. Indeed, when I say Emacs has a very powerful undo
system—probably more so than any other text editor—you may wonder what could make an
undo system powerful. So let’s start by considering two big problems most undo systems
have:
If you undo something, make some changes, then change your mind, what you undid is
now lost and unrecoverable,
If you make changes in two parts of the same file you cannot undo changes in the
first part without undoing changes in the second part too.
Emacs comes with solutions to each of these out of the box. Read on to understand how it
works and how we can improve upon the defaults even more.
When you work a lot on the command line, history can be invaluable. I’ve lost count of
the number of times I’ve forgotten how I ran some earlier command and used my bash
history to find out what it was. This is one of the big advantages of using CLIs over
GUIs.
Accessing history
The main interface I use to my history is ^P (Ctrl-P). This recalls the previous
command from history. Subsequent presses step further back and ^N steps forward
again. These keys are set in muscle memory at this point, I use them that much (they
also work in emacs and many other places).
For as long as I’ve been a Firefox user—almost 20 years at this point—it has
featured a “quick find” bound to the venerable / (forward slash) key.
Following a pattern established by other software like less, man, and vi the slash
key was simple: it finds stuff in the current page.
Common patterns like this are great. It’s why everyone has agreed on what Ctrl-C and
Ctrl-V (or very similar) should do across all operating systems. The / key used to
be like this, but not any more.
Org mode supports icons in its agenda views. The icons can be given as either file
paths to images (like SVGs), as image data or as a display property. I use a Nerd Font
along with the nerd-icons package in my Emacs config, so I thought I might as well
enable icons in my org agenda views.
The nice thing about using nerd fonts is this works perfectly in text mode too (assuming
you have a nerd font configured for your terminal emulator).
This blog is a static site built with Hugo. Being static means it can be served from a
basic, standard (you might say stupid) web server with no server-side scripting at
all. In fact, this blog is currently hosted on Github Pages, but it could be anywhere.
Up until now, if you wanted to include an interactive map on a static site you were
limited to using an external service like Google Maps or Mapbox and embedding their JS
into your page. This would then call to their non-static backend service to produce
some kind of tiles for your frontend.
Docker Compose is a brilliant tool for bringing up local development environments for
web projects. But working with multiple projects can be a pain due to clashes. For
example, all projects want to listen to port 80 (or perhaps one of the super common
higher ones like 8000 etc.). This forces developers to only bring one project up at a
time, or hack the compose files to change the port numbers.
I use the Unbound DNS resolver built in to pfSense. By default the resolver filters out
any results that are private IP addresses. Normally this makes sense: no public domain
should have a private address. But sometimes it does make sense. For example there are
some useful services like sslip.io that will resolve to any IP address that you like.
So 127.0.0.1.sslip.io resolves to to 127.0.0.1. This is can be useful for local
development, especially when working with containers and reverse proxies and the like.