openpgp4fpr:43C08ECE1FD57DD65B9DACC8F5ACED06EF3EE450
There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.
I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable.
So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium
instance with 2 vCPUs and 4GB of RAM.) How
do you do this?
Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## place in ~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh | |
## exec order: "kde shutdown" | |
$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import getopt | |
import hashlib | |
import tarfile | |
import glob | |
import os | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VM_ID=<VM_ID> | |
NODE_NAME=<node-name> | |
RETENTION=30 | |
VM_DIR=/var/tmp | |
DIR=/backupdir | |
declare -A CONTAINERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from html.parser import HTMLParser | |
import urllib.request | |
import re | |
import argparse | |
import wget | |
regex = r"\"url\":\"(.*?.bin)\"" | |
ap = argparse.ArgumentParser("DL") | |
ap.add_argument("-v", "--video", dest="video", required=True) |