Skip to content

Instantly share code, notes, and snippets.

View PhrozenByte's full-sized avatar

Daniel Rudolf PhrozenByte

View GitHub Profile
@PhrozenByte
PhrozenByte / all-inkl.md
Last active February 6, 2024 07:47
Dokumentation der Statistikoptionen von (Sub-)Domains bei all-inkl.com

all-inkl.com Access Logs & Webalizer

Leider ist die Dokumentation der verschiedenen Statistikoptionen bei all-inkl.com ziemlich unvollständig und der Tooltip im KAS wenig hilfreich. Insbesondere welchen Einfluss die verschiedenen Optionen auf die Access Logs nehmen ist komplett undokumentiert. Der Einfluss auf die Access Logs ist dabei aber wichtig um zu verstehen welche Zugriffe in den Webalizer-Statistiken erfasst werden.

Access Logs

  • Logs A: Zugriffe werden in logs/access_log_[Datum].gz des Rootverzeichnisses geloggt.
  • Logs B: Zugriffe werden in logs/access_log_[Datum].gz des Domainpfades geloggt.
@PhrozenByte
PhrozenByte / rdiff-backup-to-borg.sh
Created January 15, 2023 15:01
Converts rdiff-backup backups to Borg Backup.
#!/bin/bash
# rdiff-backup-to-borg
# Converts rdiff-backup backups to Borg Backup
#
# This script was created to ease switching from `rdiff-backup` to `borg`. It
# restores all increments of a rdiff-backup repository and backs it up using
# Borg Backup.
#
# More info about Borg Backup: <https://borgbackup.readthedocs.io>
# More info about rdiff-backup: <https://rdiff-backup.net/>
@PhrozenByte
PhrozenByte / xbrightness
Created March 30, 2019 14:44
Zenity dialog to set screen brightness using xrandr
#!/bin/bash
export LC_ALL=C
readarray -t SCREENS < <(xrandr --listmonitors | grep "^ [0-9]\+: " | cut -d ' ' -f 6)
[[ ${#SCREENS[@]} > 0 ]] || exit 1
CURBRIGHT="$(xrandr --current --verbose | awk 'on { if ($0 ~ /^\tBrightness: /) { print $2 } else if ($0 ~ /^\t/) { next } exit } /^[[:graph:]]+ connected primary/ { on=1 }')"
[ -n "$CURBRIGHT" ] && CURBRIGHT="$(bc 2> /dev/null <<< "scale=0; ($CURBRIGHT * 100)/1")" || CURBRIGHT=100
function setbright {
@PhrozenByte
PhrozenByte / btrfs-snapshot-run.sh
Last active September 29, 2023 21:02
Creates snapshots of a btrfs filesytem and runs a given command.
#!/bin/bash
# btrfs-snapshot-run
# Creates snapshots of a btrfs filesytem and runs a given command
#
# This script was created to ease backing up a btrfs filesystem. It expects
# Snapper's subvolume layout, with subvolumes directly below in the hierarchy
# of the top level subvolume (ID 5), all prefixed by '@'. Other subvolumes are
# being ignored.
#
# This script will create readonly snapshots for either all, or the provided
@PhrozenByte
PhrozenByte / systemd-calendar-run.sh
Last active July 6, 2023 15:40
Runs a command if a Systemd calendar specification is due.
#!/bin/bash
# systemd-calendar-run.sh
# Runs a command if a Systemd calendar specification is due
#
# This script checks whether a given Systemd calendar specification (pass the
# '--on-calendar SPEC' option) relative to either the current, or a given time
# (pass the '--base-time TIMESTAMP' option) yields a past elapse time and runs
# the given command (pass as arguments: 'COMMAND [ARGUMENT]'). Otherwise the
# script exits with return code 254. When an invalid option is given, the
# script exits with return code 255.
@PhrozenByte
PhrozenByte / # hetzner-snapshot.md
Last active May 14, 2022 21:50
Shell script to create a snapshot of a Hetzner CX line virtual server

hetzner-snapshot

Shell script to create a snapshot of a Hetzner CX line virtual server.

Install

# script
@PhrozenByte
PhrozenByte / # letsencrypt.md
Last active May 10, 2022 13:31
Simple wrapper scripts for acme-tiny to issue and renew Let's Encrypt SSL certificates -- MOVED TO https://github.com/PhrozenByte/acme
@PhrozenByte
PhrozenByte / munin-plugin.statefile-helper
Last active April 7, 2022 20:05
Munin statefile support functions for munin shell plugins
# -*- sh -*-
# Munin statefile support functions for munin shell plugins
#
: << =cut
=head1 NAME
plugin-statefile.sh - Munin statefile support functions for munin shell plugins
=head1 AUTHOR
@PhrozenByte
PhrozenByte / munin-plugin.openvpn_
Last active April 6, 2022 23:46
Munin plugin for OpenVPN
#!/usr/bin/env php
<?php
/**
* OpenVPN munin plugin
* Version 1.4 (build 20160206)
*
* SHORT DESCRIPTION:
* Monitors the number of connected OpenVPN clients and their bandwidth
* usage (server mode) or the payload and raw bandwidth usage of a client.
*
@PhrozenByte
PhrozenByte / systemd-wait-unit-active.sh
Created November 26, 2021 21:56
Waits until a systemd system or user unit is active.
#!/bin/bash
# systemd-wait-unit-active.sh
# Waits until a systemd system or user unit is active.
#
# Notice: When using this script with user units you must ensure that `sudo`
# can call `systemctl` proberly. This often fails due to `systemctl` not
# finding the user's D-Bus socket. Ensure that the user runs a D-Bus daemon
# and that the '$XDG_RUNTIME_DIR' environment variable is defined.
#
# Copyright (C) 2021 Daniel Rudolf (<https://www.daniel-rudolf.de>)