ActivityPub servers

I want an ActivityPub server so I can do Fediverse experiments and see them in Mastodon. What I really want is something like CGI; I don’t care about the protocol server, I just want to write little scripts that easily federate. I don’t want a consumer product with a web UI, I want a little platform for which I can create experimental scripted accounts for people to subscribe to. I’m not sure that exists.

I asked on Mastodon about servers and got some suggestions. Here they are. Lines of code are rough estimated calculated with scc.

takahe. 9,000 lines of Python. Active, seems very new (2 months old), not yet at a 1.0 release. Seems web UI centric.

gotosocial. 58,000 lines of Go. Active, six months old, labelled “alpha”. Also focussed on a web UI and consumer product.

epicyon. 103,000 lines of Python. Active, 3.5 years old. Also web based but an emphasis on being simple. OTOH runs as a proxy server and needs nginx in front.

honk. 10,000 lines of Go, 3.5 years old. Not entirely active, but has had some recent updates. Seems.. idiosyncratic. But also nicely minimalist. Someone mentioned it has lots of forks.

minipub. 7200 lines of Typescript+Javascript. A year old, but no edits in 6 months, maybe one developer. “for posting federated podcast comments”.

minimal-activitypub, 650 lines of Python, 4 months old, one author. Found this one myself and as the name says, it’s minimal. May be a suitable start for the platform I want? I note from the docs that it’s all client to server stuff, not server to server, and I don’t even understand enough about ActivityPub to know exactly what that might mean. There’s a couple of the author’s projects built on top of it.

express-activitypub. 440 lines of Javascript, 4 years old, one author and seems largely moribund. OTOH it’s by the great Darius Kazemi, ActivityPubber extraordinaire, so it’s worth a look. Darius says his projects are live, just stable.

rss-to-activitypub. 700 lines of Javascript, 4 years old, also Darius and mostly moribund? But this specific RSS product is very close to what I want to tinker with, also worth revisiting.

snac2, 6000 lines of C. Two months old, active but maybe just one developer. Has a simple web interface. Mostly runs like an old school Unix daemon, this post talks about setup. The earlier snac was a prototype in 3800 lines of Python written in six weeks.

microblog.pub. 13,000 lines of Python. 5 months old (v2), active. Simple web UI. Single user, minimalist, blog-oriented. This looks promising as a starting point for me.

None of these are an obvious thing for me to Just Use.

Battery backups: UPS, battery generators, etc

I’ve learned a surprising amount about how to have battery power for when the AC power goes out. Some summary notes.

One important stat: “transfer time”. That’s how long it takes for the backup power to kick in. You need this to be fast if you don’t want the device to turn off and on again. For reference, 60Hz power cycles every 16ms. UPS units are the only ones I know of fast enough that a computer won’t be interrupted when the power goes out. You can use a UPS along with one of the bigger and slower backups.

Many of us have good ol’ UPS units to keep our computers up in momentary power outages. My favorite consumer brand is Cyberpower. These are typically sold by max power + runtime and it’s hard to find how many watt-hours are actually in the battery. There’s a surprising variety of types of UPS units. I now buy PFC Sinewave units that condition the AC power and produce a nice clean wave. As a side effect this makes the UPS work better when on dirty power like a generator; with a cheaper UPS on generator it would switch to battery backup every few minutes. Transfer time on a UPS is < 10ms and consumer devices shouldn’t even notice.

Gas or propane generators. I have a Generac Guardian 22kW for when PG&E takes our power out for hours or days. These are expensive and terribly inefficient, particularly when running at low power. They also put out pretty uneven power; when they get loaded the 60Hz briefly slows down to 58Hz or whatever. But if you need to be off-grid for days at a time they are the most practical choice. I paid $15,000 for mine. It’s rated for 3000 hours, so that’s $5 / hour! Although presumably it can be refurbished? Transfer time is ~15 seconds, everything will turn off before it switches on.

Battery generators. These are a new class of product that replace portable gas generators, basically a very fancy lithium battery with an inverter. I have an EcoFlow Delta 1300 that PG&E gave me to avoid liability for my power going out. These are really capable devices, absolutely excellent for being off-grid for a few hours. They charge via AC and also come with the circuitry to charge via solar panels or electric car chargers. I’m impressed with mine as a product. One drawback; you need to drain the battery occasionally to avoid it wearing out. Also the transfer time is 30 ms; fast, but not fast enough to keep your computer on. It’s not a UPS.

Whole house batteries. These are the fancy things like the Tesla Powerwall. I don’t have one but wish I did. They’re expensive as backup power, a gas generator is a lot cheaper. I’d particularly like to have a small battery, just like 4000Wh of capacity or something. Enough to bridge an hour long power gap and let me keep my solar running; during the day I can charge it faster than I’d use the power. Last I looked no one made a small product like this. Not sure about transfer time; I think the Tesla Powerwall is slow enough everything is turned off briefly.

One extra note: all these systems I use are focussed on providing AC power. But 90% of what I care about plugged into it runs off DC power, it’s dumb to have a battery, an inverter to produce AC, and then a transformer to swap back to DC. The EcoFlow Delta has serious USB charging circuits. I suspect it’d be possible to get adapters to power things like network routers off those USB ports and that might be more efficient.

Verizon’s terrible systems

No surprise, a mobile phone company’s service sucks. Still worth documenting. I took a trip to Austria. I paid Verizon $100 for an international calling plan with more minutes and data than I could use. It mostly worked fine, but one day I made a phone call and got a message about it being billed at $1.99/minute as an international call. Weird, it should have been included in my plan. The slight wrinkle here is I was using WiFi calling from my hotel in Austria (and no VPN). But surely that shouldn’t matter?

I guess it did. This showed up on my bill:

It’s not in the bill, but the website and the customer support agent see a note that it’s for activity in January. On my October bill. I made the call in October.

I decided to waste my time to get a refund for that $1.99. It went as well as you might expect. But what really kills me is how bad Verizon’s product is.

I submitted a ticket and asked for email response. I’m getting text message response instead. My attempts to reply to the text message are silently dropped. I can’t submit responses on the website either; the submit button does nothing. (I do see an event fired in the Javascript console, but the message is dropped.) I tried two browsers. I tried editing my ticket to use a different contact method, that also failed.

I tried logging in again in a new browser. I had to verify, some 2FAish thing. I get a text message saying “click here to verify”, which I do. Meanwhile the login website is asking for a code, one never given to me by the 2FA side path. I submit a blank code and am logged in.

The website creating the ticket had numerous typos. The subject for the email they sent me is “, we received your support request.” I guess my name was supposed to be before the comma? The first message from the agent said “your concern with the INternational call. nI know how important this is for you.” Presumably they’re using canned responses; do they have typos in them?

The second message from the agent was about someone else’s bill entirely. 5 minutes later they told me to disregard it.

I have another Austrian call itemized on my bill that is attributed to Canada. It seems to be confusing the 431 area code with +43 1, phone numbers in Vienna. Are they using regex to decide which country I called? At least I did not get billed for this one.

I finally gave up and got someone on the phone. They looked and quickly agreed to refund the charge. As they should; $1.99 is not worth their time. Or mine, but it’s the principle of the thing.

I realize how boring this rant is, my apologies. It’s just astonishing to me that I have a fairly ordinary interaction with a consumer product used by millions of people. And in every single point along the way I see signs of the company just not giving a shit. Typos in canned messages, failed database merges in outbound messages, dropping inbound messages on the floor, a confusing or broken login system, mistaken billing, a high schooler’s idea of how to identify what country a call was made to. Does no one competent at Verizon care?

Search web pages I’ve seen

For 20+ years I’ve wanted the ability to search the web pages I’ve seen. Simple full text search on page contents, maybe also on some metadata like page title and the text of links to the page. You’d think this would be simple but it’s not. There’s 20+ years of systems that claim to do this that no longer work. It’s a cursed product category.

Firefox has some built in history search but it’s terrible; not sure what it is searching but it’s definitely not the full text of every page. Also a lot of pages are missing from it. Still the history database could be useful to feed to some other tool. It’s in a sqlite file in the user profile.

There’s a March 2022 discussion of tools for this. I read it all and was discouraged; it’s clear there’s no good solid product. I sifted through all the discussions and settled on two options: ArchiveBox with some custom scripting to import browsing history or else Recoll with an addon to capture browsing history.

I looked at Recoll and gave up. The Windows build requires payment to download, there’s no easy way to try it first. And the website says the Windows version has indexing limitations. I need a solid Windows program.

ArchiveBox could be promising. But the desktop app is Electron, marked “alpha”, and requires Docker to run. There’s an Ubuntu headless version but they only provide a PPA for 20.04, a 2.5 year old Ubuntu release. The install instrnuctions have you installing stuff globally with pip. I quit at that point.

I’m being cranky here but I really want a clean product for this function, not some hackerware. Or if it’s going to be hackerware I’d rather roll my own.

One subtlety; it’s not really enough to just get URLs and download them again. You really want the text as rendered in the user’s browser, to catch login data. Even with that it’s not going to be perfect unless you really snapshot the whole page; the sensible thing of giving back a URL from the search engine has the same problem that the URL now may not look like the URL then.

Update: this isn’t a search tool, but NirSoft’s BrowsingHistoryView is a nice table viewer for browser history. Much nicer than Firefox’s built in view.

BrowserParrot looks promising but is Mac only. Can’t tell if the project is active or not.

HeyDay also looks interesting. It’s more AIish than a simple search engine but might be helpful. $19/mo. Update 2: I tried HeyDay and it is not for me. It’s definitely doing something with my browser history. But it requires more active involvement than I want. It keeps asking me to categorize pages I’ve seen into topics, way more labor than I want to perform. It does do some stuff passively; popups on pages and in Google searches saying “hey, this is like this other thing you looked at”. Which in theory might be nice but so far the suggestions have been intrusive, not helpful. The UI is pretty demanding. All in all, not for me.

Update 3: I have failed to find a product that will do this for me. I’m doing a tiny bit better with Firefox history though. The key was changing the sort order from “by Date” to “by Last Visited” so now my results are in reverse chronological order, which makes it much easier to find again that thing I saw yesterday.

Blocking control-mousewheel in browsers

For whatever reason I find myself accidentally inputting control-mousewheel events in my browsers a lot. In both Chrome and Firefox this changes the zoom level of the page, something I pretty much never intend to do. (And if I do, I use Ctrl-Plus and Ctrl-Minus instead.) One fix for this I’ve been using for years is a small AutoHotKey script that captures those events and cancels them.

#IfWinActive ahk_class Chrome_WidgetWin_1
{
    ^WheelDown::return 
    ^WheelUp::return
    #MaxHotkeysPerInterval 1000
}


#IfWinActive ahk_class MozillaWindowClass
{
    ^WheelDown::return 
    ^WheelUp::return
    #MaxHotkeysPerInterval 1000
}

The ahk_class of a window can be found with the “Windows Spy” program that’s included with AHK.

Starlink service degraded: 20Mbps, 1TB data cap

Ugly changes in the Terms of Service for Starlink: residential customers have been degraded to 20-100Mbps expected download (from 50-200). Uploads are now 5-15, down from 10-20. Latency has also crept up: 25-50ms now, not 20-40. And a new unwelcome feature, a 1TB / month soft data cap before speeds are further degraded.

Starlink sure has fallen a long way from “no data caps! great latency for gaming! 100+Mbps!”. OTOH this new service level is at least closer to what they actually deliver. Over the last 90 days I’ve been getting 90Mbps average download speed with nightly slowdowns to 10Mbps. Uploads of 6.6Mbps and latency 55ms.

TBH the data cap is not a disaster; the average American household uses 513GB / mo although 15% use 1TB or more. It’s a soft cap, you get degraded to 5-50Mbps if you go over (or you can buy more). And the 1TB cap is defined in terms of “peak hours” but then that’s 7am to 11pm, or the 16 hours people are awake. I can make good use of the uncapped hours though with automated downloads.

What I don’t like about caps is how opaque they are to users. Starlink has added a daily usage graph so you can at least see what you’re using. But there’s no way to see what is using your data. And ordinary users don’t have tools to manage data usage; there’s no good way to use less.

Starlink still hasn’t communicated anything to its customers, we only know about this change from a TOS update. It seems unlikely we’ll get any sort of price break, just expected to accept the degraded service. Update now there’s an email to customers over the cap. Also a link to their so-called “Fair Use Policy” which explains the throttling.

Update 2: they sure botched this rollout. They emailed customers whether they had been over cap in the past but told a bunch of people the wrong thing, so sent a second email correcting it. They also told business users they would be throttled to 1 Mbps; obvious nonsense, but again required a correction. And all that on top of the original, probably mistaken quiet non-announcement via a TOS update.

For the record: archive links for Oct 6 2022 (pre-cap) and Nov 4 2022 (with cap).

WiFi channel 13

I can’t figure out how to make my American equipment connect to WiFi channel 13.

I’m at a hotel with adequate WiFi in Innsbruck. My Pixel phone connects to WiFi no problem, but my Windows 10 laptop (EdiMax and Killer Wireless adapters) and my Samsung Tablet can’t. Ken’s iPhone, iPad, and Windows 10 laptop (IBM) all do connect.

I used a scanner on my phone to figure out that the only AP near me is using Channel 13. Which is not allowed for use in the US and thus is blocked on American equipment. Usually it’s a simple software block and should work if the device realizes it’s in Europe. I tend to turn off location stuff on my computers, which may be why it works for Ken and not me. But after an hour+ of trying various settings, new drivers, etc I can’t make it work on either device. What a dumb thing.

Most online advice I found was “change your AP not to use that channel”, which is not helpful. Some Windows 10 advice is to look at Advanced device driver Properties (not registry) for a “Country Region” setting. Neither of my adapters have that. Trying to change locale settings and time zones and stuff doesn’t work. Hilariously, my Samsung tablet tells me I have to connect to WiFi to change region. But I think that’s just about video DRM anyway.

Update: another hotel with excellent 2.4GHz wifi has Channel 12 closest to me. My phone connects no problem; the laptop refuses. Fortunately there’s also service on many other channels, crazy strong actually (-50 to -60 dBm). WiFiAnalyzer on my phone seems to have a bug; I can’t always see the other channels, maybe some filter logic problem. NirSoft’s WifiInfoView on my laptop shows lots of networks on channels 1-10. Nothing at all on 11 and 12 seems invisible to me.

MicroSD card speeds simplified: V30 A2

If you want to buy a decent general purpose MicroSD card in 2022, buy something that says “V30” and “A2”. I’m happy with the Sandisk Extreme. It works pretty well as the primary disk in a Raspberry Pi and will also work for 4K video, maybe even 8K.

In detail.. There’s a confusing array of different class definitions for SD cards. Ignore “Speed Class” (2, 4, 6, 10) or UHS (1 or 3); those are obsolete. Also ignore SDXC, SDHC, and SDUC; those refer to storage capacity and you can just read the size.

The primary throughput rating on a card now is V, for Video Speed, and modern choices are V30, V60, or V90. V30 is 30Mbps and is fine for 4K video. There’s a nice chart here of speeds. Note a V30+ card will also probably be labeled “Speed Class 10” and “UHS 3”. Faster is better but you pay for it, so unless you know you need it save your money.

The only random access rating on a card is Application Performance Class and comes in two ratings: A1 or A2. There’s no real price increase for A2 so get that. This isn’t so important for recording video but means absolutely everything for use as a general hard drive, say in a phone or a Raspberry Pi. A2 isn’t so great; it’s 4000 read IOPS. Compare 600,000 IOPS for a fancy SSD. But at least it’s got a rating. Old fashioned spinning disks are more like 50-200 IOPS, so even that A2 is a big improvement over what we used to use.

The Sandisk Extreme 128GB I like is $20 for 128GB, V30, A2. Some prices for various speeds of 128GB cards from NewEgg

  • V10 A2 $13 – $17
  • V30 A1 $11 – $20
  • V30 A2 $11 – $20
  • V60 A2 $27
  • V90 A2 $100

V30 A2 is the sweet spot for performance; no point getting anything slower for general use. You pay a significant premium for V60 or V90. By all means pay that if you need it, but you probably don’t. 128GB seems to be the sweet spot for storage; 64GB cards cost almost the same.

Windows 11: 22H2 and Memory Integrity woes

More boring Windows sysadmin crap, no satisfactory conclusion.

Windows 11 22H2 came out today. I tried to install it. It gets to 37% and fails with basically no useful error message. “Window Update error code 0x80070001”. Thanks dudes. Searching for that error code is not helpful, with a bunch of cargo cult advice for a zillion different things that might be wrong.

I tried using Get-WindowsUpdateLog to give me a text file log of what went wrong but it’s impenetrably detailed. This looks like the error but I can’t imagine what is the actual problem.

2022-09-20 15:37:00.9942721 16468 23084 Deployment      *FAILED* [80070001] file = onecore\enduser\windowsupdate\client\engine\handler\osdeployment\helper\osdeploymenthelper.cpp, line = 612
2022-09-20 15:37:00.9942763 16468 23084 Deployment      *FAILED* [80070001] file = onecore\enduser\windowsupdate\client\updatedeployment\handler\osdeployment\installer\osinstaller.cpp, line = 1157
2022-09-20 15:37:01.0008701 16468 23084 Handler         Install complete for update ID: 8E409263-45B4-438D-AD01-6E9674AB032A.1 Return code is 0x80070001. Requires Reboot:No
2022-09-20 15:37:01.0008721 16468 23084 Handler         Enter deployment handler NotifyResult
2022-09-20 15:37:01.0009405 20108 24312 Deployment      Deployment job Id 51AE112D-2F4D-46DB-A0A4-381CB450EAAE : Update 8e409263-45b4-438d-ad01-6e9674ab032a.1 failure delegate invoked.
2022-09-20 15:37:01.0009697 16468 23084 Handler         Leave deployment handler NotifyResult
2022-09-20 15:37:01.0010261 16468 23084 Deployment      *FAILED* [80070001] file = onecore\enduser\windowsupdate\client\updatedeployment\handler\osdeployment\installer\osinstaller.cpp, line = 356
2022-09-20 15:37:01.0010271 16468 23084 Handler         *FAILED* [80070001] Leave deployment handler Install

So I started trying to figure out what else might be wrong with my system. One persistent problem is Windows Security claims that Memory Integrity isn’t enabled; that’s some virtualization thing to isolate processes. It wouldn’t turn on because an obsolete driver was blocking it. What driver? Some ancient Western Digital thing; I don’t even have any WD hardware on my system. It just got an update via Windows Update which resulted not only in the old version being installed but a slightly newer version also incompatible being installed. Great jerb. Anyway you can manually remove the drivers by using pnputil on the wdcsam files. I have no idea if this could break a system but I chanced it and it worked.

Well, sorta. Now I could enable memory integrity. Then it reboots to install itself and during the reboot I get a blue screen of death with something about Bug Check 0x7E, which means “System Thread Exception Not Handled”. That’s programmer speak for “shit’s fucked up, yo”. Searching online finds other people with this problem with the usual scattershot advice for fixing things and the occasional malware recommendation.

Just before then the event log had errors about IntelHaxm: “HAXM Failed to init VMX” and “HAXM can’t work on system without VT support”. I’m confused about this. I definitely have virtualization support, I’m using Hyper-V for WSL2. I don’t know about VT support. Also wondering if the Intel thing is a problem; this is an AMD Ryzen CPU. This Windows system started life on an Intel CPU and I transplanted the drive to an AMD system. Everything’s worked fine (it installs new drivers for the hardware it detects) but maybe there’s some weird vestige? Or it could be completely unrelated. I give up.

Windows 11: fixing crackling microphone

My headset plugged into my motherboard (Realtek audio) stopped working on my machine, maybe about when I upgraded to Windows 11? Not sure, but when I talked people would hear noise but just a burst of static. The fix was the re-set the format to 2 channel, 16 bit, 44100 Hz.

Windows sound drivers are an absolute mess. The fancy new Windows 11 UI works fine for basic things, but all the important stuff is still hidden in the Windows 7 Control Panel style settings. Why TF hasn’t Microsoft fully ported all the control panel stuff yet? It’s been 7 years since Windows 10 came out and yet still a lot of important settings are hidden in Windows 7 APIs.

In the end I found this guide most useful, using the local “Listen to this Device” loopback, Discord, and Google Voice to test. The web app for Google Voice bafflingly has no microphone playback / test I could find, but if you place a phone call to +1 (909) 390-0003‬ something will answer that will echo calls back to you. (Sadly this number has been tagged “Gateway to Hell” online enough that you might see that name.)

In the end my problem was the microphone device had somehow been set to 32 bits per sample. (This happened two years ago, too.) Which breaks everything not in some coherent way, but by just playing corrupted staticy audio. Nice. Windows is sure doing no favors to ordinary users letting people choose all these formats. 16 bit 44100 Hz is just fine for anyone who isn’t running a recording studio. (Or 48000 Hz; love having two nearly equivalent choices.)