Moar fediverse stuff…

After a little while, I came to the conclusion that the GoToSocial server I setup isn’t quite ready to do what I want - they posted a rather timely reminder shortly after I made this decision that it’s “ALPHA” software. I didn’t run into any actual issues, it’s just that there’s lots of features I wanted that they don’t implement yet… and after trawling through them looking for something I can help with it became clear that I just don’t have the Go skills required to do anything super-helpful yet.

So I decided to wait, keep that instance up, and set up a new instance on another old domain running Mastodon proper. But Mastodon itself is a bit heavier than gotosocial (read: a lot heavier, instead of a couple hundred megabytes of RAM it’s up to nearly a gigabyte on an empty instance) and required a good bit more work to set up, and since it supports video already it’ll eat more disk space too.

But I wondered how much bandwidth it’d require? So I decided to see, and set it up on my home Kubernetes cluster. This turned out to be an exercise in and of itself, it turned out lots of people have already done this work but like a dumbass I didn’t find any of this until I was most of the way done and reinvented it myself.

I’ll probably publish my stuff when I figure out how to clean up and publish the rest of my YAML.

I did figure out how to update it without any downtime too though, and it’s actually pretty nice:

  • Update tag/hash for all three deployments.yml to the desired new tag (don’t deploy them).

  • Take a backup of the pg database (kubectl exec into the container, run pg_dump, then move the dump file out somewhere safe).

  • In sidekiq’s deployment, change the command (comment the old one out) to: command: ["/usr/bin/env", "bash", "-c", "sleep 3600"]

  • Deploy only sidekiq. Wait for it to pull the image.

  • kubectl exec -it <new sidekiq pod> -- /bin/bash; Run the pre-upgrade migrations specified in the upgrade notes.

  • Change the command back in sidekiq deploy.

  • Deploy all the things.

  • kubectl exec into the sidekiq pod again, run the post upgrade command(s).

  • Kick all the mastodon processes over after the post-upgrade commands, eg something like kubectl rollout restart deployment mastodon-web or whatever (note that this part’s only downtimeless if you have more than one replica)

This all went fairly smoothly and for the most part it hasn’t given me any grief. The server’s been up about five days now, the media cache is sitting at about 5GB, and I have it set to throw away cached media after 7 days which should be plenty… I kinda wish there was a separate setting for video, because I could afford to keep cached photos/memes/etc for significantly longer, but c’est la vie.

I am hoping that in the next year or so I can go back to GoToSocial!

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry

C64 Demo: Success!

C64 running a demo I found on MastodonA while back I bought an Arduino and got the uno2iec thing working for some titles, I loaded a handful of games, played it until my hands got sore from the terrible 1980s joysticks, and left it.

But having recently discovered loads of 6502-nerds on Mastodon, one particular post caught my attention: someone uploaded a .PRG of a demo they made to celebrate 200 followers, and said that it “should run on PAL C64s”, and I realized that I could quite likely test this… as long as it doesn’t try and do anything fancy with the 1541 that is.

It took a bit, as uno2iec’s Qt driver application doesn’t read PRGs, so I had to install VICE to get the necessary utility to convert it to a D64 image, and naturally because Arch Linux that meant a full package upgrade of everything including the kitchen sink (which trickle in at about 1Mbps for some reason). But I got there in the end, and using the c1541 program I was able to write the image out, successfully load it into uno2iec, and run it on my C64. Sweet!

But this got me thinking, mine weren’t nearly as neat as some of the shit folks are doing (no sound to start with), but I have some ancient demos I wrote a very long time ago. Indeed, per git it was 8 years ago… still relatively recent in the C64 timeline. Surely I can load one of these up? An additional problem: I only have the 6502 ASM sources, no binaries.

Installed TMPx, and:

[fwaggle@MacBookPro2011 c64-toys]$ ../TMPx_v1.1.0-STYLE/linux-x86_64/tmpx -i spritebounce.asm -o ../build-rpi2iec-Desktop-Debug/debug/fwaggle.prg
TMPx v1.1.0 [r1141; 2015-08-13 08:11:32]; (c) Style 2008-2015

        Assembled: $0801 - $20bf / Writing 6337/$18c1 bytes incl load address

        Ranges: 
         $0801 - $080d 
         $1000 - $1225 
         $2000 - $20bf 

Now write it into a D64 image:

[fwaggle@MacBookPro2011 debug]$ c1541 -format fwaggle,aa d64 fwaggle.d64 -attach fwaggle.d64 -write fwaggle.prg fwaggledemo
formatting in unit 8 ...
writing file `FWAGGLE.PRG' as `FWAGGLEDEMO' to unit 8

Run the uno2iec program, mount the image… LOAD"*",8 and a RUN later and wahey! There’s my code, running for the first time ever on a real Commodore 64! (I had previously only run this code in VICE).

This is a bit of a pain, so it’d be nice if I could find or build a ROM cart that let me dump PRGs into cartridge memory and trigger a reset of the machine for rapid development… but that’s probably going to be a project if it’s even possible.

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry Newer Entry

IoT: More fucking Xmas Lights

Sabriena’s crippling Christmas habit is still well in swing - as we (Duncan and I) won’t be here tomorrow night and Halloween is always a bit of a disappointment at the best of times, she resolved to make up for it by breaking out the decorations a bit early this year… I’m reliably informed some parts of the internet call this “celebrating the ‘ber months”.

But because I have a crippling addiction of my own - namely attaching shit to Home Assistant - we can meet somewhere in the middle. After the scantest of research, I picked up a 4 pack of Arlec GridConnect smart plugs and used them to smartify all the rest of her non-smart Christmas shit.

Mercifully, someone else did the work on figuring out the data points, which I’ll mirror here for my own uses:

DP Value
1 ID (Switch)
18 Current
19 Power
20 Voltage

I’ve omitted the DPs I don’t care about, things like the countdown timer and so on.

Anyway, long story short we have a huge Christmas tree with four sets of “smart” lights on them, plus a bunch of lighted garland and other decorations. The old string lights have an annoying button configuration on them where they start out with a really obnoxious flash setting and you have to push the button each time to get the setting you want (I should see if I can fix that, but I don’t really want to be cracking mains-connected shit apart these days).

But using the scenes, I’m able to configure one-touch control of most of this stuff and it’s actually fairly useful. When it’s bed time, a single button push sends everything dark.

Cool.

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry Newer Entry

Dipping my toes in the Fediverse

I’ve liked the idea of distributed social networking for quite some time - I dabbled with Diaspora years and years ago, but the fact it was written in Ruby threw me as I didn’t care quite enough about it to learn a new language. But even before that I’ve been pretty convinced that this is the “correct” way to do things, as in the mid-2000s I wrote up a plan to build an IRC-replacement, something vaguely similar to the way Matrix works only not nearly as well-thought-out, and mine revolved around a GPG-style private-key-as-identity system and I hadn’t worked out a decent public key distribution method beyond punting on it and saying “put your key on your website or give it to friends in-person”.

Anyway, I digress. The main reason for the renewed interest in it, even though I played with Mastodon (a federated Twitter clone) is Elon Musk purchasing Twitter. I have effectively given up Facebook entirely, I only use it for marketplace because there is no viable alternative where we live, but I don’t engage with Facebook/Meta properties at all outside this narrow scope. But Twitter I was for a time hopelessly addicted to, particularly during COVID I picked up the nasty habit of “doomscrolling”, and after this purchase I see no viable way it remains as it was. Elon’s promised two things that are, in my opinion, mutually exclusive - a free-speech-friendly network that’s profitable. I just don’t believe he’ll be able to do it (will happily eat my words if it turns out I was wrong, one of the neat things about maintaining a long presence on the internet is there are plenty of examples where I have been).

So I haven’t deleted my Twitter, but I have started thinking about what I’ll replace it with. Mastodon’s federated version ticks most of my boxes, and even the negatives (you’re insulated in small communities!) aren’t deal-breakers for me, if anything it’ll probably lead to healthier social network use if it’s not quite so addictive (I could just work on my shit, but like that’ll happen).

I signed up for Mastodon months ago, but I figured that since I don’t do enough recreational sysadmin I’d probably run my own one. I took a disused domain, spun up a container on my K8s cluster, had a look at it… yeah I think I can make this work. I’m not using the Mastodon software (probably would have been the sensible approach), instead opting for a project called gotosocial. This appeals to me, because it’s not trying to do everything… it implements the API and some of the (mostly read-only) web bits, and leaves you to connect other clients to it. Fine by me, I mostly use my phone with an app anyway.

What I didn’t care for was the disused domain I picked… so I blew that one away after doing my best to not pollute the fediverse with dead links, and instead set it up on hungryhacker.com - another, mostly, disused domain. This is convenient because pre-gmail I used this email address almost exclusively, so for very old friends it makes a lot of sense for them finding me on it. Neat!

Configured it, behind CloudFlare so I don’t get entirely ratfucked by bandwidth use. I did my best to point my Mastodon account to it, but unfortunately GtS doesn’t implement a couple bits of the ActivityPub protocol required to do a proper redirect (where the small handful of followers I gained on there would follow me to the new account). Maybe they’ll fix that, but I don’t really give a shit at this stage.

Ironically, having 5000 characters to “microblog” might mean I end up using it for the exact same reason I started using Twitter for… jotting out ideas that I’ll flesh out into actual journal entries later. Or maybe Elon gets bored and flogs Twitter off (or, extremely unlikely IMHO, he makes good on the promises he’s made) and I just go back there. We’ll see.

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry Newer Entry

Skyfan! (with IoT)

Had the electrician over today, for what should have been a reasonably short visit but ended up being a rather long ordeal (mostly for him).

You see, some time ago, I started the process of replacing lightbulbs that we use the most with LEDs to try cut down on our night-time energy usage (even though there’s a fucking great 24U elephant in the garage in that respect, replacing incandescant bulbs and fluro tubes is much cheaper in the short term), so I replaced the bulbs (2x60W) in the ceiling fan in my office. You see, it’s probably the worst offender, as much of the year even with the curtains open my office is much too dark to work comfortably from (would be fine for a bedroom, not for an ergonomic office). Seems a reasonable place to start, yes?

Well, I put non-dimmable LEDs in it, and they were flickering. In the process of trying to determine why (we later figured out there was a dodgy connector inside the fan itself), I managed to twist the entire fan, finding a loose wire, shorting it, and destroying the fan speed controller. When he came out at that time to determine that, the electrician fixed me up so I’d have lights again, but when I close my doors to have a meeting the office gets terribly stuffy, so I simply must have a fan!

We could replace the controller for some $80AUD plus labor to install it, but then I’d still be stuck with the dicky light fixtures, so fuck it let’s just replace it. The electrician raves about “Skyfan”, a product from a company based down near where I grew up… they’re quiet, energy-efficient, blah blah blah. So we ordered one, and figured we’d get one in the master bedroom as well because summer kinda sucks with no ceiling fan in the bedroom (every other room but the master has one, for some reason).

So he came out to do that… got the office fan installed in no time flat, perfect. We got the little “smart controller dongle” for them as well, which is just more Tuya stuff (not even rebranded in this case), so it was cake to set that up on Home Assistant as well:

DP Function
1 Fan ID
3 Fan Speed
8 Fan Direction
15 Light ID
16 Brightness

Set the DP value type to int (not sure if this is required tbh), minimum and max fan speed are 1 and 5, same with brightness. Can’t change the color mode (probably could, don’t give a shit), but otherwise it works perfectly. Did have some minor grief with one of the fans turning on every time I saved settings in localtuya, but after I switched the fan on and back off via the remote, it’s worked fine since.

So the master bedroom starts. He brought lumber just in case, but it turned out they hung the light where there was already a beam supporting it anyway, so hanging the fan was easy. Hook everything up, and he was just about to close everything up, when he did the RCD test to make sure the ground still worked and… nothing.

So after nearly an hour of investigation, and at least another hour of repair work… nearest we can tell is that when the AC was installed, the ground circuit for the lights was pinched. It somehow wasn’t enough to trip the RCD on the lights, however it did burn it out (the RCD smelled of ozone and was non-functional even on the test button). We fixed the ground wire by reconfiguring how the cables ran (as we didn’t want a two-way switch on the fan any more due to having the remote and the smart bullshit), replace the RCD and we’re in business… everything functions as it should and we can get a safety certificate for the work (at which point I’ll pay the bill that’s probably slightly inflated due to the extra labour involved).

But the smart shit’s pretty cool. I still haven’t worked out how I’m gonna do physical buttons in places yet, and apparently legally I must keep the physical switches as isolators, which sucks. I might see if I can put white stickers over them or something so we can break them if we have to isolate the equipment but so you don’t accidentally hit them stumbling into a dark room.

With tuya local and the tuya cloud firewalled from each of the devices there’s zero perceptible lag, it just works exactly as you’d expect it to do (as long as my K8s cluster hasn’t fallen over). Sole complaint if I had to pick one is that we have the remotes on the wall near the doorway, for turning the lights on, and the remote seems to have it’s own set of settings (presumably the remote is one-way) and so it syncs the settings it has with the light… so if you turn the brightness to 1 via HomeAssistant, then turn it off, then push the light button on the remote and the remote is set to 5, you’re blinded… but we don’t really change those settings that much so I can live with it.

As far as the fans themselves? Yeah we’ve not really used them much but they live up to the hype - very quiet on eco mode, still move heaps of air, and they get lost in the noise of power consumption when you turn them on and off so they must be reasonably cheap to run.

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry Newer Entry