Has It Really Been Two Years?!

I find it funny that in my last post, I said I’d hopefully write another post before I hit the 1 year anniversary of said post.

So yeah, two years later… I got kinda bored with crypto-related stuff and I haven’t played around much more with my 8-Pi Kubernetes cluster. However, I **have** been plugging along working with Rust and WASM. If you’re unfamiliar with WASM, it’s basically a Virtual Machine that runs in the browser, and multiple programming languages can be compiled to run on it (including C++ and Rust). Think Java’s Virtual Machine, except more than just Java can run on it. I’m fascinated by it because it enables me to play with web development without leaving my comfort zone of Rust and C++, and in turn enabling my programs to run on just about any platform that has a modern web browser.

Now, I still haven’t done anything super interesting with it, but I did manage to get a working WASM web app live and running, complete with a graphical user interface, courtesy of the awesome “egui” crate/library for Rust. Aside from some glue logic code auto-generated by the Trunk tool, (a tool for building and packaging Rust WASM apps for deployment to a web server), I barely had to touch any JavaScript or HTML. I was able to write the business logic and GUI for my app entirely in Rust. The cool part here, to me at least, is that this exact same code, with minimal (if any) modification, can easily be recompiled to run natively on Windows, Mac, and Linux.

If you’re interested, I’ve uploaded it here. It’s a very basic interpreter for the toy/joke programming language “Brainf*ck”. (If you’d like to learn more, the Wiki page is a great start). BF is a very simple language to implement in terms of operations, so it was an easy, but non-trivial (mostly), thing to target for my first Rust/WASM web app. You can interact with it by either entering some BF code into the text box, or by uploading a plaintext file containing BF code. Right now, my implementation really just supports math and print operations. The ‘,’ operator, which is used in BF to read in a byte from the user, is technically supported, but I haven’t yet gotten it working from this web GUI. So for now, you can run basic math operations and make it print things.

Honestly, it was harder to implement the file picker than any other part of this project. I found a crate called “rfd” that implements file picker dialogs; it was also compatible with WASM. However, that took me down a rabbit hole of having to get a little comfortable with async Rust and how to handle transferring data from that part of the code to the main portion of the program.

Long story short, it reminded me why I have favored bare-metal coding on microcontrollers over web/application development for most of my career thus far.

Now that I have a new hyperfixation in the form of Rust and WASM, I’ll probably resume posting here more frequently, and hopefully with more Rust/WASM things to show off.

Random Assortment of Projects

Been away from this for a minute.

Minor update on the RPi4 cluster, a few months ago I eventually gave up trying to wrangle Microk8s and switched to k3s, another lightweight Kubernetes distribution. So far, it has been far more effortless to maintain. To be honest, I’m still not sure I’m sold on Ubuntu’s whole “snapd” system, (which is how they want you to install Microk8s), but that’s a whole other debate that I’m not fully knowledgeable enough to get into.

Moving on, I’ve been playing around with the idea of trying to fork the source code of Litecoin or something to create my own blockchain and cryptocurrency to use among my friends. I don’t intend for it to be something that has actual value, but more of something for us to jokingly “tip” each other with, in sort of a “Whose Line Is It Anyway” manner, aka “The rules are made up and the points don’t matter!”. Mainly, I think it’ll just be an interesting thing to play around with. On that note, I have also been lightly playing around with Solidity and Ethereum smart contract writing. No clue what I’ll do with any of it, or even if I will, but it’s fascinating to learn about.

Another thing I’ve been playing with is a decentralized server platform called Urbit. They call it an “overlay OS”; you’re still running it as a piece of software on top of a *nix system, but it is its own OS running on what I understand to be a sort of VM that runs a functional programming language developed specifically for this project, called “Hoon”. I’m still learning the language, (and boy is there a learning curve, coming from imperative and OOP-based languages), but the whole project is wild to read about. It has its own p2p networking system built on IDs hosted on the Ethereum blockchain. It’s currently not exactly all that user-friendly to get up and running for the first time, especially since you have to buy your Urbit ID with ETH cryptocurrency, but if you do get online with it, feel free to shoot me a message, my Urbit ID is ~hathec-pilsyx. It’s an odd name, but the ID names on that system are syllabic representations of your actual ID number. Something like that anyway.

Hopefully next time I get the urge to write, I’ll have some substantive progress made on my own projects, be it cosplay, software, or otherwise. If not… Well, see ya’ll in 3 months.

Microk8s Cluster pic

My last post mentioned a Raspberry Pi Kubernetes cluster I’ve been playing with, but I didn’t put any pictures on it.

The entire cluster consists of four Raspberry Pi 4 boards, each with 4GB of RAM and 32GB of microSD storage. For direct communication within the cluster, the boards are connected via a separate gigabit network, and the on board WiFi connections are used to connect to the Internet to avoid having additional cabling stretched across my apartment.

One of the nodes also has an 8TB USB 3 hard drive that it shares over NFS with the rest of the cluster. Kubernetes can automatically provision space on it for pods (containers) that need persistent storage, thanks to the NFS Provisioner instance I have running on the cluster.

Almost forgot about this!

So… I said I’d use this blog to document/show off my personal projects, went through the trouble of setting this up, and then left it hanging for a month or two.

Guess I should write about some stuff I’ve been playing with, right?

First, I’ve been buying Raspberry Pi 4 boards like crazy since about June. It started when I saw some ads for the “Antsle Nano”, sold at antsle.com . Hardware-wise, it’s just a repackaged RPi4 (4GB RAM) with an aluminum heatsink case; the real differentiator is the software that comes running on it. They call it “AntsleOS”, a stripped down version of Linux, on which runs a web interface for creating and maintaining LXC containers and KVM virtual machines. Given that they were running a massive discount on it, I picked one up, and thus was my introduction to self-hosting and containers.

Eventually, over the last few months, I wound up with 9 different RPi4 boards, eight of the 4GB RAM models, and one 8GB model. Four of the 4GB boards are running Antsle’s software, hosting a Pleroma instance, XMPP chat server, OpenVPN server, and PiHole ad-blocking system. The other four are clustered together running Ubuntu 18.04 and MicroK8s, serving as a playground for Kubernetes and hosting a Nextcloud and Gitea deployment. The 8GB board, I’ve been trying to set up as a media center PC to replace my Chromecast. I have Kodi installed, but so far Netflix is the only service I seem to be able to get working on it.

MicroK8s has proven to be pretty easy to use, (coming from someone with no real prior experience in working with containers/container orchestration stuff), but holy hell is it unstable. I find myself having to stop and restart the service at least once a day, because one or more nodes will randomly use up their entire RAM and grind to a halt. Usually, the MicroK8s interface on the affected node will refuse to respond, so getting any usable logging info for debugging purposes has been difficult. Now, have I submitted a help ticket like a smart person? No. Partially because I just keep forgetting to do it, and partially because, again, I want to be able to provide more than just “Hey so my thing’s broken, help?” message.

Other ongoing projects include hosting my own email server, maintaining this website, and trying to convince my family to use the additional Pleroma instance I’m running on DigitalOcean to stay in touch and share photos of my baby nephews instead of doing everything through text messaging. Also, one of these days I’m going to repair and recalibrate my 3D printer and attempt to get started on the MCRN Goliath armor costume I want for Dragon*Con 2021, (assuming the pandemic subsides enough by then…).

I may come back later and post pictures of some of my project boards. Depends on how lazy I am/am not.