Skip to content

Instantly share code, notes, and snippets.

@psct
psct / wgstrap.sh
Last active May 27, 2022 06:17
WireGuard-Server per Skript einrichten
#!/bin/bash
# Wireguard auf Debian/Raspbian einrichten,
# nach c't 15/2019, S. 166
# * läuft auf Raspbian oder Debian Netinst (Buster)
# * bitte nur auf frischen Installationen verwenden
# * Skript überschreibt Netzwerkkonfiguration
# * als pi (Raspbian) oder als root/passwortloses sudo (Debian) ausführen
# * schreibt Protokoll nach /var/log/wgstrap.log
# * zweistufiger Prozess, der einen Reboot erfordert
@psct
psct / debansstrap.sh
Created February 26, 2021 16:33
Prepare fresh Debian for ansible management by created user "ansible" in sudoers (needs public ssh-Key in PUBKEY)
#!/bin/bash
# enable host for ansible
set -e
PUBKEY=""
id -u ansible > /dev/null 2>&1 || \
adduser ansible --disabled-password \
--gecos "" --quiet
mkdir -p /home/ansible/.ssh
echo "$PUBKEY" \
> /home/ansible/.ssh/authorized_keys
@psct
psct / init.cfg
Created August 15, 2019 20:45
Konfigurationsdatei für darkstat: /etc/darkstat/init.cfg
# Turn this to yes when you have configured the options below.
START_DARKSTAT=yes
# Don't forget to read the man page.
# You must set this option, else darkstat may not listen to
# the interface you want
INTERFACE="-i wg0"
DIR="/var/lib/darkstat"
@psct
psct / traefikbyhand.sh
Created August 18, 2021 17:29
example to run traefik in standalone mode (not within docker)
#!/bin/bash
#
# example to run traefik in standalone mode on a
# linux host (or any other host supported by traefik)
#
# contribution to an article in
# c't magazine 19/21, Page 74
#
# your work:
# - share port 80/443 by your router to this host