Skip to content

Instantly share code, notes, and snippets.

View svenXY's full-sized avatar

Sven Hergenhahn svenXY

  • Heidelberg, Germany
View GitHub Profile
#!/bin/bash
# forked from shepmaster/trace-images.sh
# added some logic and made it cron-able (as little output as possible)
hash jq 2>/dev/null || { echo >&2 "jq is required but was not found. Please run make sure it is in the path"; exit 1;}
shopt -s nullglob
# Reset all variables that might be set
interactive=0

Keybase proof

I hereby claim:

  • I am svenXY on github.
  • I am svenxy (https://keybase.io/svenxy) on keybase.
  • I have a public key whose fingerprint is E452 94A5 A426 1CA5 B321 5A71 D1AE 3696 0DCE 97AB

To claim this, I am signing this object:

#!/usr/bin/env python
# encoding: utf-8
'''
Remove Zabbix problem mails if resolved.
This script
- recursively searches a maildir
- looks for mails with PROBLEM in the subject
- Checks if the proper OK subject exists
@svenXY
svenXY / tmux-ssh
Last active December 12, 2018 03:57 — forked from bhenderson/tmux-ssh
Start multiple synchronized SSH connections with Tmux
#!/bin/sh
hosts=""
ssh_options=""
tmux_session_name="cssh"
usage() {
echo "Usage: $0 [options] host [host ...]" >&2
echo "" >&2
echo "Spawns multiple synchronized SSH sessions or windows inside a tmux session." >&2
#!/usr/bin/env python
"""
Usage: %(scriptName)s --help -> get help
Make a backup of the nethack save file (this is cheating!)
or choose one of the already backed up savegames to restore.
Nethack must not be running while using this script!
Happy slaying,
@svenXY
svenXY / upgrade_pyenvs.zsh
Last active April 26, 2024 07:37
Quick & dirty script to migrate pyenvs from one python version to a new one (e.g. 3.11.1 to 3.12.2). Old virtualenvs are first deleted in the process!
old=$1
new=$2
if [[ -z "$old" || -z "$new" ]]; then
echo "usage upgrade_pyenvs.zsh <old_version> <new_version>"
exit 1
fi
for myenv in $(pyenv versions --bare | rg $old/envs); do
myenv=${myenv##$old/envs/}