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/bash | |
pkgin -y install scmgit tmux rrdtool gmake gcc-compiler | |
mkdir -p /usr/local/bin | |
curl -Lk http://xrl.us/cpanm -o /usr/local/bin/cpanm | |
chmod +x /usr/local/bin/cpanm | |
cd /usr/local | |
git clone https://github.com/kazeburo/GrowthForecast.git |
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
require "socket" | |
require "time" | |
require "date" | |
gs = TCPServer.open(0, 20000) | |
socks = [gs] | |
addr = gs.addr | |
addr.shift | |
printf("server is on %s\n", addr.join(":")) |
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
require "socket" | |
gs = TCPServer.open(0, 20000) | |
socks = [gs] | |
addr = gs.addr | |
addr.shift | |
printf("server is on %s\n", addr.join(":")) | |
while true | |
Thread.start(gs.accept) do |s| |
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 | |
curl -f -s https://raw.github.com/gist/2364272/f9a2cfd9bad80455d30ba5c9250db2a4aab6c8ea/monitoring_processes.sh -o /usr/local/bin/monitoring_processes | |
chmod +x /usr/local/bin/monitoring_processes | |
ln -f -s /usr/local/bin/monitoring_processes /etc/munin/plugins/ | |
service munin-node reload |
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 | |
date -d `curl -s -f https://github.com/hissy/kobe-it-fes/commits/master.atom | grep -o -m 1 -E '<updated>.+</updated>' | sed s@\</*updated\>@@g | cut -c1-19` +%s |
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 | |
cat >/etc/init.d/redis-server<<'EOFEOF' | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog $remote_fs | |
# Required-Stop: $syslog $remote_fs | |
# Should-Start: $local_fs | |
# Should-Stop: $local_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
#!/bin/bash | |
HOST=example.com | |
echo / | tr '\n' '\0' > httperf_list | |
wget -nv -r -l 1 http://$HOST/ | |
find $HOST -type f | sed s@$HOST@@g | grep -v 'html$' | tr '\n' '\0' >> httperf_list | |
rm -rf $HOST |
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
# insatll packeage wrapper for SmartOS | |
# install function | |
install_pkg () | |
{ | |
echo -n "Installing $1... " | |
# RESULT=`pkgin -y install $1 | grep -xv "$1 is not available on the repository"` | |
RESULT=`pkgin -y install $1` | |
echo "$RESULT" | grep -x "$1 is not available on the repository" > /dev/null | |
if [ $? -eq 0 ] |
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
def compare_yaml_hash(cf1, cf2, context = []) | |
case | |
when cf1.is_a?(Hash) | |
cf1.each do |key, value| | |
unless cf2.key?(key) | |
puts "Missing key : #{key} in path #{context.join(".")}" | |
raise "format error" #=> RuntimeError: format error | |
next | |
end |
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
def compare_yaml_hash(cf1, cf2, context = []) | |
case | |
when cf1.is_a?(Hash) | |
cf1.each do |key, value| | |
unless cf2.key?(key) | |
puts "Missing key : #{key} in path #{context.join(".")}" | |
next | |
end | |