Skip to content

Instantly share code, notes, and snippets.

View killerbees19's full-sized avatar
🐢
I may be slow to respond.

Christian killerbees19

🐢
I may be slow to respond.
View GitHub Profile
@killerbees19
killerbees19 / getssl.cfg
Last active August 3, 2022 18:46
GetSSL certificate upload with sudo
DOMAIN_CHAIN_LOCATION="ssh:example.net:/home/yourusername/tmp.pem"
DOMAIN_KEY_LOCATION="ssh:example.net:/home/yourusername/tmp.key"
RELOAD_CMD="ssh example.net -- sudo /path/to/letsencrypt.sh"
@killerbees19
killerbees19 / PVE-Backup.md
Last active December 6, 2022 06:36
Proxmox VE (host only) backup via FTP

Tested at Proxmox VE 7.x – Debian 11 (Bullseye)

Installation

  • Save the shell script anywhere and modify BACKUP_UPLOAD path to fit your needs.
  • Create a ~/.netrc file as root and paste your FTP credentials:
machine backup-destination.example.net
login yourstupidremoteusername
password yoursecretpassword
@killerbees19
killerbees19 / TrueNAS-Backup.md
Created May 26, 2022 18:12
Backup TrueNAS config via FTP

Tested at TrueNAS CORE 12.0-U8.1 😊

Installation

  • Save the shell script anywhere and modify destination path to fit your needs.
  • Create a ~/.netrc file as root and paste your FTP credentials:
machine backup-destination.example.net
login yourstupidremoteusername
password yoursecretpassword
@killerbees19
killerbees19 / Mastodon-Debian.md
Last active August 29, 2023 12:42
Mastodon 3.5.x/4.1.x @ Debian (with OpenSearch & LibreTranslate)

MASTODON 3.5.X/4.1.x -- DEBIAN 11/12 -- LAN TEST INSTALLATION (NOT FOR PRODUCTION!)

# ln -s /usr/bin/yarnpkg /usr/local/bin/yarn
# apt install imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev \
              git-core g++ libprotobuf-dev protobuf-compiler pkg-config \
              nodejs gcc autoconf bison build-essential libssl-dev \
              libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev \
              libffi-dev libgdbm-dev nginx redis-server redis-tools \
              postgresql postgresql-contrib libidn11-dev libicu-dev \
@killerbees19
killerbees19 / 75-usbcopy.rules
Last active April 15, 2022 10:29
USBcopy for PTP/MTP devices
ACTION=="bind", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="32d2", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbcopy-canon-m50.service"
ACTION=="bind", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="019a", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbcopy-nikon-s9900.service"
#ACTION=="bind", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0123", ATTRS{idProduct}=="4567", ENV{ID_SERIAL_SHORT}=="89abcdef", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbcopy-example.service"
@killerbees19
killerbees19 / OpenWrt-Backup.md
Last active October 22, 2023 12:33
OpenWrt Backup Automation

Script to backup various other OpenWrt systems to a FTP storage.

It's not intended to run it at OpenWrt! Rather it's designed for a dedicated user account in a VM.

But feel free to adopt it to your needs…

Installation (Controller)

# Create SSH keyfile
ssh-keygen -t ed25519 -C "$USER@$HOSTNAME"
@killerbees19
killerbees19 / TrueNAS-iSCRUB.md
Last active April 15, 2022 11:07
Improved scrubbing for TrueNAS

Improved SCRUB handling at TrueNAS.

Tested at TrueNAS CORE 12.0-U7, but it should be compatible with TrueNAS SCALE too.

Tunables

Not required, but recommended: vfs.zfs.scan_legacy=1

Init/Shutdown Scripts

  • Type: Script
@killerbees19
killerbees19 / smart-selective-test.sh
Last active April 15, 2022 11:05
TrueNAS CORE: Weekly selective S.M.A.R.T. test of 1/4 of all LBAs on all HDDs
#!/bin/sh
week=$((($(date +%-d) + 6) / 7))
status=0
if [ "$week" -lt 5 ]
then
for disk in /dev/ada?
do
if [ -e "$disk" ]
then
@killerbees19
killerbees19 / zfs_health.sh
Last active December 16, 2021 08:12
ZFS health checker script from calomel.org, adapted to work on Debian 10 (based) systems (e.g. newer versions of Ubuntu).
#! /bin/sh
#
# Calomel.org
# https://calomel.org/zfs_health_check_script.html
# FreeBSD ZFS Health Check script
# zfs_health.sh @ Version 0.18.2+fnx1
# Check health of ZFS volumes and drives. On any faults send email.
### DISCLAIMER AND CHANGES