Skip to content

Instantly share code, notes, and snippets.

View tbaschak's full-sized avatar

Theo Baschak tbaschak

View GitHub Profile
16 54.214.242.0/24
15 54.197.251.0/24
15 46.229.169.0/24
15 162.243.226.0/24
14 162.243.142.0/24
13 37.187.9.0/24
12 146.185.179.0/24
10 95.85.61.0/24
10 54.84.236.0/24
10 54.213.177.0/24
@tbaschak
tbaschak / fingerprints.txt
Last active August 15, 2016 06:18
PGP fingerprints
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I may periodically update this with additional fingerprints.
PGP Keys:
pub 4096R/0x2A0E8675EF4D4F80 2016-04-24 [expires: 2017-04-24]
Key fingerprint = 8BB1 79F2 7ABB 1AFC F711 9E2A 2A0E 8675 EF4D 4F80
uid [ultimate] Theodore Baschak <theodore@ciscodude.net>
#!/bin/bash
function usage ()
{
echo "Usage:";echo " $0 <url>"
}
if [ $# -ne 1 ]; then
usage;exit 127
fi
fail2ban:
pkg:
- installed
service:
- running
- require:
- pkg: fail2ban
- watch:
- file: /etc/fail2ban/jail.local
@tbaschak
tbaschak / blockfinder-ca-asns.bash
Last active August 29, 2015 14:08
A script to run blockfinder (patched to run in cron without requiring a TTY), and then report the daily differences via email to the user running the script.
#!/bin/bash
TODAY=`date "+%Y-%m-%d"`
case $OSTYPE in
darwin*) YESTERDAY=`date -v -1d "+%Y-%m-%d"` ;;
linux*) YESTERDAY=`date --date="yesterday" "+%Y-%m-%d"` ;;
*bsd*) YESTERDAY=`date -v -1d "+%Y-%m-%d"` ;;
*) echo "unknown: $OSTYPE" ;;
esac
#!/usr/bin/env python
from netaddr import *
cidr = IPSet(['192.168.0.0/24'])
used = IPSet(['192.168.0.1','192.168.0.8/29','192.168.0.64/26'])
cidr ^ used
#IPSet(['192.168.0.0/32', '192.168.0.2/31', '192.168.0.4/30', '192.168.0.16/28', '192.168.0.32/27', '192.168.0.128/25'])
@tbaschak
tbaschak / check-couch.sh
Created November 8, 2015 21:12
a script to check that couchdb is running (from cron) and restart it if its died. It logs to /root/couchdb-restart.log so you can verify when couchdb got restarted
#!/bin/bash
ps auxw | grep couchdb | grep -v grep > /dev/null
if [ $? != 0 ]
then
DATE=`date`
/etc/init.d/couchdb start > /dev/null
echo "$DATE restarted couchdb" >> /root/couchdb-restart.log
fi

Keybase proof

I hereby claim:

  • I am tbaschak on github.
  • I am tbaschak (https://keybase.io/tbaschak) on keybase.
  • I have a public key whose fingerprint is 8BB1 79F2 7ABB 1AFC F711 9E2A 2A0E 8675 EF4D 4F80

To claim this, I am signing this object:

@tbaschak
tbaschak / check_snmp_load.pl
Created May 18, 2016 15:59
check_snmp_load.pl fixed to work with modern ASA firmware
#!/usr/bin/perl -w
############################## check_snmp_load #################
my $Version='1.12';
# Date : Oct 12 2007
# Author : Patrick Proy ( patrick at proy.org)
# Help : http://nagios.manubulon.com/
# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
# Contributors : F. Lacroix and many others !!!
# 2010-03-13 - Modified by Pall Sigurdsson <palli@ok.is> Added support for cisco asa
#################################################################
@tbaschak
tbaschak / fix_american_dad_sickbeard.diff
Created July 18, 2016 01:30 — forked from outlyer/fix_american_dad_sickbeard.diff
A (hacky) Fix for American Dad! series confusion between TVDB and SickBeard
diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py
index 0970288..b45d619 100644
--- a/lib/tvdb_api/tvdb_api.py
+++ b/lib/tvdb_api/tvdb_api.py
@@ -834,6 +834,14 @@ class Tvdb:
seas_no = int(float(elem_seasnum.text))
ep_no = int(float(elem_epno.text))
+ # Fixes American Dad! issue from TVDB
+ if sid == 73141: