Skip to content

Instantly share code, notes, and snippets.

View zzf01's full-sized avatar

Andreas Rizzi zzf01

  • fnxs
View GitHub Profile
@zzf01
zzf01 / ufw-notes
Created January 21, 2026 14:44
ufw firewall um kommentare ergänzen
#!/usr/bin/env bash
set -euo pipefail
COMMENTS_FILE="${COMMENTS_FILE:-/etc/ufw/rule-comments.tsv}"
usage() {
echo "Usage:"
echo " $0 # explain (default)"
echo " $0 explain # show ufw rules with stored comments"
echo " $0 comment # ask for comments for each current ufw rule"
@zzf01
zzf01 / bashrc-enhancer.sh
Last active September 5, 2025 07:48
enhanced .bashrc
#!/usr/bin/env bash
set -euo pipefail
BASHRC="${HOME}/.bashrc"
BASH_ALIASES="${HOME}/.bash_aliases"
PROFILE="${HOME}/.profile"
LSC_DIR="${HOME}/.lscolors"
LSC_SCRIPT="${LSC_DIR}/lscolors.sh"
LSC_URL="https://raw.githubusercontent.com/ahmadassaf/dircolors/refs/heads/master/lscolors.sh"
@zzf01
zzf01 / mariadb_restore.sh
Created August 3, 2025 15:33
mariadb-backup restore
#!/bin/bash
BACKUP_BASE="$1"
TARGET_INC_FILE="$2"
if [ ! -d "$BACKUP_BASE" ]; then
echo "$BACKUP_BASE is not a valid directory"
echo "Usage: $0 <backup_dir> [stop_after_incremental_file]"
exit 1
fi
@zzf01
zzf01 / mariadb_backup.sh
Created August 3, 2025 15:32
mariadb-backup backup
#!/bin/bash
# === CONFIGURATION ===
ZSTD_COMPRESSION_LEVEL=3
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <backup_dir> [full|inc]"
exit 1
fi
@zzf01
zzf01 / shopwareUpgradeHelper.sh
Last active July 28, 2023 12:07
Backup / Restore Shopware
#!/bin/bash
test -z "$1" && echo You have to define the PHP interpreter as first argument && exit 1
if [ ! -f "$1" ]; then
if [ ! -f "$(which $1)" ]; then
echo The PHP interpreter can not be found
exit 1
else
PHP=$(which $1)
fi
else
@zzf01
zzf01 / haconfig.sh
Last active June 28, 2020 16:51 — forked from jlazic/haconfig.sh
Split monolithic HAProxy configuration
#!/bin/bash
#Requirements: etckeeper, colordiff
#Script based on https://gist.github.com/jlazic/e65f5bda141ffaed5640 by Josip Lazić
#Article: https://lazic.info/josip/post/splitting-haproxy-config/
#This script concatenates multiple files of haproxy configuration into
#one file, and than checks if monolithic config contains errors. If everything is
#OK with new config script will write new config to $CURRENTCFG and reload haproxy
#Also, script will commit changes to etckeeper, if you don't use etckeeper you