Skip to content

Instantly share code, notes, and snippets.

View tbaschak's full-sized avatar

Theo Baschak tbaschak

View GitHub Profile
@tbaschak
tbaschak / bgplgapi.patch
Created January 8, 2017 06:23
diff -u bgplg.c bgplgapi.c
--- bgplg.c 2017-01-08 00:08:36.000000000 -0600
+++ bgplgapi.c 2017-01-08 00:18:27.000000000 -0600
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
+ * Copyright (c) 2017 Theodore Baschak <theodore@ciscodude.net>>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@tbaschak
tbaschak / bgplgapi-Makefile
Created January 8, 2017 06:22
bgplgapi hackjob
# $OpenBSD: Makefile,v 1.2 2014/12/23 19:32:16 pascal Exp $
.PATH: ${.CURDIR}/..
PROG= bgplgapi
SRCS= bgplgapi.c misc.c
CFLAGS+= -Wall
CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
CLFAGS+= -Wmissing-declarations -Wredundant-decls
CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual
@tbaschak
tbaschak / vm-backup.sh
Last active January 7, 2017 09:16
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
#!/bin/bash
VERSION=4.2.4
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-$VERSION.tar.gz
tar xzf nagios-$VERSION.tar.gz
cd nagios-$VERSION
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-command-user=nagios --with-command-group=nagcmd
make all
checkinstall --pkgname=nagios4
checkinstall --pkgname=nagios4-init make install-init
This be a restricted node!
You best have permission from da admins or we be coming for ya.
Protect ya neck and respect this deck.
Reloads will not he tolerated and will be punishable by RZA's Iron Fists
$$$$$$$$$$$$$$$$""$o$o$o$o$n$oo$$""$$$$$$$$$$$$$$$
$$$$$$$$$$$$""o$$$$$$$$$$"$"$$$$$$$o$"$$$$$$$$$$$$
$$$$$$$$$"$o$$$$""$oo $ "" """$$$oo"$$$$$$$$$
$$$$$$$"o$$$$" ""o $oo o o ""$$$o"$$$$$$$
$$$$$"o$$$” oo$$$$$$$$$$o "$$$o"$$$$$
$$$$"o$$$ $ o$$$$$$$$$$$$$$"$$oo "$$$ $$$$
@tbaschak
tbaschak / exabgp-8.8.8.8-advertisement.json
Last active August 10, 2016 23:51
advertisement from 15169 which includes 8.8.8.0/24 prefix, captured using exabgp
{
"exabgp":"3.4.8",
"time":1441433523,
"host":"linux1",
"pid":"23786",
"ppid":"23785",
"counter":88036,
"type":"update",
"neighbor":{
"ip":"198.62.164.254",
@tbaschak
tbaschak / nagios-configure-command.sh
Created August 10, 2016 23:50
the ./configure line used for nagios 4.x on both my nagios VMs
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-command-user=nagios --with-command-group=nagcmd --with-mail=/usr/sbin/sendmail
@tbaschak
tbaschak / check_github.py
Last active January 13, 2018 01:17
a simple python script to check/warn on Github's status via their API.
#!/usr/bin/env python2.7
from urllib2 import Request, urlopen, URLError
# for Python3 use the following:
# from urllib.request import Request, urlopen
# from urllib.error import URLError
import sys
import json
@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:
@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
#################################################################