Skip to content

Instantly share code, notes, and snippets.

View beezly's full-sized avatar

Andrew Beresford beezly

View GitHub Profile
beezly / sr-git-backup
Created December 16, 2013 15:52
Backup Stingray Traffic Manager to a Git repository
# Replace the following variables for your environment
# zxtm - hostname of your Stingray Traffic Manager
# zxtmuser - username used to log in to Stingray SSH interface
# git_path - path to the git repo you want to store the config backups in
# I recommend that zxtmuser is able to log in to the Traffic Manager
# without using a password, using SSH keys.
beezly /
Last active December 24, 2015 13:59
Ubuntu machine keeps getting filled up with old kernels? Why not run this script from your crontab. === Warning - may trash your machine. Don't blame me. You downloaded it. === Run at any time without downloading (so long as you have wget) with wget -O - | /bin/bash
read -a kernels_installed <<< `dpkg -l 'linux-image-[0-9]*' | grep ^ii | awk '{ print $2 }'`
kernel_links=(/vmlinuz /vmlinuz.old)
kernels_to_keep=( )
for i in ${kernel_links[@]}; do
if [ $DEBUG -eq 1 ]; then echo "Checking $i"; fi
real_kernel_link=`readlink $i`
if [ $DEBUG -eq 1 ]; then echo "$i points to /$real_kernel_link"; fi
jfryman / gist:5808537
Created June 18, 2013 19:36
NagiosDB - Generate Nagios configs from Puppet Exported Resources + PuppetDB
#!/usr/bin/env ruby
# Nagios/PuppetDB config generator
# Based on concept from puppetdb-external-naginator
# Generates nagios configs from puppet(db) exported resources.
require 'rubygems'