This file contains hidden or 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 | |
if [ $# -lt 1 ]; then | |
echo "usage: $0 [hosts list]" 1>&2 | |
exit 1 | |
fi | |
HOSTSLIST=$1 | |
IPADDR=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') | |
if [ -a $HOSTSLIST ]; then |
This file contains hidden or 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 | |
# | |
# createPXE.sh v.02 | |
# | |
# You MUST edit variables to your environment | |
# or the deployment will be unsuccessful. | |
# READ script before executing! | |
# Note that the subnet variable is NOT your subnet MASK, | |
# rather the subnet (or network) on which the machine would reside. |
This file contains hidden or 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 | |
#http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Security-Guide/cdh4sg_topic_3.html | |
#http://www.cloudera.com/content/cloudera-content/cloudera-docs/CM4Ent/latest/Cloudera-Manager-Managing-Clusters/cmmc_hadoop_security.html | |
#pre-req | |
yum install krb5-server krb5-workstation krb5-libs -y | |
echo "* Downloading Java Cryptography Extension (JCE) ..." | |
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip -O /root/CDH/jce_policy-6.zip | |
[[ -d "/usr/java/default/jre/lib/security/" ]] && unzip -oj /root/CDH/jce_policy-6.zip -d /usr/java/default/jre/lib/security/ | |
if [ $# -lt 1 ]; then |
This file contains hidden or 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 cm_api.api_client import ApiResource | |
from cm_api.endpoints.hosts import ApiHost | |
import json | |
def update_rackId(resource_root, host_id, rack_id=None): | |
resp = resource_root.put('%s/%s' % ("/hosts", host_id), data=json.dumps({"rackId":rack_id})) | |
return ApiHost.from_json_dict(resp, resource_root) | |
This file contains hidden or 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 [ $# -eq 0 ]; then | |
echo >&2 "Usage: jstackSeries <pid> <run_user> [ <count> [ <delay> ] ]" | |
echo >&2 " Defaults: count = 10, delay = 0.5 (seconds)" | |
exit 1 | |
fi | |
pid=$1 # required | |
user=$2 # required | |
count=${3:-10} # defaults to 10 times | |
delay=${4:-0.5} # defaults to 0.5 seconds |
This file contains hidden or 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
.DS_Store | |
*.log | |
Gemfile.lock |
This file contains hidden or 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
# Installations directory | |
export INSTALLS=$HOME/Work/installs | |
# CDH Apache Hadoop and Ecosystem | |
export HADOOP_PREFIX=$INSTALLS/hadoop-2.0.0 | |
export HADOOP_MR1_HOME=$INSTALLS/mr1-2.0.0 | |
export HADOOP_LOG_DIR=$HADOOP_PREFIX/logs | |
export HADOOP_CONF_DIR=$HADOOP_PREFIX/etc/hadoop | |
#export HADOOP_MAPRED_HOME=$HADOOP_PREFIX/share/hadoop/mapreduce | |
#export HADOOP_YARN_HOME=$HADOOP_PREFIX/share/hadoop/mapreduce |
This file contains hidden or 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 | |
# curl -L "https://raw.github.com/sacharya/random-scripts/master/knife-rackspace-hadoop/wordcount.sh" | bash | |
set -x | |
hadoop fs -rmr /shakespeare | |
cd /tmp | |
wget http://homepages.ihug.co.nz/~leonov/shakespeare.tar.bz2 | |
tar xjvf shakespeare.tar.bz2 | |
now=`date +"%y%m%d-%H%M"` | |
hadoop fs -put /tmp/Shakespeare /shakespeare/$now/input |
This file contains hidden or 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
for service in amon smon rman hmon nav hive; do | |
mysql -u root -e 'create database $service DEFAULT default character set utf8 collate utf8_general_ci;' | |
mysql -u root -e "grant all on $service.* TO '$service'@'localhost' IDENTIFIED BY 'password';" | |
mysql -u root -e "grant all on $service.* TO '$service'@'192-168-1-109.lunix.co' IDENTIFIED BY 'password';" | |
mysql -u root -e "grant all on $service.* TO '$service'@'%.lunix.co' IDENTIFIED BY 'password';" | |
done | |
mysql -u root -e 'show databases;' |
This file contains hidden or 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
# Read the contents of ~/.path into $PATH, if ~/.path exists. ~/.path should be a file | |
# consisting of one path on each line, such as: | |
# | |
# ~$ cat ~/.path | |
# # vim: ft=sh | |
# ~/usr/bin | |
# /opt/local/bin | |
# ... etc ... | |
# | |
# Note that comments begin with a hash (#). |