Skip to content

Instantly share code, notes, and snippets.

View stemid's full-sized avatar

Stefan Midjich stemid

View GitHub Profile
@stemid
stemid / compress.sh
Last active December 22, 2016 13:31
Recursively compress files with xz using multiple threads
# With Bash 4.3 I'd rather use wait -n to keep N
# processes running at all times. As it is now you
# unfortunately have to wait for the last process
# to finish.
# Recursively compress all files in $dir
compress () {
dir=$1
count=${2:-2}
num_procs=${3:-0}
#!/usr/bin/env bash
# {{ ansible_managed }}
# vim: set filetype=bash
#
# WARNING: Have you run xtrabackup_prepare.sh first?
# WARNING: You must know what you're doing or the backup will be ruined!
shopt -s nullglob
backup_dir=/var/backups/xtrabackup

Keybase proof

I hereby claim:

  • I am stemid on github.
  • I am stemid (https://keybase.io/stemid) on keybase.
  • I have a public key ASD1nmKQzW0A_OGRdxfATEZL8ZAy55k5LulsWPfC2Iz2cAo

To claim this, I am signing this object:

@stemid
stemid / siptrack.py
Last active July 11, 2019 15:12
Ansible inventory script for Siptrack (https://github.com/sii/siptrackweb)
#!/usr/bin/env python
# Siptrack dynamic inventory script for Ansible.
# Depends on siptracklib
# * https://github.com/sii/siptracklib
#
#http://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html
#
# by Stefan Midjich <swehack at gmail dot com>
@stemid
stemid / defaults.cfg
Last active June 7, 2018 11:38
Boilerplate logging class I use in most my applications
# AppLogger specific config.
[logging]
log_format = %(asctime)s %(name)s[%(process)s] %(levelname)s: %(message)s
log_debug = True
log_level = INFO
# Handler can be one of file, stdout or syslog
log_handler = stdout
# Can use this to log directly to another server if need be
@stemid
stemid / make_backup.sh
Created June 25, 2018 12:30
Backup script for my personal laptop
#!/usr/bin/env bash
# Simple backup script for borg. http://borgbackup.readthedocs.io/en/stable/
# Install on Fedora: sudo dnf install borgbackup
#
# Configure BORG_REPO below to match some path on your own system. In my case
# it points to an autofs mount on my network backup device.
# Configure your own borg_excludes.
# by Stefan Midjich <swehack at gmail dot com>
export BORG_REPO="/media/nas/backups/$(hostname -s)-borgbackup"