Skip to content

Instantly share code, notes, and snippets.

@hcoyote
hcoyote / check_hadoop_metadata_age.pl
Created February 22, 2012 17:26
Determine if the hadoop fsimage file is older than the edits file by some threshold. If the fsimage is older than the edits by some significant value, this is a sign that the secondary namenode may not be properly working because it's not able to produce
#!/usr/bin/perl
#
# This script is managed by puppet.
#
# This check determines if the Hadoop Namenode fsimage file is older
# than the edits file by some threshold. If the fsimage is older than
# the edits by some significant value, this is a sign that the secondary
# namenode may not be properly working because it's not able to produce
# the merged edits+fsimage file that gets sent back to the namenode.
#
@hcoyote
hcoyote / new_xterm.pl
Created February 13, 2012 21:36
Allow spawning of a new xterm on any work space that isn't setup as an Email work space.
#!/usr/bin/perl
use strict;
use warnings;
our $current_desk;
our @desks;
my $wmctrl = "/usr/bin/wmctrl";
@hcoyote
hcoyote / find_window.pl
Created February 13, 2012 21:32
Use wmctrl to find a window or exec a command if window name not found.
#!/usr/bin/perl
use strict;
use warnings;
my $debug = 1;
my $wmctrl = '/usr/bin/wmctrl';
my $window_name = shift;