Skip to content

Instantly share code, notes, and snippets.

View Reiner030's full-sized avatar

Reiner Keller Reiner030

  • Berlin, Germany
  • 17:58 (UTC +02:00)
View GitHub Profile
@Reiner030
Reiner030 / acme_reorder_sorted_certificate_tasks.sh
Last active September 15, 2025 09:12
OPNSense ACME plugin tool to reorder within /conf/config.xml all (or by UUID defined) certificate(s) with their action tasks + backup
#!/bin/sh
# POSIX /bin/sh – OPNsense kompatibel
# Sortiert <restartActions> stabil: Copy-* → Sent-* → Reload-* → Restart-*
# und sortiert JEDE Gruppe alphabetisch nach Action-Name.
# Usage:
# ./sort_acme_restart_actions_posix.sh # anwenden
# ./sort_acme_restart_actions_posix.sh -n # Dry-Run
# CERT_UUID=<uuid> ./sort_acme_restart_actions_posix.sh # nur dieses Zertifikat
# vorsichtig sein, wenn gerade acme.sh läuft
@Reiner030
Reiner030 / acme_show_certificate_orders.sh
Created September 15, 2025 08:45
OPNSense ACME plugin check within /conf/config.xml by listing all certificates with their action tasks
#!/bin/sh
CFG="/conf/config.xml"
for cuuid in $(xmllint --xpath "//AcmeClient/certificates/certificate/@uuid" "$CFG" \
| sed 's/uuid="/\n/g' | sed 's/"//g' | awk NF); do
csv=$(xmllint --xpath "string(//AcmeClient/certificates/certificate[@uuid='$cuuid']/restartActions)" "$CFG" 2>/dev/null)
[ -z "$csv" ] && continue
echo "Certificate $cuuid:"
OLDIFS=$IFS
@Reiner030
Reiner030 / GeoIP-for-iptables-update.sh
Created April 26, 2019 09:31
Improved combined script of https://github.com/mschmitt/GeoLite2xtables for updating Lite and commercial GeoIP2 databases
#/bin/bash
# Lite Access:
# AccountID 0
# LicenseKey 000000000000
# EditionIDs GeoLite2-Country GeoLite2-City
# Licensed Access:
# AccountID 12345
# LicenseKey abcdefghijkl
cat /etc/cron.daily/wordpress
#!/bin/sh
set -e
WWW_USER="www-data"
WWW_PATH="/var/www"
WPCLI_UPDATE=`wp cli check-update --allow-root 2>/dev/null \
| grep -v "Success: WP-CLI is at the latest version." | wc -l`
@Reiner030
Reiner030 / Vagrantfile
Last active August 29, 2015 14:07
Virtualbox + Vagrant Test Setup for ReaR
# -*- mode: ruby -*-
# vi: set ft=ruby :
## to use this Vagrantfile you need:
## Virtualbox: http://www.virtualbox.org
## Vagrant: http://www.vagrantup.com
## and if you need cleanup scripts for e.g. additional external destroy
## functionality ( https://github.com/emyl/vagrant-triggers ) run:
# vagrant plugin install vagrant-triggers
@Reiner030
Reiner030 / strace-output working-rear-duply-test
Created October 14, 2014 16:35
running duply rear-test status => sorted output
RESCUE puppet-optimus:~ # sed -e 's/^.*open("\([^"]*\)".*/\1/' strace-working.out | sort -u
/bin/duplicity
/bin/duply
/bin/which
/dev/null
/dev/tty
/dev/urandom
/etc/duply/rear-test/.
/etc/duply/rear-test/conf
/etc/group
@Reiner030
Reiner030 / strace-output rear-duply-test
Last active August 29, 2015 14:07
strace -Ff -e open duply rear-test status 2>&1 |grep -v '= -1'|grep -i open|grep -v "open resumed" > strace.out
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/x86_64-linux-gnu/libtinfo.so.5", O_RDONLY) = 3
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
open("/proc/meminfo", O_RDONLY) = 3
open("/bin/duply", O_RDONLY) = 3
[pid 2396] open("/etc/ld.so.cache", O_RDONLY) = 3