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
#!/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
#!/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
#!/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
#!/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 | |
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 | |
(( $# < 2 )) && { echo "usage: $0 majorversion minorversion"; exit 1; } | |
vc_osiso="${HOME}/Downloads/CentOS-${1}.${2}-x86_64-minimal.iso" | |
vc_guestiso='/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso' | |
vc_vboxbase="${HOME}/VirtualBox VMs" | |
vc_basebox="vagrant-centos-${1}-${2}" | |
vc_hddbase="${vc_vboxbase}/${vc_basebox}/${vc_basebox}" | |
vc_hddfile="${vc_hddbase}.vdi" |
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
// original https://gist.github.com/sit/3606537 | |
apply plugin: "java" | |
apply plugin: "eclipse" | |
apply plugin: "idea" | |
group = "com.mycompany.hadoopproject" | |
version = "1.0" | |
repositories { |
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
public class OracleJdbcTest | |
{ | |
String driverClass = "oracle.jdbc.driver.OracleDriver"; | |
Connection con; | |
public void init(FileInputStream fs) throws ClassNotFoundException, SQLException, FileNotFoundException, IOException | |
{ | |
Properties props = new Properties(); | |
props.load(fs); |
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 [eth]" 1>&2 | |
exit 1 | |
fi | |
ETH=$1 | |
IPADDR=$(ip -f inet addr show dev eth0|awk '$1~/inet/{print $2}'|cut -d/ -f1) | |
HOSTNAME="$(echo $IPADDR | tr '.' '-').lunix.co" |