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
proxy_cache_path /var/cache/nginx/snac_cache levels=1:2 keys_zone=snac:10m max_size=1g inactive=1440m use_temp_path=off; | |
upstream backend { | |
server localhost:8001 fail_timeout=0; | |
} | |
server | |
{ | |
server_name YOUR-DOMAIN; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; |
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 | |
# | |
# A little Mastodon hygeine. Keeping the storage nice and tidy. | |
# Get to where the script needs to go | |
cd /home/mastodon/live/bin | |
# Clean out accounts that have never interacted with anyone on this instance. | |
RAILS_ENV=production /home/mastodon/live/bin/tootctl accounts prune |
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
cache/media_attachments/ | |
cache/preview_cards/ | |
cache/custom_emojis/ | |
cache/accounts/ |
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 | |
sudo -u postgres pg_dump -Fc mastodon_production -Z 9 -f /home/mastodon/db/mastodon.`date +%d`.dump | |
rclone sync /home/mastodon/live/.env.production s3bucket:path/conf/mastodon/ | |
rclone sync /etc/nginx/sites-available/mastodon s3bucket:path/conf/nginx/ | |
rclone sync /home/mastodon/live/public/system/ s3bucket:path/system --exclude-from=/backups/bin/excludes.txt | |
rclone sync /home/mastodon/db s3bucket:path/db |
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 | |
sudo -u postgres pg_dump -Fc mastodon_production -Z 9 -f /opt/db/mastodon.`date +%d-%H`.dump | |
# Sync It Offsite | |
rclone sync /home/mastodon/live/.env.production bucket:conf/mastodon/ | |
rclone sync /etc/nginx/sites-available/mastodon bucket:conf/nginx/ | |
rclone sync /home/mastodon/live/public/system/ bucket:system --exclude-from=/opt/backup/excludes.txt | |
rclone sync /opt/db bucket:db |
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
curl -s https://orangebunny.net/api/v1/instance | jq ".stats | [.user_count, .status_count, .domain_count] | @csv" |
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 | |
date "+%m/%d/%Y,"| tr -d '\n' >> ~/mastodon-stats.txt && (curl -s https://orangebunny.net/api/v1/instance | jq ".stats | [.user_count, .status_count, .domain_count] | @csv" | tr -d '\"') >> ~/mastodon-stats.txt |
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/env python3 | |
import yaml | |
from yaml.loader import SafeLoader | |
import pprint | |
DELIMITER = "---\n" | |
filename = "infinite.md" | |
_, yaml_text, _ = open(filename).read().split(DELIMITER, maxsplit=2) | |
data = yaml.load_all(yaml_text, Loader=SafeLoader) |
NewerOlder