Some Bits: Nelson's log

3 posts in February 2022

Data export from cloud services

Goodreads lost all my data, writeup here. This hammered home the value of data export services for making my own copy of stuff. I had an export from last July so the Goodreads loss wasn’t entirely catastrophic. Some notes on other data export services.

Data export is obviously a competitive problem for services. If I can’t get my data I can’t easily migrate to a different service. So evil companies want to keep you locked in. Consequently the data export products are often not very good. Countering that are laws like the GDPR and CCPA which give consumers rights to request their data. I’m finding most of the big services I care about do have a reasonable export service. A good hacker spirit also still pervades in some tech companies, they build export because they think it’s the right thing for users.

Google Takeout is the gold standard. The Data Liberation Front did pioneering work in convincing a company to provide export tools many years ago. The tool now works very well. I’m particularly impressed there’s a way to set up a new data export every two months; all the other services are one offs.

Most of these data export services can be slow. Various nonsense explanations (“for your security”). I cynically expect companies keep them slow to be awkward. But one insider I asked confirmed that they can also be slow for legitimate technical reasons. If you’ve got, say, a real-time messaging system then scraping back for 15 years of message history can be pretty hard on the datastore. Backup requests are seldom time critical so built-in throttles make some sense.

It’s a big problem to actually do anything useful with the data dump once you get it. Some of the services (Twitter) include little webapps to at least sorta browse the data. Some just give plain CSV or JSON dumps and you’re on your own. I was hoping to find a diversity of wonderful open source software that could consume these exports. But in retrospect of course not; building those is a lot of damn work.

There’s less organized community around data exports than I’d hoped to find. The IndieWeb world is a good starting point. Datasette is one general purpose data viewer; Dogsheep is a nice collection of tools to import various formats in to sqlite for Datasette. HPI is another interesting general purpose viewer toolset. Also FreeYourStuff which seems to include some scrapers for sites without export tools.

Some of the exports reveal a surprising amount of extra data I didn’t know the sites had. Feedly has a list of everything I’ve read with dates, for instance, which is kinda neat! Facebook has a huge amount of stuff, some alarming, it would take awhile to comb through what all they’ve collected on me. “apps_and_websites_off_of_facebook” seems to be surveillance capitalism in action.

A thread I need to follow up on is what the IndieWeb kids call POSSE: Publish (on your) Own Site, Syndicate Elsewhere. Make it so you own a copy of all the data as you create it. It makes a lot of sense, Cory Doctorow has written about how he does that. It’s a lot of work.

I spent some time today pulling backups for data of all the sites I could think to check. I’ll update this list as I discover more. It’d be awesome to automate refreshing these backups every month or three but given all the security and performance issues that seems difficult.

2856    ./pinboard
56696   ./23andme
601960  ./twitter
4524    ./metafilter
5772    ./feedly
744212  ./facebook
316     ./goodreads
24      ./letterboxd
1356    ./wordpress
8       ./reddit
4       ./google
8       ./yelp
8       ./amazon

Linux spinning drive failure

My backup disk on my Linux box failed.

[    6.006233] kernel: sd 1:0:0:0: [sdb] tag#26 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[    6.006302] kernel: sd 1:0:0:0: [sdb] tag#26 Sense Key : Medium Error [current]
[    6.006358] kernel: sd 1:0:0:0: [sdb] tag#26 Add. Sense: Unrecovered read error - auto reallocate failed
[    6.006428] kernel: sd 1:0:0:0: [sdb] tag#26 CDB: Read(10) 28 00 00 00 0b b8 00 00 08 00
[    6.006496] kernel: blk_update_request: I/O error, dev sdb, sector 3000 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[    6.006568] kernel: Buffer I/O error on dev sdb1, logical block 119, async page read

That’s read errors, I think during fsck. I think it can’t read anything at all; badblocks just returns a list of integers from 1 to whenever I hit Ctrl-C. Higher level tools complain they can’t find a superblock, so that’s bad. Fortunately it’s just a backup volume so I don’t need to read the data off of it.

It’s a 2TB Western Digital Drive I bought back in 2015, six+ years is not too bad. (Confused it shows only 31313 hours = 3.5 years of power on time). I didn’t notice it failing; the errors from the backup script were going to root mail which I never read. Also I don’t have proper SMART alerting. Oops.

I’m replacing it with a WD Red Plus drive, 4TB. Spinning drives are basically a dead end product category. Except for server storage, so now there’s a lot of marketing around these “NAS drives”. The Seagate Ironwolf brand also gets recommended for NAS storage but Seagate drives tend to be noisier so I stuck with WD.

In theory drives will map around a few bad blocks but Linux has a long-standing thing where this process doesn’t (always?) happen automatically and I’ve never found a good tool to force it. There’s some instructions in a FAQ somewhere for an elaborate procedure of mapping that “logical block” to a physical sector on the disk and forcing a write to the sector, which causes a remap. But it’s scary. Meanwhile you already know the disc is beginning to fail; is it really worth trying to recover it? If you need the data ddrescue is probably the safer bet.

vs.code: playing well with others

I very much like my idiosyncratic coding setup with proportional fonts and automatic code formatting in VS.Code. But it doesn’t play well with others. Every time I save a file it completely reformats it in my preferred way. Not popular at pull request parties.

Making per-workspace settings that are more collaboration friendly is very easy thanks to VS.Code’s flexible settings. It basically boils down to creating a .vscode/settings.json file in the project workspace with a few settings to override the weird ones I have. By far the most important is “format on save”; the others just make my display fixed width like most people’s so I see what they’re seeing. Here’s the overrides I have in my workspace settings:

{
        "editor.fontFamily": "Consolas",
        "editor.letterSpacing": 0.0,
        "editor.tabSize": 4,
        "editor.formatOnSave": false,
}