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/bash | |
set -e | |
wget http://archive.apache.org/dist/thrift/0.8.0/thrift-0.8.0.tar.gz | |
tar zxf thrift-0.8.0.tar.gz | |
pushd thrift-0.8.0 | |
wget https://issues.apache.org/jira/secure/attachment/12511532/thrift-1465_1.patch | |
patch -p0 < thrift-1465_1.patch | |
wget https://issues.apache.org/jira/secure/attachment/12537024/THRIFT-1474-read-exceptions-first.patch |
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
lein dynamic system dependency: | |
[org.zeromq/jzmq "1.1.0" :classifier ~(str "native-" (System/getProperty "os.arch") "-" (System/getProperty "os.name")) ] |
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
Defaults:nagios !requiretty | |
Cmnd_Alias HSTACK = /home/hadoop/hadoop/bin/hadoop fsck *, /home/hadoop/hbase/bin/hbase hbck * | |
nagios ALL=(hadoop) NOPASSWD: HSTACK |
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
#include <valgrind/memcheck.h> | |
... | |
while(1) { | |
VALGRIND_DO_LEAK_CHECK; | |
... | |
} |
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
pgrep -f mongrel-aps | while read pid; do echo -n 'Max open files=65536:65536' > /proc/$pid/limits; done |
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/bash | |
if [[ "$1" == eth* ]]; then | |
echo "this part will be executed right after an interface is up." | |
# find out the ip | |
IP=$( ifconfig | grep "inet " | head -n 1 | awk '{print $2}' | awk 'BEGIN {FS = ":"} ; {print $2}' ) | |
# delete the existing lines in the file | |
FQDN=`hostname` | |
HOSTNAME=`hostname -s` | |
sed -i "/${HOSTNAME}/d" /etc/hosts |
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/bash | |
# CPU usage check | |
IOSTAT=/usr/bin/iostat | |
# Nagios return codes | |
STATE_OK=0 | |
STATE_WARNING=1 | |
STATE_CRITICAL=2 |
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
from socket import socket | |
import sys | |
def readlines(sock, recv_buffer=4096, delim='\n', wait=False): | |
buffer = '' | |
data = True | |
while data: | |
data = sock.recv(recv_buffer) | |
buffer += data |
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
watch "ss -n -o state established '( dport = :25001 )' | sort -k3" |
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
watch -n 0.02 "ss -nn state established '( sport >= :8081 and sport <= :8088 )' src `ifconfig | grep inet | sed 's/\s\+/:/g' |cut -f4 -d':' | head -1` dst 10.15.204.0/24 | sed 's/\s\+/ /g' | cut -f 3-6 -d' ' | sort -t ':' -k3 -n" | |
watch -n 2 "ss -nn state established '( sport = :80 )' src `ifconfig | grep inet | sed 's/\s\+/:/g' |cut -f4 -d':' | head -1` | sed 's/\s\+/ /g' | cut -f 3-6 -d' ' | sort -t ':' -k3 -n" |
OlderNewer