recreationally human

part-time human, full-time [REDACTED]

Read this first

What could better cross-(micro)service messaging look like?

For anyone who knows me at all, this is something I’ve tinkered with at great length in my pet project around message queuing / pubsub / HTTP proxying, singyeong. Lately, I’ve been thinking about the interface to it, and wondering if I’ve been approaching this from the wrong direction.

As a quick recap, singyeong is a message queue + pubsub + HTTP proxy that allows routing payloads via client metadata. To show what this means in an example, suppose you were running some large multiplayer game server. You’re most likely splitting up players across a bunch of servers, and you need to be able to send a message to the server holding a specific player, for any number of reasons. You might do this with:

  • pubsub + discarding if the player isn’t on that server, but then you have to pay the price of a fanout to every game server instance, which could add up at scale.
  • consistent hashing, which...

Continue reading →

NFS sucks

I built a NAS recently. It’s a nice little box: I rackmounted an HPE ProLiant DL325 G10 (EPYC 7402, 64GB, 2x 240GB SSD) with a ES212X12 JBOD to hold 12x 8TB disks. Installing TrueNAS was pretty painless, convincing the ProLiant to be quiet and not sound like a jet engine was a bit annoying but not too bad, and overall it was a decent experience.

And then NFS happened.

I don’t think I’ve hated a piece of tech more on first use, honestly.

NFS works except for all the parts where it doesn’t. Share mounted too long? Stale file handles! You hit ^C in the middle of copying a file? Stale file handles! Trying to rsync from local to the NFS share? Stale file handles!

SMB was less painful than this.

View →

Dynamic function “definitions” in Elixir

This is more of a dumb hack than anything, I just happened to learn about this today.

Suppose that you’re writing a shell-command executing library. You can, of course, always use System.cmd/3 to do so. However, what if you wanted to make a cool interface like MyModule.echo "test" or MyModule.program_name :banana? Well, it turns out you can just do this:

defmodule Test do
  def unquote(:"$handle_undefined_function")(function_name, function_args) do
     Process things here!

and suddenly you have magic “dynamic function definitions”!

->  iex
Erlang/OTP 23 [erts-11.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe]

Interactive Elixir (1.11.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> defmodule Test do
...(1)>   def unquote(:"$handle_undefined_function")(function_name, function_args) do
...(1)>     IO.inspect function_name

Continue reading →

Embeddable scripting langs for Rust, and why I hate them all

For the last few months, I’ve been slowly tinkering away at writing my own custom X11 (via xcb) window manager, dawn (not open-source yet, sorry!). Because I hate the thought of dealing with named pipes and the like for things such as “resize this window” “move that window over there” etc etc etc, I decided to instead just add scripting to dawn so that I can do all this stuff via scripting. I’ve not yet gotten as far as designing a scripting API for this, and deciding what all I’d expose to the scripting language, since the specifics of the language will, to an extent, affect how I do this.

I’ve not actually tested out all of these; this is more of an overview of my first impressions and how I feel about the languages that are actually implemented. Those first impressions matter, y'know? And I don’t want to use something that gives me a nasty taste in my mouth on first look.


Continue reading →

Kubernetes sucks

Kubernetes is the “hot new thing” that people like to claim is the “future of deployment” or the “future of infrastructure” or any other future-y fancy sounding statement (see ex. this and this). And you know, I get it, I really do. Kube takes care of so many things – rolling upgrades, management of stateful deployments, automatically spreading load across a cluster of servers and rebalancing, … – and so it makes sense that people are attracted to it.

But at least in my experiences with it, I consistently run into inexplicable issues that just completely ruins the utility of it. And I get it, all tools – especially deployment tools – have pains of some sort when it comes to using them. But the issues I’ve experienced with Kube are just… beyond ridiculous. Volumes disappearing, DNS failing in inexplicable ways, the cluster straight-up breaking to the point of needing a full...

Continue reading →