WSL drama with hibernation

WSL is a first-party feature that allows you to run a Linux environment within Windows. It’s one of the key factors in solving for my ideal personal computing device:

  • Ultra-light, compact, with a decent keyboard: Thinkpad X1 Nano
  • Supports games I want to play: Windows
  • Functional power management: I couldn’t get it to work with Linux
  • Linux/Unix-like environment: WSL

So it was really disappointing when Vmmem (the main process for WSL) would occasionally peg the CPU at 100% out-of-the-blue, causing the fan to spin up loudly and slowing everything else down to a crawl. Running wsl --shutdown worked sometimes, but other times I had to resort to rebooting the computer.

Reading through this thread on Github, I learned that I wasn’t alone – WSL has a propensity to kick up an insatiable fuss when made to live through a hibernation. A fellow netizen offered the workaround of disabling the hibernate feature altogether, but this did not satisfy me, having grown accustomed to the Mac’s excellent power management.

Instead, I took a behavioural approach to working around this – shutting down WSL before putting the computer to sleep/hibernate, and putting up with fresh shell sessions when I come back.

It seemed okay at first, and felt like I’d adapted, but it took getting to a somewhat permanent solution for me to realise how much of a toll this adaptation really took. All the mental overhead of babysitting WSL through sleeps/hibernates, not being able to simply “pick up where I left off”, and keeping on top of saving my work because I never know when a reboot might be needed to temper its tantrum.

With the fix, it is now a non-issue. Seamless, almost magical, with zero consideration or effort directed to WSL – as it should have been from the very start.

When “just” belittles

Since coming across Just Don’t more than a month ago, I’ve become more conscious of my usage of “just”. For example, “Why don’t you just get over it?” Which I would follow up with an attempt to remedy: “… sorry, I didn’t mean to imply that it would be an easy thing to do.

Personal takeaway from the post:

"Just" (or: merely, simply, etc.) has the effect of "representing as a small thing" the action that follows it. In other words, it belittles or downplays the difficulty of the action.

A little test that I’d come up with is to tack on “…, how hard could it be?” whenever I say “just” and see if it makes me want to punch myself.

  • I’ll just drop it off on my way to work, how hard could it be?
  • You should just forget about the whole thing, how hard could it be?

Turns out, “just” is mostly wonderful when used on myself (true to my heritage that lauds self-deprecation), but much less so when used on others.

I doubt it’ll ever be one of those things I’d care to call anyone else out on, but it’s been satisfying to notice my own unconscious belittling and make an effort to correct for it. In most of the instances where I’d doubled back, the “just” was genuinely unintentional; and in instances where they weren’t, well, I should just be doing less of it anyway, how hard could it be?

Moving from Digital Ocean to Hetzner

I spent the afternoon migrating a bunch of personal services from a Digital Ocean Droplet to a Hetzner Cloud Server. The difference is pretty significant.

Digital Ocean DropletHetzner Cloud Server
Memory2 GB2 GB
Storage (SSD)50 GB40 GB
Traffic (per month)2 TB20 TB
LocationSingaporeUS West
Price (per month)12 USD4.54 USD (4.24 EUR)

For just ~37% of the cost of a Droplet, I get double the vCPUs and 10 times the traffic allowance.

There’s a little less storage out of the box, but an extra 10GB will cost 0.5 USD/mo. Also, there’s the difference of being located in US West instead of Singapore which increases the latency when SSH’ing from Australia, but this is largely factored away with most of the traffic being served through Cloudflare.

More importantly, by retiring the old Droplet, I’ve been able to continue running my personal services on one CPX11 instance, spin up an additional CPX11 solely for my Mastodon instance and still have some change to spare.

Coding with Minecraft

I feel like I struck nerd-parent gold with CC: Tweaked, a mod that adds programmable computers, turtles and a bunch more to Minecraft, all controlled using the Lua programming language.

It began with Coding with Minecraft that I picked up from the local library to see if E might be keen and ready to get into programming during the holidays.

The entire programming interface is in Minecraft itself. Coding is performed on “turtle” character. There’s a really basic shell, a file system, a full blown Lua interpreter, and a simple editor to get the edit-run cycle going.

We’ve been working through the chapters, E’s been copying code out of the book, getting it to work, then adding his own tweaks and modifications with some assistance.

Here’s one of the first programs he copied and extended (“Farmer” is the name of his turtle). Printing messages, taking input, concatenating strings to form responses and doing a little math at the end.

It was really nice to share in his excitement when he got the program to run exactly as he wanted after multiple edits and tries. *proud dad moment* Next, we’ll be getting into using for loops to make the turtle dance.

Also, Lua is actually pretty nice as a first programming language 😄.