A Mastodon backup script

2022-11-12 19:42:32 - by AlisonW Hacks Software

It's always good practice to backup your services, both automatically (eg /etc/crontab) or on an ad-hoc basis. Preferably both. This is a simple script for a Mastodon instance.

if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root"
exit 1

mv /wkspc/mastodonbackup/ /wkspc/mastodonbackup-1/

mkdir /wkspc/mastodonbackup/
mkdir /wkspc/mastodonbackup/env/
mkdir /wkspc/mastodonbackup/redis/
mkdir /wkspc/mastodonbackup/system/
mkdir /wkspc/mastodonbackup/system/accounts/
mkdir /wkspc/mastodonbackup/system/custom_emojis/
mkdir /wkspc/mastodonbackup/system/media_attachments/
mkdir /wkspc/mastodonbackup/system/site_uploads/
mkdir /wkspc/mastodonbackup/postgres/

chown postgres:postgres -R /wkspc/mastodonbackup/postgres/
runuser - postgres -c 'pg_dumpall -f /wkspc/mastodonbackup/postgres/pg_dump'

cp -R /home/mastodon/live/.env.* /wkspc/mastodonbackup/env/
cp /var/lib/redis/dump.rdb /wkspc/mastodonbackup/redis/
chmod 644 /wkspc/mastodonbackup/redis/dump.rdb
cp -R /home/mastodon/live/public/system/accounts/ /wkspc/mastodonbackup/system/accounts/
cp -R /home/mastodon/live/public/system/custom_emojis/ /wkspc/mastodonbackup/system/custom_emojis/
cp -R /home/mastodon/live/public/system/media_attachments/ /wkspc/mastodonbackup/system/media_attachments/
cp -R /home/mastodon/live/public/system/site_uploads/ /wkspc/mastodonbackup/system/site_uploads/

echo "Mastodon Backup completed."

A Member of the Federation

2022-11-06 23:22:53 - by AlisonW Tech News People

Whether it is Star Trek, Blakes 7, Star Wars, or somewhere else, "The Federation" is a thing to be acknowledged, and maybe respected too. In this case though I'm referring to the Mastodon network, where many people are signing up as a Social Media site which isn't Twitter but is similar.

I'm running an instance myself, in part to learn, in part because data protection and privacy rules matter. The data is protected by being on hardware which I have direct personal and physical control over, and not off in someone else's datacentre.

This doesn't mean I'm _leaving_ Twitter immediately, but I'll be massively cutting down there and replacing my 'tweets' with 'toots'. To add me I'm at @AlisonW@fedimon.uk - hope to see you soon!

Long time...

2022-08-23 14:56:09 - by AlisonW Open Chyrp Coding Corvd Known Software

...no use. This is my personal playground and, until a recent OS upgrade at the weekend, I was running an installation of "Known" (and before that a heavily modified "Chyrp") But then PHP8.1 came along and screwed me up enough to dust off the software I had been working on and sort out it's issues. Which I mostly have.

This site will, as always, be available at my personal whim. "Age of the geek, baby"

Coffee time

2022-08-11 11:03:42 - by AlisonW Personal Coffee

I drink coffee every morning, usually a couple of double espressos made using my Rocket machine. But the price of coffee beans has been creeping up and I've been trying to decide whether buying 'green' (unroasted) beans in bulk and roasting them myself might make financial sense. So whilst having a nice soak in a bubble bath this afternoon I tried running the maths in my head.

Two+ doubles per day = 750 cups per year.
Each cup uses about 20g of beans, so I'm using roughly 15kg of roasted beans per year.

I currently pay £5.40 per kilo of my usual† coffee, so £231 per year (or 31p per cup). Buying green would be about £11 per kilo for a 10kg bag. Losing maybe 5% on roasting would make that £11.55 per kilo, a saving of £3.85 per kilo, ignoring the cost of roasting.

I've roasted my own in the past using a converted popcorn maker but it only does 100g at a time. I'd need a larger roaster really. The Sandbox R1‡ would be great, but it's around £700 including the cooler. That's equivalent to 182 kilos roasted, or a smidgen over twelve years of morning espressos.

Sadly, this isn't going to be viable, is it :-(

† https://www.waitrose.com/ecom/products/waitrose-colombian-coffee-beans/074908-37996-37997
‡ https://www.bellabarista.co.uk/sandbox-smart-roaster-black.html

In brief …

SARS-CoVID2 Vaccinations I'm seeing tweets and posts about there already being a vaccination against the new pandemic but that they…

Choosing your candidate It does not matter how much you like or prefer one candidate over another if they aren't electable…

EMF Camp 2020 This evening was the first of the three ticket scrambles for this year's EMF camp.…

Dead links Because I'm currently in a redevelopment phase here, moving code between domains and services, I can see from…