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.
Even after using Emacs for 15 years there’s still so much I can learn. I probably should
have already known this, but there’s a first time for everything.
It’s rare that Emacs hangs. Exceedingly rare. Which is probably why I didn’t know how to
deal with it. Today Emacs started hanging when trying to open files over a remote TRAMP
session (SSH).
The most important key of all that everyone who uses Emacs knows is C-g. This is the
universal “quit” key and it has the power to interrupt any long running processes. What
I didn’t know about is M-x toggle-debug-on-quit. I’ve used toggle-debug-on-error
extensively when programming Elisp (I even have it bound to a key in Elisp
buffers). toggle-debug-on-quit is similar except the debugger is invoked when you
C-g.
This is a little trick I just applied and thought was cool enough to write down.
Let’s say you want to replace a name that is used throughout a project. Due to various
conventions/restrictions in use the name might appear in several forms like:
MY_COOL_NAME, my-cool-name, my_cool_name etc.
In Emacs you can invoke regexp replace across an entire project by invoking
project-query-replace-regexp, by default bound to C-x p r. This will first prompt
for the regexp to search for, then what to replace it with.
I’ve been using Emacs for almost 15 years now. Somewhat surprisingly, I hadn’t touched
my config in three years! It’s been working that well. But now that Emacs 29 has been
released I’ve decided to take a look at what’s new and there have been some big changes,
particularly for Python.
Goodbye Elpy, Goodbye Projectile
Elpy has been the primary mode for Python development for me for years now. But sadly,
it looks like the project is no more. The good news is there are better ways to do what
it did. It’s bittersweet to say goodbye to it and I will be eternally grateful to the
authors, but progress is progress.
On Linux, software should generally be installed with your system package manager (apt,
yum, portage etc.) However, Calibre is a bit “special” in this respect. While
well-loved, it’s known to be a bit difficult to package (to say the least) and most
distro packages you’ll find are out of date. The official website recommends against
using any distro packages and instead installing it directly from the site.
Unfortunately, the official instructions are problematic for a number of reasons. For a
start, copying and pasting commands from the browser is considered dangerous. But
that’s easy to fix, in bash do Ctrl-X Ctrl-E and your preferred text editor will be
opened for you to type your command. This means you can inspect what is pasted before
is run (save the file then exit the editor to run the command). Very important. Always
do this when copy/pasting from the web.
If you want to start Arduino programming you’ll notice a lot of the documentation and
tutorials are centred around the Arduino IDE. Now, obviously, as an Emacs user you’ll
be loath to install something like Arduino IDE, let alone actually use it. The good
news is it’s super easy to get started with Arduino with any editor, including Emacs and
even Vim if you so desire.
All the Arduino IDE is doing is calling a cross-compiler toolchain then using avrdude
to communicate with the Arduino to upload software. The Arduino Uno and Nano both use
the Atmel AVR platform so what you need is a toolchain that can target that platform.
Now, you could install your own toolchain and call avrdude directly. If you know how
to do that then I guess you can stop reading now. But if you don’t, or aren’t
interested in learning how (it’s not very interesting), then read on.
I love going to the cinema, but I’ve always been disappointed that I can’t see older
films and I can’t see them when it’s convenient for me. There have always been ways to
watch films at home, but even today when large screens and high-definition formats are
ubiquitous, it’s just not the same as the cinema experience. There’s something
completely different about the big screen that a TV in a living room can’t replicate.
For that reason I’ve wanted my own home cinema for as long as I can remember. The
problem is I don’t want to spend a lot of money on it.