Skip to main content

Mike Kreuzer

Ruby thoughts

June 18, 2022

I've been writing Ruby again, for the first time since February, and only the second time in almost two years now. It all started with Wordle & a poll about hand gestures on Mastodon.

The poll was about the đź‘Ś hand gesture, a certain group appropriating it, & other people reclaiming it instead of letting it slip away from meaning "OK" (and other things in Greece). It made me think about Ruby, about people appropriating the language for themselves, & about perhaps reclaiming it.

I moved away from using Ruby in large part because of DHH, Basecamp, Rails, Shopify & who they were platforming. I didn't want to be associated with any of that. But maybe that was a mistake. (The moving away part, not the being associated with it.)

Around the same time as the poll I was thinking about Wordle, and finally getting the time to see what scripting a solution would involve. Just for the fun of coding. So I chose Ruby. (More on Wordle in another post maybe.)

But life catches up with you. I took what I thought would be a quick side trip to fix a bug I'd noticed in the Zine gem, & Prettier somehow managed to trash every single file. Randomly rearranging comments. Formatting… everything every which way. (Which is a much worse Michelle Yeoh film.) I'd got back into Ruby for only a few hours and I think my computer was rebelling.

I've got all the extensions turned off in Codium as I write this & push that bug fix up. Next step will be sorting that mess out. Or maybe writing a better version of it. A better Ruby/Rubocop/Reek thing for VS Code &/or Prettier. Be easier if I just worked out how I'd malfed the install somehow though.

I can think of lots of missing Ruby tooling – the AWS CDK being a big one – but my "if you have to build the whole ecosystem yourself" spider sense is tingling. Maybe I should just buy RubyMine & get my own horrible code in order.

Tags:

A year of Linux on the desktop

May 31, 2022

It's been more than a year & Linux is still my go-to desktop. It actually worked. I was fully prepared to have to bail on it, but it turned out to be pretty easy.

I switched to linux more or less full-time by March last year. A lot's changed in that time, but I'm still on Ubuntu. I still have my old Intel Macbook Pro sitting on my desk, but I use that pretty infrequently now. There's still a Windows drive too, but there are enough Steam games that run fine on Linux to mostly keep me from bothering with the inevitable update hell that booting into Windows entails.

I was expecting peripheral problems, but printers, microphones, cameras, speakers… fancy keyboards & mice, they all just worked.

Software wasn't ever much of a problem either, but like I said when I was starting out last year: my software footprint's pretty small, & mostly development focused. If dev stuff doesn't work there's a much bigger problem with your ecosystem – looking at you Mac – so I may not be a great canary for your particular coal mine, unless your goals are similar.

I'm still very much not a fan of Canonical's Snaps as a software distribution method. Flatpak is better, but not by a lot. But so far it's the software that keeps me on Ubuntu rather than any other Linux distro. Fedora would be where I went if I left Ubuntu I think, it has a lot of nice things going for it as an operating system. A year ago too most of the EC2 boxes I worked with used Ubuntu, but now they're all on Amazon Linux 2 which is pretty much just Fedora. With Fedora I could never work out how to make the dock appear by hovering my mouse over it, but the availability of software was its main problem as a desktop OS, for me.

Installing software with Ubuntu mostly goes something like: go to the app vendor/author's site. If I'm lucky the preferred install method is apt. Mostly that's it. Use that. Done. Sometimes it'll be an app image, but not usually. With Fedora if it wasn't an app image I'd get referred to FlatPak and/or some lone guy's website where he patiently explains how to install a port of an out of date version of one of the Ubuntu copies. I used to try out different Linux desktops twenty years ago, & installing software on Fedora's a lot like that was. Do-able, but a lot more work. So far Snaps on Ubuntu are eminently avoidable – for me – but if that ever changed then Fedora's where I'd likely go. Choice, it's a good thing, I'm a big fan.

I think the only software that I changed relatively frequently over the course of the year's been the image editors. I tried Krita for a long time, but eventually settled down to GIMP (still a ridiculous name) & Inkscape. Other than that my software changes were mostly driven extraneously. Getting a Twitter app was important to me back when I started this, but then Elon Musk happened & now I'm on Mastodon, & the web interface works well enough. Likewise, a Spotify client was important to me a year ago, but then Joe Rogan happened & now I'm on Apple Music. Apple Music's web interface… works, I think I'd go that far. There's a snap app that's just a wrapper around the web site, but I'm not sure how that's meant to help.

But here I am, listening to Apple Music on Ubuntu as I type this. Thinking how hard doing something similar would have been at literally any point in the past. Not just the distant human past but at any point in my own life. A lot of people have done so much work to get me here. To all of you, a very big thank you. Happy Linux user here.

Tags:

DadOps: a Minecraft Java server

May 10, 2022

DadOps: where I get to play with software with my kids, which is without a doubt my favourite part of all of this.

This week's DadOps adventure was setting up a Minecraft Java server, one that was also playable by my kids' friends, but without breaking the bank.

I set up a VPC on AWS, with public & private zones (public zones being where the boxes with public IP addresses go, private zones for those without), putting the Minecraft server in the private zone. That setup hides the server away, but means a jump box in the public zone so I can SSH in to the Minecraft box, a NAT box for traffic going out from the Minecraft box, & an NLB for port 55… 5-whatever-Minecraft-uses. (I have to look it up every single time. 25565.) All of which could get expensive if I used AWS's managed NAT for example, or left the boxes turned on when the kids weren't playing.

Scripting to the rescue.

I got to play with the AWS CDK again, as a replacement for me for Terraform. The CDK & Terraform both have their advantages, but the standout advantage of the CDK for me is I'm not using yet another language. The sooner I never have to think about HCL again the better, I think.

I used an EC2 nano for the NAT box, rather than the high availability managed (expensive) alternative, so I can just turn it off when it's not needed. I have to set up the IP tables each time the boxes are turned on but that's just a bash script, a small price to pay. I set up the NLB in its own CDK/CloudFormation stack so I can tear that down too, using an elastic IP address so I can keep the address the same for the kids. Having an unattached elastic IP address when the NLB's not there costs ten times less than leaving the NLB up & running all month.

All of this is orchestrated by a few Javascript functions in a Jerbs script, jerbs minecraft start and the fun begins.

Once I've used them in anger a few more times I'll clean up the CDK and Jerbs scripts & put them up on Github.

In the meantime happy crafting, & don't mine at night.

Previously

Earlier posts...