Year: 2020

  • Mastodon PostgreSQL upgrade fun

    Howdy friends!

    If you’re a mastodon user on tilde.zone (the tildeverse mastodon instance), you might’ve noticed some downtime recently.

    Here’s a quick recap of what went down during the upgrade process.

    We run the current stable version of PostgreSQL from the postgres apt repos. PostgreSQL 13 was released recently and the apt upgrades automatically created a new cluster running 13.

    The database for mastodon has gotten quite large (about 16gb) which complicates this upgrade a bit. This was my initial plan:

    1. drop the 13 cluster created by the apt package upgrades
    2. upgrade the 12-main cluster to 13
    3. drop the 12 cluster

    These steps appeared to work fine, but closer inspection afterwards led me to discover that the new cluster had ended up with SQL_ASCII encoding somehow. This is not a situation we want to be in. Time to fix it.

    Here’s the new plan:

    1. stop mastodon:
      for i in streaming sidekiq web; do systemctl stop mastodon-$i; done
    2. dump current database state:

      pg_dump mastodon_production > db.dump

    3. drop and recreate cluster with utf8 encoding:
      pg_dropcluster 13 main --stop pg_createcluster --locale=en_US.UTF8 13 main --start
    4. restore backup:
      sudo -u postgres psql -c "create user mastodon createdb;" sudo -u mastodon createdb -E utf8 mastodon_production
      sudo -u mastodon psql < db.dump

    I’m still not 100% sure how the encoding reverted to ASCII but it seems that the locale was not correctly set while running the apt upgrades…

    If this happens to you, hopefully this helps you wade out while keeping all your data :)

  • Default git branch name

    Update:

    As of git 2.28, there’s a new configuration option and you don’t need to use the templateDir option:

    git config --global init.defaultBranch main

    Changing git’s default branch name has come up recently as an easy action we can take to update our language and remove harmful ideas from our daily usage.

    I’m concerned that this effort to change the language used is ultimately a symbolic gesture to avoid scrutiny into actual change (notably github’s push for this change and continued contracts with ICE).

    However, it’s an easy change to make.

    Let’s have a look at how to change it for new repos:

    mkdir -p ~/.config/git/template
    echo "ref: refs/head/main" > ~/.config/git/template/HEAD
    git config --global init.templateDir ~/.config/git/template

    Note that you can put this template dir anywhere you like.

    You can also set this system-wide (not just for your user) in /usr/share, but note that this might get overridden by package updates.

    echo "ref: refs/head/main" | sudo tee /usr/share/git-core/templates/HEAD

    The next time you git init, you’ll be on a branch named main.

    To change an existing repo, you can use the -m switch of git-branch:

    git checkout master
    git branch -m master main

    Push with -u to your remote if needed and update the default branch in the repo settings in the hosting platform of choice.

    It’s a relatively easy change, but don’t kid yourself that it makes any real impact. go protest, donate and sign petitions, and get out there to fix the actual problems.

  • Tools and services

    Inspired by tomasino’s recent post, I’d like to detail some of the stuff that I rent and use.

    Recurring Costs

    Some of these are monthly, others are annual

    • server rental – $135/month, 64gb model, 2yr contract discount
    • proxmox – my preferred hypervisor. I find it useful enough and worth paying the annual license to use the official package mirrors – $80/year
    • domains – includes tilde-related ones and my personal ones (about 10 or so) – about 30 domains totaling $500/year
    • offsite backups at rsync.net – I use the borg offering for a discount since versioning is handled by my backup software – between $60-$70/year

    My out of pocket expenses are a little over $2k per year.

    Note that I use the server and backups for personal stuff in addition to tilde related things.

    The current expenses are totally manageable as is, but if you’ve got some spare cash and want to pitch in towards tilde hosting costs, I have a donate page.

    Software I run, use, and maintain

    These are all free/open source.

    Operating systems

    Platforms / software

    These are things that I run and maintain for tilde.team and the tildeverse

    Our own software

    There are also a handful of other sites that we’ve written collaboratively among tildeverse peeps:

    See the tildeverse org and team org on tildegit for more projects :)

    This has diverged a bit from my costs into all the stuff that I do. I suppose that means that the main cost is my time and energy. In general, these things are hands-off in the day-to-day and only take time when there are updates or something breaks.

  • General update

    It’s been quite a long time since i posted anything here on this blog.

    I’ve been playing with gruvbox-css, decided to switch my blog to use it and finally realized it’s been almost a year since I posted anything at all.

    I don’t have anything in particular to post today so i figured it would be good to give a general update since the last time I posted.

    We’ve moved physical hosts again (/news post), which is now a VM on a large dedicated machine I rent from OVH. My current VM setup is Proxmox, which I’m quite happy with. The new box is pricier but has a lot more resources and room to grow.

    It appears that I haven’t posted anything in so long that I don’t yet have any pictures of my dog on my blog!

    I got her last may (2019) and she’s the best. She’s an English Springer Spaniel and her name is Hope.

    Otherwise, I’ve just been hanging out on IRC, so stop by and say hello :)