Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
I may be slow to respond.

Christian killerbees19

🐢
I may be slow to respond.
View GitHub Profile
@killerbees19
killerbees19 / OpenWrt-Backup.md
Last active Jan 10, 2022
OpenWrt Backup Automation
View OpenWrt-Backup.md

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 Dec 24, 2021
Improved scrubbing for TrueNAS
View TrueNAS-iSCRUB.md

Improved SCRUB handling at TrueNAS (12.0-U7)

Tunables

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

Init/Shutdown Scripts

  • Type: Script
  • Script: .../zpool-scrub-resume
  • When: Post Init
@killerbees19
killerbees19 / smart-selective-test.sh
Created Dec 21, 2021
TrueNAS: Weekly selective S.M.A.R.T. test of 1/4 of all LBAs on all HDDs
View smart-selective-test.sh
#!/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 Dec 16, 2021 — forked from MeganerdNL/zfs_health.sh
ZFS health checker script from calomel.org, adapted to work on Debian 10 (based) systems (e.g. newer versions of Ubuntu).
View zfs_health.sh
#! /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 Dec 2, 2021
Let's Encrypt (via getssl) for Synology DSM 6.2
View getssl-dsm62.md

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 Dec 2, 2021 — forked from catchdave/replace_synology_ssl_certs.sh
CLI script to programmatically replace SSL certs on Synology NAS
View replace_synology_ssl_certs.sh
#!/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 Oct 25, 2021
Munin plugin to monitor Nginx HTTP protocols
View logrotate.conf
/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 Jul 8, 2021
Thunderbird 68 folder pane icons for Thunderbird 78
View userChrome.css
/***********************************************************************
*
* THUNDERBIRD 68 FOLDER PANE ICONS FOR THUNDERBIRD 78
* 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
@killerbees19
killerbees19 / README.md
Last active Jun 30, 2021
munin-node-sim @ TrueNAS
View README.md
@killerbees19
killerbees19 / truenas-recursive-md5sum-check.sh
Created Jun 23, 2021
Replacement for: md5sum --quiet -c example.md5
View truenas-recursive-md5sum-check.sh
find /path/to/dir{,s} -type f -name '*.md5' -execdir \
bash -c '\
cd "$(dirname "$0")" && \
while IFS= read -r line; \
do \
md5=$(cut -b 1-32 <<< "$line"); \
file=$(cut -b 35- <<< "$line"); \
\
md5 -c "$md5" "$file" &>/dev/null; \
\