Some Bits: Nelson's log

6 posts in May 2024

Goodreads data export options

Ever since my Goodreads account loss disaster I’ve been eager to back up all the info on books I have recorded there. Right now I’m motivated to build my own UI for that data so I can search for books more easily. Considering emulating Simon Willison’s dogsheep projects and getting the data into sqlite for Datasette.

Anyway, there’s a bunch of ways to get data out of Goodreads. They’ve changed over the years as Amazon, their owner, makes it less and less accessible. Here’s some options:

My Books > Import/Export. The simplest bulk export. Takes a few minutes and you get a CSV file, one per book in your library. Data includes title, author, ISBN, rating, date read, etc. The data format is a bit funky with columns like "=""0060590297""" or "=""""" but it seems to have most of the data I want in it. (Unfortunately it does not have the number of reviews the book has received, but it does have average rating.)

Account Settings > Settings > Privacy > download request, called a “DSAR” (a GDPR compliance term). This gets you a zip file full of JSON stuff. They say it will take up to a month to prepare the download, last time I did it took several days. There’s a lot of uninteresting stuff here, like a record of every time I opened the Kindle app on my tablet. It’s also not in a convenient format. The review.json contains my reviews, for instance, but the book is only referenced by freetext title: no IDs or ISBNs or the like.

Goodreads API. Hahha, just kidding, it was shut down in 2020 “As part of our overall commitment to continually improve our data management”.

HTML scraping. There’s a bunch of projects and tutorials around scraping data, all at various levels of completeness or abandonment. I had some luck with goodreads-user-scraper: it looks like someone’s maintaining it and it’s oriented around user data, not just scraping stuff for some marketing purpose. But it errored out about halfway through with a 404, not sure if I was throttled or it’s broken. Also none of the data was personal to me other than the list of books, in particular my review text isn’t in the dump.

Note my list is organized around getting a snapshot of your account. Given it takes them up to a month to prepare that a snapshot, it’d be nice to have incremental updates. I think a scraping approach is the only way to do that.

I’m going to start with the CSV and feed it into datasette and see where that gets me. Probably use scraping otherwise, the DSAR looks pretty useless for my purposes.

Datasette import

Quick-and-dirty Datasette notes:

  • install datasette with pip
  • install sqlite-utils with pip
  • sqlite-utils insert goodreads.db books goodreads.csv --csv
  • datasette serve goodreads.db

The schema is messy so I created some views in sqlite to have cleaner output in Datasette

drop view if exists read;
create view read as
select
  "My Rating",
  "Average Rating",
  "Date Read",
  Title,
  Author,
  trim(ISBN13, '"=') as "ISBN13",
  replace("My Review", '<br/>', '
') as "Review"
from
  books
where
   "Bookshelves" in ("", "wont-finish")
;

drop view if exists toread;
create view toread as
select
  "Average Rating",
  "Date Added",
  Title,
  Author,
  trim(ISBN13, '"=') as "ISBN13"
from
  books
where
   "Bookshelves" = "to-read"
;

Promoting a git project to a bare repo

I usually develop on local disk, just git init and start programming. No push or pull, no remote repos. But sometimes I want to get fancy and have a remote repo. I don’t use GitHub or GitLab to host these projects, I just host them myself. But things have changed a bit in the intervening 12 years, here’s the new process.

### Clone existing code into a new bare repo
cd ~/gitrepos
git clone --bare ~/src/blog/static/flourish/ flourish

### Set up origin in the old existing code
cd ~/src/blog/static/flourish
git remote add origin example.com:~/gitrepos/flourish
git push --set-upstream origin main

### Verify things are working as expected
git remote -v
git branch -avv

One subtle thing there... The bare repo is created by cloning from local disk. But then I set the origin back in my working code via an SSH URL. Not strictly necessary in the case where both the bare repo and the working copy are on the same computer but the whole point here is to enable working copies on multiple machines from the same bare repo.

And an extra complication: I have Syncthing synchronizing my ~/src to my various Linux development environments. All behind the scenes, transparently. This can be a little spooky sometimes; if I git commit in one working copy there’s no need to git pull in another working copy because syncthing will sync for me. It’s harmless to git pull and git push in this configuration though, at least as long as I’m not making changes in two places at once.

Starlink: fewer obstructions? Not really.

Interesting change in Starlink: fewer reported Obstructions starting around April 29. But it looks like they just fixed a bug where outages from Reboots were being called Obstructions.

Outages

Here’s a graph of obstruction outages for the last 90 days. It’s a graph of the gRPC outage stats from Dishy, the same thing the mobile app shows.

Sure looks like an improvement! In the past week I’ve had 7.4s obstructions and about 6 minutes of total outages. In a week a month ago I had 176s of obstructions and 386s of total outages.

Unfortunately this improvement seems to just be a recategorization. One cause of Starlink outages is rebooting for firmware upgrades, around 30 seconds a few times a week at 3am. Last month those outages were sometimes categorized as “obstructions”. Now they’re properly marked as “booting”. Here’s a week from last month showing these 3am false “obstructions”: in the most recent graph these now show as “booting”.

Here’s a graph of all the outage types for 90 days all together. You can see the red booting is more common than before.

Packet loss

Unfortunately this lowering of obstructions doesn’t seem to be affecting overall packet loss. Below is a graph of Starlink’s own stats on “drops” for 90 days followed by my own IRTT monitoring which also shows dropped packets.

No clear change, so maybe things aren’t really better. No visible change in the graph and doing the math, last week I had 0.63% packet loss and a week a month ago had 0.50% packet loss. Packet loss might have even gotten worse but I wouldn’t read too much into that without closer look.

Chromebook powerwash / channel downgrade

My Chromebook on the beta channel (v125) has been flaky, the Android and Linux subsystems kept crashing. So I decided to downgrade back to stable channel (v124). That all worked but was tricky enough I’m writing notes. See below for the dream of 1990s computing.

An important concept here is ChromeOS “powerwashing”. That’s basically a full software reset, wipe the whole system (including your local data) and reinstall. It’s a neat feature of Chromebooks, the easy full reset as an important part of the product.

Changing channels

There’s a “Channel” pane in settings with a “Change channel” button. If you use it to downgrade from beta to stable it tells you that you have to powerwash the system (fully resetting it) and reboot. But rebooting doesn’t do anything, neither does manually powerwashing. Turns out you have to click “check for updates” somewhere to get it to download the stable release, then follow that path to install it which results in the reboot and powerwash.

Note that powerwashing is the default way to downgrade ChromeOS and will avoid compatibility problems. But it’s not necessary. There’s a crosh shell command to downgrade without powerwashing. Enterprise-enrolled Chromebooks also have an alternate channel switching method where it doesn’t switch immediately but instead waits a few days / weeks for the stable release to catch up so you can smoothly move from beta to the newer stable without a reset.

But Chromebooks were designed to be safely powerwashable. In theory all your important stuff is stored in Google’s cloud already and a powerwash is painless. How does that work out?

Powerwash: the ChromeOS stuff

After a powerwash it is indeed easy to get your basic Chromebook back to the state it was in. Basically you log in once and Google syncs back over your web browser state, which in ChromeOS is basically everything on the computer. The big hassle is you have to log in again on every website, all your cookies are gone. But in general your Chromebook environment looks the same after a powerwash and login.

Google will force you to once again re-enable ad privacy in the Chrome configuration. Sleazy.

Two things special to me inside ChromeOS, unlikely most people would do this:

  • I had to re-enable the ComposeKey input method as a second keyboard. It was installed but I had to go into settings to make it accessible.
  • I will need to reinstall the Bypass Paywalls Clean Chrome extension. That has to be sideloaded from local files, Google won’t allow such useful stuff in their Chrome addon store.

However, I don’t just use ChromeOS stuff on my Chromebook. I am also a developer running Linux and I use a bunch of Android apps. That’s a little trickier.

Powerwash: Android

Android apps are almost first class citizens in ChromeOS these days. The powerwash restore app will offer to reinstall “your Play apps”, which means Android apps I guess. It reinstalled all the apps I had before on this Chromebook. But then they all have to be re-authenticated and configured. For me that means adding a new device to Tailscale and resyncing Obsidian with their sync service.

Powerwash: Linux subsystem

I also run a Linux container on my Chromebook. ChromeOS has a nice backup and restore system for that. I backed up to a USB drive, powerwashed, restored, and everything was back the same in Linux. Both the Debian image and my /home stuff. The Linux Signal flatpak app even stayed logged in. Couldn’t be easier. (the backup file is called .tini but is mostly just a .tar.gz of the filesystem with an extra metadata.yaml at the front.)

I had to manually re-share my ChromeOS Downloads folder to Linux so /mnt/chromeos/MyFiles/Downloads worked again.

Powerwash: Steam

ChromeOS now has experimental Steam support which basically amounts to a second Linux container. I just reinstalled that which was painless since Steam Cloud stores everything anyway.

The dream of the 90s is alive

There’s a couple of old ideas about computing from the 1990s that are finally sort of to fruition now.

One is the idea of a “thin client”, that the computer you sit in front of has nothing important on it and instead interfaces with what you want on the network. That’s how a lot of stuff works these days with hosted webapps. But we’ve never quite gotten free of your personal computer still being customized. The ChromeOS team put a lot of work into syncing that customization and it mostly is productive although then I messed it up again wanting a local stateful Linux environment. Also authentication is a huge PITA, no one wants to sync the actual login token to the cloud.

The other is the idea of “ubiquitous computing”, that I could access my personal computer environment anywhere I go seamlessly. Again we’re mostly there with modern Internet and cloud based stuff, but there’s still the tricky problem of local state. A simpler login system (like passkeys should be) would go a long way to making the re-authentication easier. And you’ll never completely avoid the reality that having local state on a local computer is faster than something over a network. That’s why I bother with the local Linux machine, for instance.

Simple monitoring for small projects

Just set up some long-overdue monitoring for small projects like my blog and linkblog.

updown.io makes HTTP requests to your server and alerts you if they fail or do not contain expected contents.

healthchecks.io alerts you if an HTTP URL on their server is not pinged in a configurable amount of time. It’s intended for cron jobs; if your job doesn’t load the URL in time you get a warning.

Both are free for initial usage, enough for at least a year of a small project (or more). And low cost beyond that. They’re both professionally made and have been around awhile. I’m impressed with how many integrations they have. Email notification is the default but there’s Slack, SMS, etc as well.

shout-out also to scrutineer.tech which runs a simple RSS feed warning you about upcoming SSL certificate expiration.

Starlink bandwidth over 3+ years

I was surprised in my last post about how I was getting 25 Mbps upload speeds. So that had me looking again at my bandwidth tests since I got Starlink. These are tested with the Ookla Speedtest CLI tool. They are a test of my house’s network connection, so occasionally speeds are slower than real because I’m using the network or I’ve temporarily failed over to my backup ISP (not Starlink). But overall these reflect Starlink performance.

Fine grained graph

The main trend that interest me is in 2023 and 2024, the steady improvement of speeds. Particularly upload speed. This is a great trend to see in your ISP!

It’s also interesting to see those halcyon days of 2021 before Starlink got heavily subscribed. That’s a suggestion of what the maximum radio throughput service is. Service was worse then: more outages, higher latency, more variability. But download bandwidth was same-ish for a lot of this period. Upload has definitely gone up.

Monthly average

The graph above is some fine-grained reporting interval that Grafana selected, probably a few hours per point. The graph below is an average of every 30 days. The same trend is more clearly visible but of course it doesn’t capture the variance.