Skip to content

Instantly share code, notes, and snippets.

View chetan's full-sized avatar
🙌
like my work? sponsor me!

Chetan Sarva chetan

🙌
like my work? sponsor me!
View GitHub Profile
@chetan
chetan / add_jars_to_classpath.java
Created December 30, 2010 02:47
Utility methods for adding JARs located on HDFS to the classpath of a Map/Reduce job
/**
* Add the JAR at the given HDFS path to the Classpath
*
* @param conf
* @param path
*/
public static void addJarToJobClasspath(JobConf conf, String path) {
addJarsToJobClasspath(conf, new String[] { path });
}
#!/usr/bin/env ruby
# == Synopsis
#
# guidiff.rb [--no-compress] [file1] [file2] [...]
#
# == Usage
#
# -h, --help:
# show this help
@chetan
chetan / check_hadoop_dfs.sh
Created March 29, 2011 19:58
nagios check script for hadoop dfs
#!/bin/sh
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#!/usr/bin/env perl
=cut
browser_breakdown.pl
(c) 2011, Chetan Sarva <chetan@evidon.com>
Takes a list of User Agents via STDIN and prints out browser and platform summaries.
Example summary:
@chetan
chetan / csv_grep.pl
Created April 12, 2011 16:17
csv_grep.pl
#!/usr/bin/env perl
# csv_grep.pl
# (c) 2011, Chetan Sarva <chetan@evidon.com>
use Getopt::Long;
use Data::Dumper;
my($dump, $field, $exact, $str);
my $ret = GetOptions(
@chetan
chetan / elastic_ip_init.sh
Created May 9, 2011 02:33
init script for grabbing an EC2 elastic IP
#!/bin/bash
###############################################################################
# CONFIG
# paths to key & cert files
export EC2_PRIVATE_KEY=
export EC2_CERT=
# needed for moving the IP
@chetan
chetan / check_no_log.sh
Created May 11, 2011 20:46
A Nagios check for missing patterns in logs
#! /bin/bash
#
# This is an inverse of the original check_log script included with Nagios.
# This script will display a CRITICAL status when the given pattern is
# *NOT* found. Usage is otherwise identical to check_log.
#
# Modified by Chetan Sarva (chetan@evidon.com) 05-11-2011
#
#
@chetan
chetan / check_log_any.sh
Created May 11, 2011 21:20
A nagios check which will complain on *any* new lines in a file
#! /bin/bash
#
# This is a modification of the check_log script which will report *ANY*
# new lines written to the given file.
#
# This is useful, for example, for detecting kernel errors written to
# /var/log/kern.log on Ubuntu.
#
# Modified by Chetan Sarva (chetan@evidon.com) 05-11-2011
#
@chetan
chetan / skel.rb
Created August 15, 2011 17:42
Ruby command-line skeleton
#!/usr/bin/env ruby
# == Synopsis
# This is a sample description of the application.
# Blah blah blah.
#
# == Examples
# This command does blah blah blah.
# ruby_cl_skeleton foo.txt
#
@chetan
chetan / gist:1189452
Created September 2, 2011 18:44 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Sr. Developer @ Evidon
Favorite Python project: boto
Favorite Conference: DEFCON
Python Experience Level: intermediate