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 / Mastodon-Debian.md
Last active August 16, 2025 20:04
Mastodon @ Debian (with OpenSearch & LibreTranslate)
@killerbees19
killerbees19 / 75-usbcopy.rules
Last active April 23, 2025 20:30
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 November 7, 2024 16:17
TrueNAS CORE: Weekly selective S.M.A.R.T. test of 1/4 of all LBAs on all HDDs
#!/bin/sh
status=0
if [ "$#" -lt 1 ]
then
week=$((($(date +%-d) + 6) / 7))
else
week=$1
fi
@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
@killerbees19
killerbees19 / getssl-dsm62.md
Last active December 2, 2021 23:01
Let's Encrypt (via getssl) for Synology DSM 6.2

Compatibility

☑ DSM 6.2.4-25556 (Update 2)

Installation

ssh <USER>@diskstation (anyone from administrators group!)

sudo mkdir -p ~/.ssl/queue

sudo chown root:users ~/.ssl
@killerbees19
killerbees19 / replace_synology_ssl_certs.sh
Created December 2, 2021 20:42 — forked from catchdave/replace_synology_ssl_certs.sh
CLI script to programmatically replace SSL certs on Synology NAS
#!/bin/sh
# How to use this script:
# 1. Get your 3 PEM files ready to copy over from your local machine/update server (privkey.pem, fullchain.pem, cert.pem)
# and put into a directory (this will be $CERT_DIRECTORY).
# 2. Ensure you have a user setup on synology that has ssh access (and ssh access is setup).
# This user will need to be able to sudo as root (i.e. add this line to sudoers, <USER> is the user you create):
# <USER> ALL=(ALL) NOPASSWD: /var/services/homes/<USER>/replace_certs.sh
# 3. Call this script as follows:
# sudo scp ${CERT_DIRECTORY}/{privkey,fullchain,cert}.pem $USER@$SYNOLOGY_SERVER:/tmp/ \
# && sudo scp replace_synology_ssl_certs.sh $USER@$SYNOLOGY_SERVER:~/ \
@killerbees19
killerbees19 / logrotate.conf
Created October 25, 2021 19:50
Munin plugin to monitor Nginx HTTP protocols
/var/log/nginx/misc/protocol.log {
daily
missingok
rotate 0
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
@killerbees19
killerbees19 / userChrome.css
Last active January 23, 2022 01:24
Thunderbird 68 folder pane icons for Thunderbird 91
/***********************************************************************
*
* THUNDERBIRD 68 FOLDER PANE ICONS FOR THUNDERBIRD 91
* https://gist.github.com/200326b3228bfdc45e2830df9557d624
*
* Save this file as ~/.thunderbird/*.default/chrome/userChrome.css
* and set toolkit.legacyUserProfileCustomizations.stylesheets=true!
*
* Credits for CSS: Code snippet from EDV-Oldie @ thunderbird-mail.de
* https://thunderbird-mail.de/forum/thread/84727?postID=462266#post462266