Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Schmidl schtobia

View GitHub Profile
@schtobia
schtobia / quasselweb
Last active Aug 2, 2016
quasselweb init script
View quasselweb
#! /bin/bash
### BEGIN INIT INFO
# Provides: quasselweb
# Required-Start: quasselcore
# Required-Stop: quasselcore
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: distributed IRC client using a central core component
@schtobia
schtobia / tinytinyrss.init.sh
Last active Aug 2, 2016
Init script for TinyTinyRSS
View tinytinyrss.init.sh
### BEGIN INIT INFO
# Provides: tinytinyrss
# Required-Start: $network postgresql
# Required-Stop: $network postgresql
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: TinyTinyRSS update daemon
### END INIT INFO
@schtobia
schtobia / upgrade.sh
Last active Aug 29, 2015
ESXi upgrade script
View upgrade.sh
#! /bin/sh
# open firewall for outgoing http requests:
esxcli network firewall ruleset set -e true -r httpClient
#shutting down VMs
allVMs=$(esxcli vm process list | sed -n 's/^[[:space:]][[:space:]]*World ID\: \([0-9][0-9]*\)$/\1/p');
if [ -n "${allVMs}" ];
then
for currentVM in $allVMs;
do
@schtobia
schtobia / _Thinkpad-conf.md
Last active Aug 29, 2015
Configuration for Thinkpad Edge E145
View _Thinkpad-conf.md

These files should be put in /etc/modprobe.d/.

View keybase.md

Keybase proof

I hereby claim:

  • I am schtobia on github.
  • I am schtobia (https://keybase.io/schtobia) on keybase.
  • I have a public key whose fingerprint is BA97 2630 7B2C C314 33AE F496 6BA9 A5C0 5D01 15D2

To claim this, I am signing this object:

@schtobia
schtobia / nginx_client_cn_auth.conf
Last active Oct 3, 2021
CN-based client authentification with nginx. This emulates Apache's SSLRequire (%{SSL_CLIENT_S_DN_CN} in {"Really Me"})
View nginx_client_cn_auth.conf
map $ssl_client_s_dn $ssl_client_s_dn_cn {
default "";
~/CN=(?<CN>[^/]+) $CN;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
@schtobia
schtobia / clean.cmd
Created Jul 10, 2015
shutdown script for a virtualized Windows 7
View clean.cmd
@echo off
set UD_IN_FILTER=windows;winnt
set UD_EX_FILTER=temp;recycle;system volume information;ntuser;pagefile;hiberfil
set UD_DISABLE_REPORTS=1
udefrag %SYSTEMDRIVE%
"%ProgramFiles(x86)%\Sysinternals\sdelete.exe" -c %SYSTEMDRIVE%
"%ProgramFiles(x86)%\Sysinternals\sdelete.exe" -z %SYSTEMDRIVE%
shutdown /s /f /t 0
@schtobia
schtobia / tschroot
Last active Apr 29, 2020
Mount /tmp, /dev/pts, /dev/shm and /proc into chroot and change into chroot
View tschroot
#! /bin/sh
[ ! -d "$1" ] && echo "$1 is not a valid directory." && exit 1;
trap "umount \"${1}\"/tmp \"${1}\"/dev/null \"${1}\"/dev/pts \"${1}\"/dev/random \"${1}\"/dev/shm \"${1}\"/dev/urandom \"${1}\"/proc" EXIT INT TERM HUP PIPE &&
mount --bind /tmp "${1}/tmp" && \
mount --bind /dev/null "${1}/dev/null" && \
mount --bind /dev/pts "${1}/dev/pts" && \
mount --bind /dev/random "${1}/dev/random" && \
mount --bind /dev/shm "${1}/dev/shm" && \
mount --bind /dev/urandom "${1}/dev/urandom" && \
mount --bind /proc "${1}/proc" && \
@schtobia
schtobia / debian-package-priorities.pref
Last active May 28, 2018
Pin the priority of packages from different debian versions
View debian-package-priorities.pref
Package: *
Pin: release l=Debian-Security
Pin-Priority: 1000
Package: *
Pin: release a=testing
Pin-Priority: 475
Package: *
Pin: release a=unstable
@schtobia
schtobia / kill-zombies.sh
Last active Aug 1, 2016
Kill all zombies, with increasing vigor
View kill-zombies.sh
#! /bin/sh
for current_signal in HUP TERM KILL SEGV;
do
ZOMBIES=$(ps -A -ostat,ppid | sed -rn 's/^[zZ][^[:space:]]*[[:space:]]*([0-9]+)/\1/p' | sort -nu);
[ -n "$ZOMBIES" ] && { kill -s $current_signal $ZOMBIES; sleep 2; } || true;
done