Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
#
# As my coworker often says: who monitors the monitoring?
#
# Or: Quis custodiet ipsos custodes?
#
# Basic monitoring of Sensu via the VIA. Meant to be run as a cron job.
# This script is meant to be run as a CRON.
#
# Written by Jean-Francois Theroux <failshell@gmail.com>
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@ashayh
ashayh / gist:8896079
Last active August 29, 2015 13:56
headless cgminer on ubuntu 12.04 for ATI HD 7XXX
#!/bin/bash
# ashay.humane at the gmail dots com
# Headless install of cgminer on a ATI HD series GPU
# Tested on Ubuntu server 12.04.4 with a ATI HD 7970
#
# Do a regular install of Ubuntu server with openssh enabled.
# Then run this script.
#
# The script requires a REBOOT, which could be avoided,
{
"intensity" : "13,13",
"vectors" : "1",
"worksize" : "256",
"kernel" : "scrypt",
"lookup-gap" : "2",
"thread-concurrency" : "8192,8192",
"shaders" : "2048",
"gpu-engine" : "1050,1050",
"gpu-fan" : "50-95",
@ashayh
ashayh / pre-commit
Created February 20, 2014 19:54 — forked from fluxrad/pre-commit
#!/bin/bash
# pre-commit git hook to check the validity of a puppet manifest
#
# Prerequisites:
# gem install puppet-lint puppet
#
# Install:
# /path/to/repo/.git/hooks/pre-comit
# Source RVM if needed
#!/usr/bin/env python
import hashlib
import optparse
import paramiko
from Crypto.PublicKey import RSA
def insert_char_every_n_chars(string, char='\n', every=64):
return char.join(

The best way to use this tool is to hook apt's use of dpkg to run it before doing any package installs.

In your apt.conf, put this:

DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /path/to/stripdeb.sh 2>&1 | logger -t stripdeb"}

Then, a demo:

% sudo apt-get install mysql-server-5.1

#!/bin/sh
[[ -n "$1" && -n "$2" ]] || { echo "Usage: $0 <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ..."; exit 0 ; }
IIF=$1
OIF=$2
shift
shift
SRC_MACADDR=`ip link show $OIF | awk '/ether/ {print $2}' | tr -d :`
#!/usr/bin/ruby
require 'rubygems'
require 'packetfu'
dev = ARGV[0]
mac=`ip link show #{dev} | awk '/ether/ {print $2}'`
ARGV.shift
dests = ARGV
cap = PacketFu::Capture.new(
#!/bin/sh
VIP=$1
IF=$2
# Determine the interface's MAC address
MAC=`ip link show $IF | awk '/ether/ {print $2}'`
# Determine ENI ID of the interface
ENI_ID=`curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MAC/interface-id`