Skip to content

Instantly share code, notes, and snippets.

openpgp4fpr:43C08ECE1FD57DD65B9DACC8F5ACED06EF3EE450

@jdeluyck
jdeluyck / scaling_mastodon_down.md
Created November 20, 2022 12:27 — forked from nolanlawson/scaling_mastodon_down.md
Scaling Mastodon down

Scaling Mastodon down

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.

@jdeluyck
jdeluyck / ssh-agent-shutdown.sh
Created May 17, 2022 16:43 — forked from x-drum/ssh-agent-shutdown.sh
ssh-agent: Archlinux plasma 5
#!/bin/sh
## place in ~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh
## exec order: "kde shutdown"
$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)"
@jdeluyck
jdeluyck / mysql-container-vm-backup.sh
Created December 27, 2021 15:02
Script to download a mysql/mariadb backup from a container running in a VM on Proxmox
#!/bin/bash
VM_ID=<VM_ID>
NODE_NAME=<node-name>
RETENTION=30
VM_DIR=/var/tmp
DIR=/backupdir
declare -A CONTAINERS
@jdeluyck
jdeluyck / gist:cafb5fff57a823639b3bdb0a8a6b667d
Created July 9, 2020 18:44
Script to decrypt Home Assistant encrypted SecureTar snapshots.
#!/usr/bin/env python3
import sys
import getopt
import hashlib
import tarfile
import glob
import os
import shutil
@jdeluyck
jdeluyck / dl.py
Created June 27, 2020 17:09
Quick and dirty script to download video files from teachable that youtube-dl flakes out on (for now)
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)
@jdeluyck
jdeluyck / README.md
Created March 28, 2020 16:09 — forked from yvh/README.md
English language locale for Belgium (Ubuntu, Debian, ...)

English language locale for Belgium on Ubuntu, Debian and others linux systems

sudo cp en_BE /usr/share/i18n/locales/en_BE
sudo localedef -i en_BE -c -f UTF-8 en_BE
echo "en_BE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
sudo locale-gen