Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am fredsmith on github.
* I am derf (https://keybase.io/derf) on keybase.
* I have a public key whose fingerprint is 01DA 4BA6 0CFB D918 88EC 4D36 7904 3D7A DBCA C24B
To claim this, I am signing this object:
@fredsmith
fredsmith / keybase.md
Created August 13, 2014 13:50
keybase.md

Keybase proof

I hereby claim:

  • I am fredsmith on github.
  • I am derf (https://keybase.io/derf) on keybase.
  • I have a public key whose fingerprint is 0E95 21A0 0EF1 5042 22AE 37CD B0BE DF08 7AD0 73C7

To claim this, I am signing this object:

#! /bin/bash
function print { awk "{print \$$1}"; }
for dir in *; do
if [[ -d $dir/.git ]]; then
pushd $dir > /dev/null;
echo -n "$dir : "
#git rev-parse --verify HEAD
git ls-remote origin -h refs/heads/master 2> /dev/null | print 1
--- This is a config file for imapfilter.
---
--- Syntax example: https://github.com/lefcha/imapfilter/blob/master/samples/config.lua
--- or: http://defi.ant.ly/2010/12/imapfilter-a-scriptable-email-processor/
account1 = IMAP {
server = 'imap.nuance.com',
username = 'fred_smith', -- change me!
port = 993,
#! /bin/bash
DEBUG="false";
MAXCACHEAGE="60";
COMMAND="false";
while getopts "da:c:" optionName; do
case "$optionName" in
d)
DEBUG="true"
;;
#!/bin/bash
#
# servicename Service Description
#
# chkconfig: 2345 62 38
# description: Service Description
#
# the chkconfig: line is 'default runlevels' 'start priority' 'stop priority'
section: screens
io:
argus:
end
section: links
io:
right = argus
@fredsmith
fredsmith / dmesg
Created June 15, 2011 15:38
netxen firmware hang self healing
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
bonding: bond0: setting mode to active-backup (1).
bonding: bond0: Setting MII monitoring interval to 500.
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: bond0: Adding slave eth0.
bonding: bond0: enslaving eth0 as a backup interface with a down link.
@fredsmith
fredsmith / check_hdfs.sh
Created May 11, 2011 21:03
Hadoop Nagios check hdfs health
#! /bin/sh
chk_hdfs=`sudo -u hdfs /usr/bin/hadoop fsck / | grep 'filesystem under path'`
case $chk_hdfs in
*HEALTHY*)
echo "OK - HDFS is healthy"
exit 0
;;
*)
@fredsmith
fredsmith / check_namenode_storage.sh
Created May 11, 2011 21:02
Hadoop Nagios check namenode storage mounts
#! /bin/bash
function http { (exec 3<>/dev/tcp/$1/$2; echo -e "$3 $4 HTTP/1.0\r\n\r\n" >&3; cat <&3); }
ACTIVEMOUNTS=$(http localhost 50070 GET /dfshealth.jsp | grep "Storage Directory" | sed -e 's/<tr>/\n/g' | grep -c Active)
if [ $ACTIVEMOUNTS -lt 3 ]; then
echo "CRITICAL - $ACTIVEMOUNTS storage directories active"
exit 2
fi