This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day job: Sr. Developer @ Evidon | |
Favorite Python project: boto | |
Favorite Conference: DEFCON | |
Python Experience Level: intermediate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
=cut | |
combine several hadoop (log4j) log files into a single stream, sorted by time | |
=cut | |
use File::Basename qw(basename); | |
my @logs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
=cut | |
usage: | |
cat foo.txt | hadoop_snip_logs.pl <time1> <time2> | |
e.g. | |
cat foo.txt | hadoop_snip_logs.pl 12:26 12:28 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z "$1" ]]; then | |
echo "usage: $0 <host1> <host2> [host3 ...]" | |
exit 1 | |
fi | |
SRC_HOST=$1 | |
# see if src is setup yet with a key, if not create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- netverify.py.orig 2011-11-30 17:26:33.000000000 -0500 | |
+++ netverify.py 2011-11-30 17:32:45.000000000 -0500 | |
@@ -1278,7 +1278,7 @@ | |
# Get the hostname from the two different sources | |
- hvar = None | |
+ hvar = "" | |
for l in self.hostname_var: | |
if l.startswith("HOSTNAME ") or l.startswith("HOSTNAME\t"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## don't screw around with cpan! just just cpan-minus!! | |
## | |
## run as root! | |
cd /usr/local/bin; curl -fsSLO http://xrl.us/cpanm; chmod 755 cpanm | |
## then install away! | |
## -q = queit, -n no test (who needs those pesky things?!) | |
cpanm -qn Moose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# a simple dependency installer using cpanm and the DEPS file | |
if [ ! -f `which cpanm` ]; then | |
echo "need to install cpanm!" | |
cd /usr/local/bin | |
sudo curl -fsSLO http://xrl.us/cpanm | |
sudo chmod 755 cpanm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
LONG_UA="-H \"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"" | |
DIR=ARGV.shift | |
URL="http://sewer3.evidon.com:8080/" | |
`mkdir -p #{DIR}` | |
(1..2).each do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f /etc/apt/sources.list.d/cloudera.list ]; then | |
echo deb http://archive.canonical.com/ lucid partner > /etc/apt/sources.list.d/cloudera.list | |
echo deb http://archive.cloudera.com/debian lucid-cdh3u0 contrib >> /etc/apt/sources.list.d/cloudera.list | |
apt-get update | |
apt-get install --yes --force-yes hadoop | |
fi | |
if [ `uname -m` == "i686" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'logger' | |
require 'stringio' | |
# simple little wrapper on logger that keeps a buffer of all logged messages | |
class LogWrapper | |
def initialize(file, level, rotation) | |
@file_logger = Logger.new(file, rotation) | |
@file_logger.sev_threshold = level |