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 | |
use strict; | |
use warnings; | |
use List::Util qw(max); | |
my %counts; | |
sub log10 { |
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 bash | |
hostname=$1 | |
ip=`host $hostname | head -1 | awk '{print $4}'` | |
ssh-keygen -R $hostname | |
ssh-keygen -R $ip |
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 python | |
from __future__ import print_function | |
import sys, yaml | |
if len(sys.argv) < 3: | |
print("usage: %s file key ... " % (sys.argv[0]), file=sys.stderr) | |
exit(1) |
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/perl | |
# We want all of our time computations to be made in UTC | |
BEGIN { $ENV{TZ} = 'UTC'; } | |
use strict; | |
use warnings; | |
use Date::Format; |
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/sh | |
service hbase-regionserver stop | |
service hbase-master stop | |
service zookeeper-server stop | |
service hadoop-0.20-mapreduce-tasktracker stop | |
service hadoop-0.20-mapreduce-jobtracker stop | |
service hadoop-hdfs-datanode stop | |
service hadoop-hdfs-secondarynamenode stop | |
service hadoop-hdfs-namenode stop |
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/sh | |
service hadoop-hdfs-namenode start | |
service hadoop-hdfs-secondarynamenode start | |
service hadoop-hdfs-datanode start | |
service hadoop-0.20-mapreduce-jobtracker start | |
service hadoop-0.20-mapreduce-tasktracker start | |
service zookeeper-server start | |
service hbase-master start | |
service hbase-regionserver start |
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/sh | |
service hbase-regionserver stop | |
service hbase-master stop | |
echo -e "rmr /hbase\nquit" | hbase zkcli | |
sudo -u hdfs hadoop fs -rm -r /hbase | |
sudo -u hdfs hadoop fs -mkdir /hbase | |
sudo -u hdfs hadoop fs -chown hbase /hbase |
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
perl -e 'use Socket qw(getnameinfo inet_aton pack_sockaddr_in NI_NUMERICSERV); my $ip = inet_aton($ARGV[0]); my $addr = pack_sockaddr_in(80, $ip); my ($err, $hostname) = getnameinfo($addr, NI_NUMERICSERV); print "$hostname\n"' |
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
perl -e 'use Socket qw(getaddrinfo getnameinfo NI_NUMERICSERV NI_NUMERICHOST); my ($err, @res) = getaddrinfo($ARGV[0], "www", {socktype => SOCK_STREAM}); for my $r (@res) { my ($err, $ip) = getnameinfo($r->{addr}, NI_NUMERICHOST | NI_NUMERICSERV); print "$ip\n";}' |