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
prompt = function() { | |
// set version | |
version = db.version(); | |
// case mongos | |
if (rs.status().info == 'mongos') { | |
return rs.status().info + ':[' + version + '] > '; | |
} | |
// config or replica |
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
global | |
daemon | |
user haproxy | |
group haproxy | |
log /dev/log daemon info | |
maxconn 4096 | |
defaults | |
log global | |
option dontlognull |
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
# | |
# Cookbook Name:: nagios | |
# Recipe:: repo | |
# | |
# Copyright 2011, sawanoboly | |
# | |
package "python-software-properties" do | |
#version "" | |
action :install |
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
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 | |
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
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 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 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 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 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 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 |