I’d been idly considering getting a 3D printer for a while, but have only recently taken the plunge. I picked
up a Sovol SV06 from
Amazon for £199.99, which is a model commonly recommended for beginners. About three weeks later, I think I’ve
finally finished fixing all the problems the printer has, and thought I’d document them.
Setup and out of the box performance
The setup of the printer itself was straight forward. Most parts are assembled, you just have to bolt the
frame together, bolt the various parts to the frame, and connect some wires. The hex bits in the
iFixit Mako Bit Set
were a godsend for this, as the included hex keys were a bit flimsy.
Upgrading the RAM in a Dell G15 laptop
Published on Jul 29, 2023
The Dell G15
I currently use a Dell G15 laptop for work. It has served me well for a little over a year, but recently it
has been struggling a little with my day-to-day workload. It came with 32GB of RAM — the highest possible
specification at the time — but that is apparently no longer enough for me.
For a recent project, I was working on a Rust library used in an Android app. That meant running the usual
glut of Android tools (Android Studio, an emulator and at least one Gradle daemon) alongside a normal IDE
(IntelliJ IDEA). Throw in a web browser and a couple of electron apps, and I often managed to use all 32GB.
When you start swapping memory out to an encrypted disk — even an SSD — it doesn’t make for great performance.
At first, I tried to work around this by enabling the Linux out-of-memory (OOM) killer, but it turns out that
it’s not too good with Electron apps: it will kill the large browser process, but then the small Electron
wrapper will just respawn it.
Generating infinite avatars
Published on Dec 30, 2022
An example of one of the unique avatars
I recently added a new ‘about’ section to the top of my website. Like most about pages, it has a picture.
Instead of a normal photograph, however, you’ll see an AI-generated avatar. This is admittedly fairly trendy
at the minute – apps like Lensa offer to make you profile pictures if you give them a set of photos and some
cash – but I’ve done something a bit different.
You see, there is not just one image that has been carefully curated, edited, and uploaded. No, the image you
see quite possibly has never been seen before and will never be seen again. It’s unique. Just for you.
Background: Stable Diffusion, DreamBooth, et al
You’ve probably heard of Stable Diffusion, the open
text-to-image model developed by LMU Munich. Given a text prompt it starts with a random array of static and
repeatedly transforms it, each step moving away from pure entropy and towards a real image that befits the
prompt. It stands in contrast to competitors like DALL-E and Midjourney in both the code and the model being
freely and publicly available.
Docker reverse proxying, redux
Published on Dec 6, 2022
Six years ago, I described my system for
configuring a reverse proxy for docker containers. It involved six containers including a key-value store and
a webserver. Nothing in that system has persisted to this day. Don’t get me wrong – it worked – but there were
a lot of rough edges and areas for improvement.
Microservices and their limitations
My goal was to follow the UNIX philosophy of “do one thing and do it well”. Unfortunately, that doesn’t really
work when applied to network services that have to interact with one and other. UNIX tools are built upon a
common file system and simple data passed over STDIN. Microservices don’t have that shared foundation. You
could make one: companies that use microservices in anger often have a team that deals with the “developer
experience” of creating and using microservices. But as a solo developer that’s not something I wanted to
spend my time doing.
Adventures in IPv6 routing in Docker
Published on Oct 24, 2022
One of the biggest flaws in Docker’s design is that it wasn’t created with IPv6 in mind. Out of the box Docker
assigns each container a private IPv4 address, and they won’t be able to reach IPv6-only services. While
incoming connections might work, the containers won’t know the correct remote IP address which can cause
problems for some applications. This situation is obviously suboptimal in the current day and age. It’s a bit
like not supporting HTTPS on a website – you might not have any issues because of it immediately, but you’re
fighting against the currents of progress and are making life worse for your users.
Thankfully, it’s now relatively easy to make Docker behave a lot nicer. The
docker-ipv6nat project has been around since 2016,
and uses an IPv6 overlay network and some iptables magic to route traffic to and from containers in a sensible
fashion. It uses NAT to emulate the behaviour Docker employs for IPv4 traffic; while using NAT with IPv6 is an
anathema, I think it makes sense for containers. You could give each container a publicly routable IPv6
address, but that brings with it a lot of headaches: you’re basically going to be forced to implement service
discovery and some kind of DNS management to deal with the fact that your containers will be popping up on
randomly assigned IP addresses. That is completely overkill for people running a small number of services on
one or two physical boxes; and if it’s not overkill for you then you’re probably already looking at more
complicated orchestration solutions like Kubernetes.
More recently, similar functionality has been built into the Docker daemon itself. You can now
edit the config file to enable ipv6 and each
container will be assigned an address in the range specified when it uses the default bridge network. This
gives more-or-less the same functionality of docker-ipv6nat – you lose a little flexibility as you can’t
disable IPv6 on the default bridge, but that’s a very worthy trade for having the functionality built-in.
So far this all seems very simple. Hardly worthy of being called an “adventure”. Enter stage left: the wicked
witch of destination address selection…