Skip to content

Instantly share code, notes, and snippets.

View sawanoboly's full-sized avatar
🤷‍♂️
🙃

Yukihiko SAWANOBORI sawanoboly

🤷‍♂️
🙃
View GitHub Profile
@sawanoboly
sawanoboly / repo.rb
Created December 9, 2011 01:19
add nagios-ppa | Chef-recipe
#
# Cookbook Name:: nagios
# Recipe:: repo
#
# Copyright 2011, sawanoboly
#
package "python-software-properties" do
#version ""
action :install
@sawanoboly
sawanoboly / haproxy.cfg
Created November 15, 2011 10:28
mongos behind haproxy configuration.
global
daemon
user haproxy
group haproxy
log /dev/log daemon info
maxconn 4096
defaults
log global
option dontlognull
@sawanoboly
sawanoboly / .mongorc.js
Created November 14, 2011 09:41
Sample .mongorc.js for replicaSets.
prompt = function() {
// set version
version = db.version();
// case mongos
if (rs.status().info == 'mongos') {
return rs.status().info + ':[' + version + '] > ';
}
// config or replica
@sawanoboly
sawanoboly / bachrc_addition
Created November 11, 2011 01:58
remote login with ssh-agent note.
if [ -z "$TMUX" ]; then
if [ "$TERM" != screen ]; then
# echo check
eval `ssh-agent -s`
fi
fi
@sawanoboly
sawanoboly / etc_init_god.conf
Created November 7, 2011 08:18
god on RVM, with Upstart.
# god respawn
description "god"
# start on filesystem
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
expect fork
@sawanoboly
sawanoboly / thin.god
Created October 27, 2011 12:16
RackServer thin with god (cluster multi processes)
# http://god.rubyforge.org/
# http://unicorn.bogomips.org/SIGNALS.html
# http://railscasts.com/episodes/130-monitoring-with-god
rails_env = ENV['RAILS_ENV'] || 'production'
rails_appname = ENV['RAILS_APPNAME'] || 'appname'
rails_root = ENV['RAILS_ROOT'] || "/opt/deploy/#{rails_appname}/current"
num_workers = rails_env == 'production' ? 8 : 1
thin_rootport = 3000
@sawanoboly
sawanoboly / wp.sh
Created October 25, 2011 08:04
Wordpress setup script for Z cloud Joyent Smartmachine 1.4.7.
## WordPress Setup script for Joyent SmartMachine 1.4.7
## How to use.
## run auto setup.
# wget https://gist.github.com/gists/1311791/download --no-check-certificate -O - | gzip -d | bash
# Open http://{server address}
# 1.install mysql-server and apache,mod_php.
# 2.Download wordpress from svn repository.
# 3.create wp_config.php
@sawanoboly
sawanoboly / application.god
Created October 21, 2011 05:54
Rails application rackup use unicorn_rails with god.
# http://god.rubyforge.org/
# http://unicorn.bogomips.org/SIGNALS.html
# http://railscasts.com/episodes/130-monitoring-with-god
rails_env = ENV['RAILS_ENV'] || 'production'
rails_appname = ENV['RAILS_APPNAME'] || 'myapp'
rails_root = ENV['RAILS_ROOT'] || "/opt/deploy/#{rails_appname}/current"
def generic_monitoring(w, options = {})
# generic_monitoring option list
@sawanoboly
sawanoboly / wp_post.rb
Created October 12, 2011 08:05
Wordpress test tool. Create new post. Add comment at newest post.
#!/usr/bin/env ruby
## Wordpress test tool.
## Create new post.
##
## Reference: http://rcbth.com/2010/07/16/wordpress-posting-from-ruby-xmlrpc/
require 'xmlrpc/client'
# Wordpress Setting
@sawanoboly
sawanoboly / wp.sh
Created October 10, 2011 08:27
Wordpress setup script for Joyent Smartmachine.
## WordPress Setup script for Joyent SmartMachine 1.3.6
## How to use.
# wget https://raw.github.com/gist/1274859/8508adf89853cfd9899648d3a867bfb5b81e0fe8/wp.sh --no-check-certificate -O - | bash
# Open http://{server address}
# 1.install mysql-server and apache,mod_php.
# 2.Download wordpress from svn repository.
# 3.create wp_config.php