Random things

I’ve not written much lately, which isn’t unusual. I used to blame lack of time for that, but in terms of available time, I have time to write. But I choose to spend most of that time elsewhere these days and don’t feel much like blogging. It feels like, at this point in my life, not much is happening that is worth reporting on publicly.

I’d write about public events or general content, but those posts tend to require a bit more time and preparation, especially in this day and age where the internet is getting more and more locked down and you can get “cancelled” for saying one wrong word. Blogging has become an ever increasing risk with lower and lower returns. I’d like to keep doing it, but things like the UK Online Safety Bill really make me wonder if it’s still worth it. Running a blog on your own domain with all kinds of cool features has never been easier from a technical point of view, but it’s just increasingly not worth it.

Callback to my post about Firefox vs Chrome: I’m still using both. On the desktop, behind the safety of a Pi Hole and several ad blocking extensions, I’ve completely switched back to Chrome and I love it. The UX just feels that tad bit sharper than Firefox. But on mobile, especially when I’m out of the house, Firefox is still my go-to browser. The lack of ad blockers in Chrome means that I frequently end up with three quarters of my tiny phone screen being filled with video ads and banner ads. That’s just terrible. Youtube has begun to disallow ad blockers on desktop, which is quite worrying in terms of setting a precedent. Enshittification is definitely a thing, and the internet we used to know is gone. If there is a place that preserves the freedom of the old internet I would love to know about it. Now’s the time to switch.

Posted in Daily Life , Tech , UK

Why I’m going back to Chrome after six months of Firefox

For the entirety of the last decade I have been using Chrome as my main browser. I started using it when Google’s motto was still “Don’t be evil” and have since lived to see the hero become the villain, so I wanted to give Firefox a serious try by making it by main browser. Here’s a very subjective report on things I liked, didn’t like, and why I’m switching back to Chrome. Disclaimer: all of this represents a snapshot in time of the features present in both browsers, and my views are entirely subjective. Your mileage may vary.

The reason I went with Firefox is because of its extensions, and its attitude towards free software. I fundamentally believe that software should be free, and having an open ecosystem for web technologies is something that Firefox contributes to, whereas (again, in my opinion) Chrome tries to take that away. Google would love nothing better for their users to be tightly tied into the Google ecosystem, which is an idea that I really dislike but at the same time benefit greatly from. Chrome’s sync for bookmarks, passwords etc. is just better than Firefox.

Another reason I wanted to switch is that, at the time, there were rumors that Chrome was going to completely get rid of ad blocking extensions in Chrome, and that would have been a dealbreaker for me. As of June 2023 this hasn’t happened though. I’ve also switched from an Android phone to an iOS phone during this time and have found the differences to be less, since both browsers use webkit underneath on iOS.

I’ll get to the core of why I’m switching back: Firefox annoys me. It’s just less user-friendly than Chrome. Here’s some things that Firefox gets wrong on mobile:

  • I have a bookmark with the word ‘weather’ in the url, and a different site that I visit every day to check the weather for my area. Chrome is smart enough to present me with the site that I just visited first whenever I search for ‘weather’. Firefox insists on showing me a stale bookmark that I haven’t visited in years and I have to scroll down to actually to get to my recent sites.
  • For some reason I’ve also seen the exact opposite behavior in Firefox as well, where I’ll have a bookmark for my online banking site that I want to go when I type ‘bank’, but because I’ve visited some obscure unrelated website that had ‘bank’ in the url, once, five years ago, I keep getting that recommendation rather than the bookmark I visit every month.
  • Speaking of bookmarks, I’m probably old-school in this, but I have a lot of bookmarks. One thing I do a lot is bookmark a site on mobile to my bookmark toolbar and then later check it on desktop. Firefox mobile never remembers the last folder I saved my bookmark in, and it always expands all subfolders in all my bookmarks, so I have to scroll down for half an hour and read through every folder name to get to the toolbar folder. It sucks. Chrome usually gets this right and remembers the last folder you used, but if I recall correctly this behavior did vary during the last years or so, so it is or was not perfect either.
  • Speaking of sync, I’ve occasionally had issues where the sync just didn’t happen and I sat at my desktop waiting for the bookmark to pop up. Chrome’s is pretty much instant.
  • On Firefox sometimes the most frequently visited sites on the start page just disappear. I don’t recall ever seeing this in Chrome.
  • Firefox crashes a lot, both on Android and on iOS. I’ll try to navigate to a site and the entire app just goes away and performs a load-from-scratch routine when I next tap the app icon. Again not something I’ve ever seen Chrome do.
  • Firefox is just laggy when the phone is on power-saving mode. Seriously, it takes several seconds to close a tab on my iPhone 12? That’s very, very poor. As usual, Chrome’s UX is lightning fast even in power saving mode.
  • Controversial ding: Firefox doesn’t know as much about me, so its recommendations are worse. I know, I know.. I say I care about privacy, but I have to admit I just like Chrome’s recommend articles way better than whatever Pocket comes up with. Though on that note, Chrome sucks in a different way: whenever it thinks I’m interested in “Thing A”, it will start recommend me all the local newspaper sites that write about “Thing A”, and I have to blacklist those sites one by one. I really don’t care about what some local town 200 miles away writes about the topic, but Chrome will happily recommend the same thing from a different local town 210 miles away instead.

And here’s a couple more things that Firefox gets wrong on Windows 10 compared to Chrome:

  • Firefox mutes tabs once, Chrome mutes sites and remembers it for all eternity.
  • Firefox sucks at multi monitor. It never remembers its window size correctly when you have two monitors with different display scales.
  • Site compatibility: this is not a huge thing, but some sites just look better in Chrome. I’m not sure what it is: different fonts, minor layout differences, but you can tell. It’s not a good thing because it means the web is over-optimizing for Chrome, but it’s just the way it is.

I know things may improve. I was really hoping that they would, but right now I think Chrome just has more (human) resources to throw at these things, and that, in my opinion, makes it an obviously better browser than Firefox (disclaimer: for my purposes). Perhaps I’ll try this experiment again in the future, but I think the only thing that would make me do that is if Chrome somehow becomes worse. Then again, given the kind of anti-user behavior that Google thinks is ok these days, it’s entirely possible that Chrome will become worse year of year, but for now Chrome is definitely still the clear winner for me. Let’s revisit this in a couple of years and see whether my trust in Chrome turned out to be misplaced or valid.

Posted in Tech | Tagged ,

Dumb things programmers do

I’ve written before about this blog’s journey away from WordPress into becoming a statically hosted blog, and how I’ve regretted it ever since. Allow me to present you with the next chapter in this increasingly silly saga.

WordPress has a lot of limitations. It had them years and years ago when I first decided to move away from it, and it still has them now. Back then, you basically had three choices: 1. host your site through wordpress.com, meaning not a lot of customization options. 2. Host everything yourself, meaning it’s on you to keep things up to date and running. And 3. go with a hosted WordPress solution that allowed you to customize some things without having to manually manage your host or software stack. I was on option 3 at the time, and the major drawback was that it just wasn’t fast, and near-impossible to make it fast while still taking advantage of WordPress’ ease of use. Oh yeah, one constraint I forgot to mention in my quest: it had to be dirt-cheap.

So at some point I decided to statically host this blog. After all, how hard could it be, right? Just generate a bunch of files, put them in an S3 bucket and you’re done. Except you need to either use a framework that does that for you, adding a thing to learn and a depedency that could cease to be updated in the future, or do it yourself, increasing the time spent on writing and maintaining your own software. I went with the latter and wrote my own blog generation software. I tried to be strict on myself in terms of maintenance burden: I only wanted the absolute barebone functionality and as little reliance on third-party libraries as possible. I would only be satisfied if, years later, I would open up the code for this blog to add a new feature without having to trudge through thousands of lines of code, or having to stare at what I wrote in disgust and confusion.

I didn’t quite make it. Even in trying to keep the codebase minimal, it’s still a maintenance burden compared to WordPress for only a fraction of the features. I spent a long time trying to figure out how I was going to do comments on a static blog without having to rely on some shitty service like disqus. I ended up with something working, but clunky, and it only added to the maintenance burden. In retrospect I am 100% sure that staying on WordPress would have been the better solution.

So… where does a lazy programmer like me go from there? Back to WordPress? Ugh. I would have to re-convert all the blog posts I wrote in my custom format back into WordPress SQL or whatever other format WordPress allows you to import. I would have to rejig the DNS, undo all the magical things I had to do to convince AWS to host things in the way that they are.. It’s all certainly possible, but it sounds like a time sink. So instead, I did what every self-disrespecting developer would do, and I made things even worse.

One major disadvantage about this static blog is that I need to run software in order to write and publish posts. Since that software is something janky that I built myself I’m not super keen on exposing that to the world wide internet, so basically the only way I can write blog posts when I’m away is if I bring a laptop that’s got the blog software on it. Old school, I know. My solution to fix that was to come up with a little script I’d run on a local raspberry pi which would ping Github for published blogposts, and in turn render them and publish them. It would solve the problem of allowing me to write blogposts remotely, but I’d still need access to a git client.

So then I thought: why not write the blogposts on WordPress instead? I could read a WordPress RSS feed and use that to convert each post into my custom static blog format, and publish whenever there’s a new post. So that’s what I did. I now have a script that runs every couple of minutes on a local raspberry pi that checks if the WordPress blog has a new post, which it then publishes. The circle of madness is now complete. I have come full circle when really what I should have been doing is just stand still.

Eventually I will probably spend some time moving everything back to a more manageable platform. The way my life has slowed down over the years I’d say that’s probably not going to be any time soon, but let’s see how long this duct-taped solution will last, and which will be the first part to break. For now at least, I am “feature complete”. Yay.

Posted in Tech | Tagged

RSS Feed

Although in the previous post I lamented about wishing I'd stayed on Wordpress, a day after I published that this article about wordpress.com pricing model issues became the top post on Hacker News. Just changing out the pricing model for their existing users seems like a practice that would certainly have made me unhappy if I had been their customer. It made me feel slightly better about the time I spent on this blog. But only slightly.

And speaking of ancient technologies, since it seems I'll be on my self-built platform for a while I added support for RSS feed generation to my static blog platform. The front page now has an RSS feed, though I likely won't bother to add feeds for categories, tags or article comments unless there's more early-2010s nostalgia fans like me out there.

I'm still thinking about publishing this on Github but I know there's tons of static blog solutions out there that are way better than mine, so I've not been in a hurry. It's on my todo list though.

Posted in Tech | Tagged

Comments

I deeply regret moving away from Wordpress. It was a terrible choice. Self-hosting is much, much faster, more secure and I have more freedom to do what I want with this site, but even something as simple as making a comment form involves so many decisions and so much future maintenance burden that it just makes me sad.

Anyway, it's working. There's comments again now. I have to regenerate the entire site to make this work, but it's not something that should happen too often. I had planned to go with a full AWS-based solution but ended up incredibly frustrated because everything AWS is just so needlessly complex. Lambdas and SES seem like a great way to handle "serverless" comment form submissions, but hooking it all up and figuring out which set of permissions to use made me vow never to use AWS again if I can avoid it. Instead, pythonanywhere.com lets you very easily spin up any kind of python server, which made it super easy to get started, and the free tier provides more than enough capacity for a blog of this size. I gave up on SES as well and ended up going with mailjet which again provides a very usable free tier and a straightforward API.

I also had to add a captcha to avoid abuse. It's unfortunate, but kind of necessary on today's internet. An alternative would have been to ask people to tie an identity to their comment and authenticate them with Google, Facebook or whatever, but that runs counter to what I'd like this blog to be. If you do think this would have been better, feel free to leave a comment! You can do that now!

So in the end I had to use three new cloud services to make comments work on my static blog: a non-static web hosting service to handle the comment form submissions, a mail service to send out the comment notifications, and a captcha service to prevent abuse. In return, what I get is data that remains under my control: comments (and email addresses used in comments) are in my inbox and on my PC, rather than on some external commenting service. No ads, no spam, no bullshit. Mild hassle because of the captcha, but hey, you can't have everything.

What I would do different in the future if I still had to stick to a static/custom solution: just load everything in memory. All the 17 years of content on this blog, compiled into html, is less than 256 megabytes. Even if I became twice as prolific over the next 17 years it would still easily fit into memory. Single server, maybe with a CDN in front of it, though I doubt it'd need it. Optionally I could parse the original templates on-demand to save even more memory, but it doesn't really matter. That way I wouldn't need to jump through hoops to make static hosting work and could have everything be contained in a single web service. All of this is of course still worse than moving back to Wordpress.

Posted in Tech | Tagged

This blog as a hobby project

My rate of blogposting started going down around 2012. That's ten years ago. Between then and now I thought a lot about what I wanted to do with this blog, and if I even wanted to continue it. I probably changed my mind on that every year or so. The term 'blogging' itself has kind of become obsolete in the meantime, as did the code for the static blog generation framework I built to produce these pages. It feels weird to unironically work on 'comment forms' for a 'blogging framework' in 2022. All of a sudden it's gone from mainstream internet to a weird kind of nostalgia. Who even 'blogs' in this day and age? Plenty of people write, of course, but it doesn't take a self-hosted, self-published platform to do that. Just sign up for a Medium account, or if you don't like that there's plenty of alternatives. Some people write entire articles on Twitter, which is a whole other weird internet thing..

I can liken the experience of blogging and maintaining your personal blog software to that of driving and tinkering on a classic car. It's a fun weekend project with no practical purpose whatsoever, all commercially available solutions are way newer and better than what you're working on, and whatever you're doing will never actually be useful to anyone else. But it's fun somehow. It keeps me busy. And, to continue the analogy, there is tangible output: just like you can take a finished oldtimer back on the public road, this blog exists on the public internet. Even if it can't keep up with all the modern alternatives around it, it's still there for people to see. And that's worth something. In my case, pretty much all of my life is documented here - from all the way back in 2005 to now. I enjoy reading what I did back then, and I hope the people who knew me back then do too. If Medium is a modern-day Toyota, this blog is a poorly-put-together 80s kit car.

(I guess for most people reading this the car example is actually less relatable than that of maintaining a blog. Oh, how time flies..)

So that's what I spent my weekend on. Old man blogger. Here's what I did over the weekend, and how things easily spiral out of control..:

  • I wanted to make comments work so I had to first decide on a format and import comments from the wordpress days. This meant interacting with a wordpress SQL backup that only really restored well onto a MySQL installation, which I didn't have running, so I wrote a nasty little script that regexes over the SQL dump and extracts comments. Yum..
  • As I was playing around with the comments I noticed that a lot of the old articles' image links were broken due to the way they linked to S3 bucket content. So I did some search/replaces on historical content to fix that.
  • Because I fixed a bunch of old posts and changed the base templates I had to regenerate the full site from scratch. This turned out to be less user-friendly than I liked given the scripts I wrote a couple of years ago, so I ended up spending hours refactoring those scripts to be more user-friendly.
  • As part of the comment loading I ended up making some rapid-fire javascript changes to static files, which I had to upload manually myself every time I made a change. This eventually annoyed me so much that I updated the blog generation scripts to also be able to upload static files.
  • While working on the styling for comments I figured I might as well do some other drive-by fixes to padding, colors etc. so I improved the styling a bit.
  • The imported comments needed to be mass-published, so I added functionality to the generation scripts for that as well.
  • For the first time since starting this static blog I actually have non-broken 404 and 403 pages. omg
  • In the end I got comment display working but didn't manage to finish work on the comment submission form. I'll save that for another weekend..

It's my goal to eventually publish the static blog generation framework on github, even though I know for a fact that there's way better alternatives out there already, and I wouldn't recommend anyone to start a static blog themselves at this point as the hosted solutions are way easier. But if I can publish the code on github I can at least call it 'finished'. Perhaps when that happens I'll finally consider moving back to a hosted solution. But for now I will stubbornly keep tinkering..

Posted in Tech | Tagged

I made a Minecraft mod!

After 10 years of not touching Java I somehow made a Minecraft mod. The reason? I wanted to see if I could turn on my IoT living room light with a switch inside Minecraft. Great success!

The mod is called Breakoutbox and is available on my github page: https://github.com/rheide/breakoutbox.

Breakoutbox is a very basic mod that lets you 'break out of Minecraft' by calling external scripts on the serverside. Once you're out, anything's possible. Controlling IoT lights as mentioned above, pulling in cryptocurrency prices into your Minecraft world, pushing a button to make a Tweet, you name it. And building all those things is a hell of a lot easier in an ad-hoc external script than it is to publish a dedicated Minecraft mod every time. Anything and everything, all of the time.

It was interesting to experience the Java ecosystem again after such a long time away. Some observations:

  • The build system for Minecraft mods is really nice. The Forge MDK (mod development kit) comes with good documentation to get you started, and a gradle build file that makes it super easy to compile a mod jar or run a dev Minecraft server.
  • That said, the Minecraft code itself is closed-source, so from there on you're walking through decompiled, de-obfuscated bytecode, guessing at what things are ok to call, hoping the arguments you've provided make sense. This could've been an absolute nightmare, but thanks to the fact that Java is a strongly typed language, and community efforts at deobfuscating the code every time a new release comes out, it's surprisingly not that painful.
  • It's so difficult/terse to do simple things in Java, compared to Python. The Java standard library featureset is still a joke. No json or yaml parser in the standard lib? Bah.
  • I gave up trying to figure out how to bundle a third party library with my jar. Couldn't figure out if it's just not standard practice or if I then had to burden everyone who downloads the mod with also figuring out how to download the dependency. Either way seemed bad.
  • It's veerrry easy to get Minecraft to misbehave. The redstone behavior has a 'contract' in that running a redstone command should finish quickly, e.g. in less than .1 second. External scripts can easily take any amount of time, and I had to guard against that. I found it quite interesting how easily I could get a 'professional' game to break just by adding a few lines of code in a tiny jar file.
  • I managed to get around the long-running script issue by queueing the tasks in the Minecraft server object's internal threadpool, but I wasted hours trying to figure out why it wouldn't just work from my own threadpool. I had created a separate threadpool for my own tasks, but somehow the commands never executed if I ran them from my own threadpool. Queueing them in the threadpool that was kept in the server object fixed things. Without looking at the actual source code, which is impossible, it's very difficult to say why. My guess is that the internal threadpool had some kind of hooks attached to it that updated the game state at the end of each task, whereas with my own pool stuff just disappeared into nowhere and was ignored by the game loop. But who knows.

Anyway, it was a fun little exercise. It was a project I started in spite of wanting to finish other projects I had already started. I had no particular need for it, but having it available on github in the form of a downloadable jar that anyone can stick into their Minecraft server, and source code available for anyone who feels like forking it, does feel good. I will endeavor to finish more things this year.

(I think I finally have an idea in my head to reintroduce comments to this blog without incurring massive maintenance or financial costs. More to come.)

Posted in Games , Tech | Tagged , ,

No more analytics

Apparently Google Analytics might become illegal soon in the Netherlands. It reminded me that I still had a Google Analytics script on this blog, which I've now removed. No more tracking!

Side note: bit rot is real. I had to update various Python libs to their latest version to make this static blog platform work with the latest Python. The maintenance burden is real.

Posted in Tech | Tagged

I minted an NFT and put it up for sale

The internet's going crazy about NFTs (non-fungible tokens) right now, so I wanted to see what all the fuss was about. In a nutshell, NFTs are bits of information that are stored on a public blockchain, which are provably 'owned' by a particular blockchain address. Anyone can see it, but only the owner of the address can prove ownership of the NFT, and transfer it to others, since the owner is the only one who is in possession of the private key required to do those things. From a technical point of view it's not very novel at all, it just seems like a logical evoluation of the presence of public blockchains, yet the internet has become infatuated with it recently, with some artwork selling for utterly insane amounts.

The world of cryptocoins has progressed a lot since I first wrote about it. It's incredibly easy these days to just download a mobile crypto wallet, transfer in some money (either crypto or fiat) and then use that wallet to trade. The intended user experience is fantastic, but in practice.. we're not quite there yet. In order to link your wallet to an auction site like rarible.com you have to connect your wallet via a QR code, and in theory the site will then ask your wallet for confirmation for the actions required to mint an NFT and put it up for sale. In practice there's 4 different wallet connection protocols and dozens of wallets that implement them, and your experience will vary greatly depending on which protocol and wallet you use.

MY first attempt at minting an NFT on rarible was to use WalletConnect to connect to crypto.com's mobile wallet app, and it was nothing but pain. Confirmation requests never arrived, or after confirming nothing happened on the auction site. Even transferring money in and out seems near-impossible sometimes. But then I switched to using the Coinbase wallet app and protocol and things were just smooth. It took only a couple of minutes to mint a new NFT and put it up for sale.

So what piece of 'art' did I put up for sale? Given the internet hype around this whole thing I thought it the most appropriate to mint a screenshot of the very first blogpost I wrote about Bitcoin in 2011: Resources are being utterly and completely wasted on mining Bitcoins. You can find the NFT for sale here on rarible.com. This post was written way back in the day when I was GPU mining at home. In those days, even without being part of a mining pool you'd occassionally find the winning hash and get the full 50 BTC. 50 BTC is worth $3,000,000 today..

Looking back on that post, I wish I had been a bit more prescient about the price of Bitcoin rather than the resource usage.. While it's true that Bitcoin's energy usage has ballooned (apparently more energy is spent on mining Bitcoins than is used by entire countries), which I predicted back then, I did not predict that the price would go from $9 to $59000. If I had predicted the price right I'm sure I would at this point be able to buy a news company to write this article for me. Oh well. You win some, you lose a lot.

Posted in Tech | Tagged , ,

Legobot + Base Station 1.0

It's been a while since I wrote about my ongoing hobby project of building a Lego Raspberry Pi tracked vehicle. I've been working on it on and off since the last post, so here's a bunch of updates.

I finally made the plunge and bought a Raspberry Pi UPS Hat (note: does not come with batteries). The reason I held off for so long was mainly for two reasons: the capacity is lower than a separate USB power bank, and I didn't want to faff about with custom wiring and having to worry about short-circuiting things. I ended up caving in because the UPS hat just wasn't that expensive, and faffing about with custom wiring means the end product can be a lot smaller.The big gain you get from a UPS hat is that actually unintterrupted. With every single USB power bank I tried there was always a blip in voltage when plugging the power bank in to mains power that caused the Raspberry Pi to reset itself. No such issue exists when you're using a UPS Hat, and the 2.5A output is more than enough to power two Lego Power Functions XL motors at 8.4V.

Things worked out really well with the UPS hat. Previously I had a separate converter that stepped up the external power bank's 5V USB Power to 9 or 12 volts, which then went into the ThunderBorg motor controller. I found that with the UPS Hat I can pipe the 8.2V input power straight into the ThunderBorg and it's more than enough to drive the two tracks. I ended up having to add an additional switch, because hooking it up to the input power means there's no real way to turn off the power at all, since the ThunderBorg ends up powering the Pi if the UPS hat power switch is turned off. A bit weird, but all in all a lot more compact than my previous solution.

With things getting closer to a finished product I also shortened the Lego power cables, which I had kept intact so far, and was hooking into them with awkward DuPont cables that took up a lot of space. I also made the camera mount more compact by removing the ability to rotate horizontally.

With so much space saved, I managed to add in an additional motor to the front of the vehicle. This motor doesn't connect to anything when the vehicle is driving around. When docked into the base station, this motor can drive any kind of functionality supported by the base station. As you can see from the video below, the base station I built has a retractable ramp which is powered by this custom front motor. Another idea I have is to build a lift for it so I can make the bot look out the window.

I had originally planned to have a worm gear somewhere in the base station winch assembly, but then I figured that the motor resistance is easily enough to hold up the ramp when docked. Plus, as you can see from the second half of the video, you get this cool rapid ramp drop effect just by driving the bot backwards out of the docking station without having to lower the ramp through the winch motor.

The UI shows the video feed and various control buttons for all the motors and lights. It's not clear from the video, but the status bar shows information about battery charge, wifi signal, current wattage, motor voltage and so on. The UPS hat came with a Python library to read the charge percentage, but it did not compensate for the nonlinear dropoff of Li-ion cells, so I had to write a layer on top of that to get a somewhat predictable battery percentage out of it. It's not perfect, but good enough.

Software-wise it's all quite messy. I've been meaning to publish the finished product on github, but the last time I seriously looked at the code was a couple of years ago. The video streaming solution was very unprofessional and optimized to work for the first Raspberry Pi. It definitely needs some polish before I can publish it. But once the software has been published I think I can officially consider this project done. I can't believe I've been at this for several years now. I'll have to find a new hobby..

Posted in Tech | Tagged , ,