About the author

Hi, I'm Ben. I've been trying to make computers do things I want them to do for years.

Over the last decade people have been paying me to get computers to do things they want them to do as well.

Want to get in touch? You can reach me on hi.ben@dartoxia.com (...wtf is a dartoxia?)

How to use Consul DNS in Nomad Docker jobs

Recently I've been playing with Nextcloud. At first I had a lot of trouble getting it to run performantly in my nomad cluster - lots of crashes and the 'Preview' app basically toppling over the whole application. However I was able to get thi after running the backend, DB and cache in different containers, using the distinct_nodes constraint and making sure I was provisioning enough resources for the backend (specifically 1.2GB memory).

I've not tuned my setup perfectly, and from time to time the DB or the cache seems to get restarted (not sure if this is load related, or the preemption that I enabled recently). These restarts were causing the host and port mappings of services to change since Nomad assigned them dynamically in my setup. Unfortunately the Nextcloud docker images don't support dynamically adjusting configuration based on changes to environment variables - so whenever the db/cache host/port mappings changed, my Nextcloud app stopped working!

I needed to use Consul's DNS interface and static port bindings in nomad jobs to provide fixed config to Nextcloud.

How to enable pre-emption in nomad

I needed preemption to be enabled for services in my nomad cluster to shuffle around some existing services and allow a new larger multi service job to be allocated. Specifically, I had the distinct hosts constraint on the services in my job, and there were no nodes immediately available to allocate them to.

Annoyingly if you don't enable preemption during server bootstrapping, you need to enable it against the API directly, this stanza isn't used to set the scheduler config after bootstrapping and the CLI doesn't seem to support changing the scheduler settings.

How to set a transparent background-color with a hex color code

Recently I was showing some data in a table, and I needed to apply colors to columns. I was working with a predefined palette of hex codes that worked well for visualising data, but when text was in front of the colors it became unclear.

At the beginning, my table looked a bit like this:

Col0Col1Col2Col3Col4
20090120224204
4853424348

Argh! That text is barely readable, I need a way to display the same colors, but with a fixed amount of transparency when used as a background...

WTF is StuckAt.WTF?

WTF is this site? Why did I build it?

Computer technologies evolve so quickly that I often find myself asking 'What The Fuck is this $#@%?'.

I expect a lot of other enthusiasts have found themselves thinking the same thing. It's a question which implies a lot:

How was StuckAt.WTF built with $2.88?

When I first built this site (around 5 days ago!) I was keen to basically spend no money. I wanted to be able to work quickly with some tools I was already a bit familiar with (react, typescript).

It seemed like I could probably eliminate all costs, except domain registration, by:

  • Make a statically built site with Next.js.
  • Publish builds to Firebase.
  • Serve access to the site using Cloudflare's CDN.

The only cost that I incurred was the $2.88 registration fee for the StuckAt.WTF domain from Porkbun.