I like Mastodon. But the mess which is cross-server following UI is really terrible. One bandaid for it is a browser extension. There’s a bunch of them. But the extensions have to have permission to modify data on all Internet sites, a potentially scary thing. Extension authors have definitely abused that power in the past. So my rule for this kind of thing now is it has to be open source.
There’s three open source Chrome extensions I found that make following cross-server easier.
Tootski (GitHub). This is the one I use. It works by adding a button to the awful “following users on Mastodon is a terrible experience” popup. It’s been a little flaky but does seem to work. Also ads a “share any page on Mastodon” button which I don’t need.
I’ve noticed something since switching to Chrome: sometimes when I click on a search result some text is highlighted on the page. Turns out this is called text fragments. More docs here and a general interest article here or here. Th ey date to 2020 and work in all major browsers but Firefox.
For example searching Google for [coconut milk chicken marinade] leads an in-line “People also ask” result. Clicking that result leads to a special anchored URL that causes Chrome to navigate to and highlight the relevant result. It’s a way to make a deep link into a particular piece of a page, based on its text content, without the page having an explicit anchor to link to.
There’s a standards proposal here (and a W3C document) that talks about some subtleties. There’s escaping, of course. There’s an HTTP directive for a page to opt out of the behavior. The browser applies a :target CSS pseudo-class to let the site customize the highlight style. Also a little bit of Javascript API for the feature.
The syntax :~:text= made me wonder what other possibilities there were. MDN calls the :~: a “fragment directive” but so far text seems to be the only option. :~: was chosen because it wasn’t seen anywhere on the Web at the time the proposal was written.
Update: see also fragmentations, an alternate proposal which just normalizes putting plaintext phrases in an anchor. The Mozilla folks seem to prefer that. I’m not sure any browsers really do anything for them; the implementations I’ve seen involve Javascript or an extension.
I just completely changed how my Android devices look and couldn’t be happier. I switched from the usual “grid of random icons” to a clean monochrome look. I like the result, here’s screenshots from my phone and tablet. Edit after 6 weeks I like it even more. Read below for notes on how I did it.
Background: Tapet
The simplest part is the screen background, generated by Tapet. That’s an app that makes a new abstract image once an hour. It’s tweakable, I’ve set it to 60% Adaptive Dark and 10% Blur so the images are less distracting. (The pink screenshot is without the dark setting.) Tapet has been around a long time and is great. You can use it on its own without the other stuff. It’s free but it’s worth paying a few bucks for the premium unlock.
Launcher: Niagara
The big change; I switched from Pixel Launcher and Nova Launcher to Niagara Launcher. That’s a pretty major change to phone UI and I really like it. Niagara has you choose ~8 apps for the home screen (as seen above). Then the rest of the navigation is based on a really neat rolodex UI that lets you pick an app out of a list alphabetized by name. I’ve been launching apps by searching by name for years now; this picker is way better than typing the name!
Beyond that Niagara has a limited but thoughtful set of features to help you keep the home screen clean and minimal. Despite that it also packs in some great detail. See the text on Moshidon on the left screenshot? That’s an Android notification displayed inline in the launcher. There’s also a fancy “popup” feature that’s like folders but better, when I tap on News I get a nice popup of various news related apps.
Niagara is free or $10/year for the not-really-necessary Premium.
Icons: Pix Material You Light/Dark
Niagara can replace the app icons with an “icon pack”, something you download from the Google Play store. These packs contain thousands of icons, both specific ones like “Slack” and generic ones like “Video”. Niagara does a great job helping you use these icons. Google is encouraging all apps to provide a monochrome icon for Material Design but even after two years most of my apps don’t have them. The icon pack lets you override them.
The icon pack I’m using is Pix Material You Light/Dark. These are monochrome icons that adapt to the device theme (more on that below). It’s $2, well worth it. Another nice option is Whicons, all white icons (there’s a black version too), it’s free. I prefer the shapes of Pix but they’re both good.
Weather: Weawow
Niagara lets you have one widget visible on the home screen. I picked Weawow for weather. My first choice would be Windy but its widget is full of colors. Weawow has a nice simple monochrome widget that looks clean. (Does anyone make a weather widget that uses adaptive colors?)
Colors: Material You
Here’s the tricky part: the icons adapt to the colors on the background screen recently generated. See the pink cast to the app icons on the right that matches the pink background? That’s Material You design in action. The system picks a color based on your background screen and customizes all the UI to use that one color as a highlight. And it changes every hour. Subtle variety.
Niagara works well with Material You, most of its UI elements are themed to it. And it can re-color an icon pack to match the Material You color. Works great on my Pixel phone. Unfortunately Samsung chose to break Material You. As Niagara explains, “On Samsung devices the Material You palette consists by default only of shades of blue, no matter what wallpaper you have applied.” Samsung’s apparently really committed to their brand identity color. You can use the Samsung Theme Park app to edit it: it will still be stuck to one color, but at least that color can be white. That’s what I’ve done on the screenshot on the left.
Thoughts
I always feel guilty spending time customizing my environment, but I think it was worth it this time. I’ve got something that looks clean and fresh. And it shouldn’t require much updating or maintenance. I feel like Google is working its way to this kind of look in Android; the core concept I’m using is just an extension of their Material design. But the Niagara launcher is a pretty radical departure.
Update
I like this setup more and more as I use it. Niagara just launched a new version with “Anycons”, its own set of monochrome icons that can be recolored. They are very nicely drawn and it looks great, I’ve replaced the Pix icons. Unfortunately the Samsung bug is still there and still breaks the color detection, see more notes on that. Niagara now has a set of static options you can pick that look fine on most backgrounds, including a neutral white.
I’ve seen some folks talking about setting up a new linkblog so I thought this would be a good time to document how my linkblog works. I’ve run this publication over nearly 20 years and am pretty happy with the current iteration. See also previous detailed posts.
Summary: I post links to pinboard. A cron job on my own server downloads the pinboard data to sqlite and renders static HTML, RSS/Atom, and Mastodon posts from it. There’s also some code for generating screenshots of the linked pages.
Simpler alternative
There’s no need for custom code or your own server. You can run a simple linkblog just using Pinboard or Raindrop. Those sites offer both an HTML view and a very functional RSS feed. There’s a bunch of services that will mirror RSS to social media like Mastodon; IFTTT, maybe Zapier. That’s how I ran my linkblog for many years.
My data model
My linkblog is a collection of posts. Each post has six elements:
URL of the page I’m linking
Short description
Extended description
Tags (including a +/- sentiment tag)
Date I made the post
Hash of the post
This is basically Pinboard’s schema, not an accident!
One thing I don’t have for each of my posts is a URL for my post itself. There’s no way to link to one linkblog post of mine. My RSS feed’s links don’t go to my own linkblog; they go directly to the page I’m linking. I think this is the defining feature of what a linkblog is but not everyone who linkblogs agrees. I have some detailed notes on what other linkblogs do.
The hash is a little strange; it’s something Pinboard generates, a 32 character string. I use it in places where I need something unique for each link I blogged like the ID for each Atom feed entry or the URL for an image preview.
Posting a new link
When I want to post a new link I use the Pinboard Plus extension in my browser. Really any way to create a Pinboard post would work, this one is just convenient for me. The posting UI looks like this:
Publishing new posts
I have a cron job on a personal server that polls Pinboard every 5 minutes checking for a new post. When it finds one it does a series of things:
Add the post to a local sqlite mirror of Pinboard data
Create image previews for the new link
Render static HTML and Atom feeds for the whole linkblog
A side / optional feature, an image for each link I post. It boils down to using Metascraper to look for a suitable image unfurl or else shot-scraper for a screenshot. Here’s some detailed notes on page previews.
HTML and Atom rendering
Most of the code I wrote is for rending my linkblog to HTML and Atom feeds. It’s pretty straightforward though. It should be possible to use a static blog generator like Hugo instead but I wanted complete control so I rolled my own. I don’t worry too much about the HTML page functionality, I expect most people read my linkblog via a feed reader or else social media.
Social Media posting
New posts go to social media, these days that’s Mastodon (it used to be Twitter.) This process is driven entirely from the Atom feed, not from my rendering code or sqlite mirror. Currently I’m running feed2toot on my server to do the posts, it works fine. A service like Zapier or IFTTT would work too and be one less thing I have to manage myself.
Thoughts
I set up this new architecture last year and have been very happy with how robust it is. Cron jobs and static publication are a great way to build things like this. I do regret running my own server for the rendering piece but I wanted to experiment with something custom to me, so it was effort well spent. Fortunately it seems to be running by itself with little work for the last year.
I think an existing bookmarking service could run a whole linkblog. I haven’t tried it but Raindrop.io looks to have all the important components: image previews, feeds, and a nice public page for an HTML view. It’d come down to details and whether they center links to raindrop.io itself or the destination site that was linked.
More work on my little Javascript hack. Unlike that first video this system is actually working correctly. Some examples of other rules; Ising model not depicted.
I started using rechargeable batteries about 15 years ago, when Eneloop batteries were the new hotness. Some of those old batteries no longer hold a charge. Also I got more interested in how they work. Some details, mostly about AAA batteries. AA batteries are very similar but have about 2.5x the capacity.
Old fashioned disposable AAA batteries are typically Alkaline chemistry. They’re nominally 1.5V and store about 1000mAh of power, so 1.5Wh. This is what Duracell sells you.
Most rechargeable batteries these days are NiMH. (NiCd are obsolete.) These are nominally 1.2V and about 1000mAh, so 1.2Wh. Capacity varies 20% though; Amazon Basics sells 850mAh. I recently bought some Tenergy batteries which are supposedly 1100mAh but actually 1000 when measured. Wirecutter has recommendations for other brands.
There are also Li-ion AAA batteries. The cells are 3.7V, so these come with a small transformer built in to get the power down to 1.5V. These seem to be sold as 1200mAh, so 1.8Wh of power. A lot of stuff I’ve read suggest NiMH batteries are better for most AAA applications but I don’t understand why, something about load patterns and battery longevity.
A typical set of 4 AAA batteries is about 5Wh of energy, or under a penny worth of electricity. Compare 10-15Wh in a cell phone, or 65Wh in a laptop.
Note the difference between 1.2V and 1.5V depending on battery chemistry. This doesn’t matter for many applications, I guess the power circuit isn’t that sensitive or smooths it over. The voltage also drops as the battery discharges but NiMH has a pretty flat curve for most of its duration. Li-ion batteries put out a steady 1.5V, presumably because of the transformer built in.
Batteries wear out over time. NiMH AAA batteries are typically rated for 500-1000 cycles. But the reality of batteries is they seldom have such nice clean full-to-empty load placed on them so the actual lifespan is shorter. I think the batteries I’m throwing out probably were put in a charger about 100 times at most.
Fancy battery chargers like this old one have a couple of nice features. One is variable charging power; it’s better for the battery to charge more slowly. Another is a “Charge Test” mode; it charges the battery to full, runs it down to zero, then charges it to full again and measures how much charge it actually holds. That’s how I figured out which batteries to throw away, the ones that didn’t hold more than 600mAh anymore. The charger also has a “refresh” mode where it cycles the battery repeatedly hoping to make it work better. I’ve tried using that in the past and it seemed to help but not be worth the bother.
I took a quick look at Astro, a newish open source framework for building (mostly) static websites. It looks pretty nice but may not be what I want for my current project, (once again) trying to replace my ancient dynamic blog engine with a modern static site.
The big thing Astro seems to enable is Javascript-heavy static sites. If you want to use React, Vue, Svelte, etc to build a complex Javascript site, but you want everything statically pre-rendered, Astro looks to be your choice. There’s a lot of fancy support for dealing with Javascript, CSS, fonts, etc and getting them to assemble to a nice static page for the client. Also integration with GitHub (for code hosting) and Netlify (for site hosting). I think that’s an interesting spot to be in for a framework in 2023. (Also kind of the opposite of another paradigm I think is interesting, very lightweight Javascript and using HTMX to bridge to a dynamic server.)
One minor annoyance: even the very first empty template project loads about 5kb of client side Javascript. It doesn’t seem to be doing anything and I think can be removed. But it says something to me that even the null project already has client side Javascript; this is a tool intended for Javascript sites.
What Astro doesn’t have out of the box is a blog engine. They have a great tutorial that has you create a blog, very nicely written and easy to follow. But along the way you’re writing code like “enumerate all the markdown files for the posts then use that to build an index of my blog posts”. Ie, you’re coding your own blog layout. That’s fine as an example of building your own static site. But I’m just trying to set up a blog, I’d rather have that stuff built in already.
Maybe that stuff does exist. Astro has a bunch of blog themes, perhaps Astro + an off the shelf theme is what I’m looking for. So I gave Blogster minimal a try. It’s kinda nice and has zero Javascript in the built output, a goal I want. But this looks more like another demo of how to build a blog. In particular there’s no easy way to extend this code short of forking the github project and building your own. Which is fine, but more like programming Javascript and less like customizing some static HTML templates. That’s great if you want to really customize but is work I’m hoping to avoid.
I’m left with the impression Astro is a good choice if you are expecting to write a lot of code to build something unique and custom.
While migrating my poor old blog I looked at a 2003-era script I wrote to ping services to tell them when blog was updated. Yes, this used to be a thing. I pinged three services, one is still up.
Ancient history
blo.gs: still live! Pings still work! They even have an API to get the update stream. This was originally built by Jim Winstead, then went to Yahoo, then Automattic (ie, Wordpress) picked it up in 2009 and has been running it faithfully ever sense. Three cheers to Automattic, they run a lot of neat little things that would otherwise be abandoned.
weblogs.com: fails, website doesn’t even exist any more. This was an early service that had big drama in 2004 when Dave Winer threw a hissy fit. VeriSign bought it in 2005, then a few years later it was bought by a private investor group. The last copy of the page in the Wayback Machine is April 2019 and has LexisNexis as the owner. Not sure anyone noticed its passing in 2019.
Google blogsearch. The website is gone but my request to blogsearch.google.com/ping still looks like it works (it probably doesn’t). Apparently this shut down in mid-2018. The larger blog search project shut down in 2011.
Current status
I don’t know what the modern version of blog pinging is, if there even is such a thing. Sitemaps have replaced much of the web function and active push systems like Twitter or ActivityPub have replaced the RSS based pings. Fortunately RSS itself still works.
There’s a large number of ping services that claim to ping many indexers endpoints for you. Ping-o-matic is old and reputable (and owned by WordPress Foundation), it now supports Blo.gs, Feed Burner, Spinn3r, and Superfeedr. One of the biggest lists is from something called “Brain Bliss”, here’s the list of blog pings it says it does. Some of these are definitely offline now.
Amazing Stack Exchange answer that solved a mystery for me: sudo and ssh logins were taking a few seconds. Turns out if you change your hostname on an Ubuntu box with hostnamectl it doesn’t add an entry to 127.0.0.1 for the new hostname. So you have to add it manually.
The delay isn’t so bad you can’t live with it. Maybe 2 seconds? But it’s annoying! I felt like it was DNS related but was assuming it had to do with the DNS server my datacenter was setting. But there’s no reason sudo should involve network DNS at all.
While I’m here, trying to change the DNS servers on Ubuntu is still a total clusterfuck. Not sure if the problem is netplan or systemd-resolve. resolvectl status is helpful but the output is confusing. I’m not sure if I’m getting the “global” setting or the “link” setting. I wish there were some easy way to test it. nlsookup just tells me I’m using systemd’s goofy 127.0.0.53 as the resolver.
# resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Current DNS Server: 8.8.8.8
DNS Servers: 8.8.8.8 8.8.4.4
Fallback DNS Servers: 1.1.1.1 1.0.0.1
Link 2 (enp2s0)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.187.107.16
DNS Servers: 192.187.107.16
DNS Domain: nocix.net
Link 3 (tailscale0)
Current Scopes: none
Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
How do you back up your passwords in 2023? It’s a grim topic but if someone dies it’s an enormous help if their executor can access their online accounts. Passwords are a key part of that. Here’s some notes on a succession plan for account access. They’re 1Password specific, but any decent password database should work similarly.
1Password emergency access
1Password has a very well thought out emergency kit. It’s a single page you print out that contains most of the data you need to get access to a 1Password vault. Print that and put it somewhere safe. What’s missing is your vault’s password, the thing you type to unlock it. There’s a space for you to write it in. Diceware style passphrases (e.g. “correct horse battery staple”) are a good choice for your vault’s password; secure, relatively easy to remember and type, and quite easy to read when scribbled on a piece of paper.
1Password also has a family recovery system. If you’re paying for a family plan anyone who is a “Family Organizer” can unlock someone else’s vault in an emergency. Note you have to set this up ahead of time.
Printing passwords
1Password’s recovery system is great and what you want to use. But there’s something to be said for a simple paper backup in case something goes catastrophically wrong at 1Password. It’s very easy to export 1Password’s database, either to a special format 1P invented or to a plain old CSV file.
Printing 1500 passwords is harder; it’s a lot of pages and you want it to be legible. I ended up using good ol’ Keepass for print formatting. I exported my database to CSV, then imported it using the generic importer in Keepass. It has a decent print system, the formatting is fairly good. My ~1500 passwords ended up being 30 pages. Don’t forget to print double sided to save half the paper.
Passwords aren’t everything
Passwords aren’t all you need to get access to everything online. Two factor authenticaton, passkeys, etc all complicate that.
Phone access is increasingly useful, particularly for two factor logins. I imagine there could be a need to get one last thumbprint to unlock a phone...
Email access is also really valuable. Consider setting up Google Inactive Account Manager if you use Gmail. Note it’s a minimum of 3 months to trigger.
My server for somebits.com broke (hardware failure). My notes from last time I set this up were helpful so I’m taking boring detailed notes again.
I really need to stop having a custom configured bespoke server like this. It’s almost entirely used for web traffic these days, and most of that is static. If I can ever successfully convert my blog over to a static generator I could be done with needing a custom server.
Fairly generic stuff
Change password for user “customer”
Add my ssh pubkey for user root
Install Tailscale
Set hostname with hostnamectl set-hostname
Add DNS A records to somebits.com for both main IP and Tailscale IP
Run apt upgrade
Install a bunch of useful packages apt install joe stress-ng stress s-tui smartmontools zip unzip rsync openssl webp plocate ripgrep pigz python3 python-is-python3 python3-venv python3-dev pkg-config build-essential sqlite3 chrony rsnapshot
adduser nelson
usermod -aG adm,cdrom,sudo,dip,plugdev,lxd nelson
reboot
file a ticket for reverse DNS
Copy all my old server files from backup to a subdirectory under /root
Set up /home/nelson from the backup
Set up rsnapshot backups. This is very fiddly; rsnapshot -t is useful for testing things. On the newly installed server to be backed up it requires a new user and an entry in /etc/sudoers.d.
apt install mail and set up a local-only postfix
Skipping this time: autossh, munin
Service specific stuff
Change *.somebits.com and somebits.com DNS to new server. I did this early, before the new server was fully set up, because the old one was already broken.
Change DNS entries for other services I run (check Hover DNS).
apt install apache2
Copy over /var/www from the backup
apt install certbot python3-certbot-apache
Restore /usr/local/etc from backup
Restore /etc/apache2 from backup
Make subdirectories in /var/log/apache2 for d in logsoflag n177xy somebits weblog windhistory; do mkdir $d; done
Restore /etc/logrotate.d entries that are relevant
Set up Perl environment for Blosxom apt install libcgi-pm-perl libimage-size-perl
Migrate old Let’s Encrypt install over to new server Restore /etc/letsencrypt from backup Test https works on new server (beware of DNS expiration times) Test certbot renewal with certbot renew --dry-run Remind yourself to check in three months
Copy over and test secret stuff from /usr/lib/cgi-bin (no, really!) Also requires apt install python2
Set up linkblog user and test it adduser linkblog restore ~linkblog from backup On home server: /home/nelson/somebits/linkblog/prod/update.sh -p -f Probably have to swizzle cached ssh keys with this.
User crontabs in /var/spool/cron/crontabs.
Testing
Look at dmesg and /var/log/syslog for anything troubling
Try various websites
Look at /var/log/apache2/*/error.log for anything troubling
Add a new linkblog entry, verify it shows up
One hidden gotcha is all the other client hosts that might have the wrong entry in .ssh/known_hosts for the domain name for the new server. You have to run ssh-keygen -f "/home/nelson/.ssh/known_hosts" -R "somebits.com" to remove them, then manually accept the new ones once.
I managed to break my first attempt at setting up the new server by adding a disk to /etc/fstab forgetting an earlier lesson. Linux systems won’t boot if something in /etc/fstab isn’t working! Fortunately the datacenter has automated system reimaging so I could start over without wasting anyone else’s time.
My datacenter server failed, bad power supply, and when it came back it’s sort of working but is very very slow. I poked around and got the impression the problem is a failing disk. How to be sure? These notes are for a spinning SATA disk, not an SSD.
iostat
The main thing I noticed is everything writing to disk was taking a long time (ie many seconds instead of 100ms). Also a lot of processes in device wait. Here’s how I quantified the problem
Note with iostat -d 1 the very first row is since system start, then it’s a continuous report for the last second. The alarming thing here is the “await” column. That’s milliseconds waiting for a single read or write; 380ms average since system boot! Something’s not right. The throughput numbers are also a clue, disks should be doing 30 MB/second, although that does depend on what the programs using the disks are doing. The 100% utilization is a very bad sign too. You can get more details from iostat if you remove the -s flag, but it gets a little confusing.
hdparm
hdparm can be used to test read rates on a disk. Here’s what I got
# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 30 MB in 4.27 seconds = 7.02 MB/sec
That’s 7 Mbytes/second. That’s awful. Even a slower spinning disk should be in the range of 100 MB/sec. Something is wrong.
smartctl
smartctl -x /dev/sda is also important, using SMART diagnostics on the disk itself. -x means “all, no really all”. Unfortunately its output is still really hard to understand, the confusing “VALUE WORST THRESH” stuff. I have previous notes on understanding smartctl output that are helpful. This weird Maxtor drive I have has confusing numbers and doesn’t report the Raw_Read_Error_Rate I’d most like to see.
I do have an error log with lots of entries like
Error 46140 [11] occurred at disk power-on lifetime: 36305 hours (1512 days + 17 hours)
There’s no easy way to tell how old those errors are or exactly what they meant. But their presence and the number “46140” sure gives me concern.
smartd displayed this helpful error in the syslog, also suggesting a problem.
Modern spinning hard drives have the ability to remap bad blocks and avoid them in the future. Linux has historically been bad at letting the disk do this, I think on the theory that destroying data is bad and it should be a manual process (or better, avoided). Here’s some recent notes on the topic. I think manually remapping a known bad block is still really awkward and difficult. Reading that makes me think the disk should itself eventually recover if the block is re-written. But if it’s a read only file that’s corrupted that won’t ever happen!