Skip to content

Instantly share code, notes, and snippets.

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

Yukihiko SAWANOBORI sawanoboly

🤷‍♂️
🙃
View GitHub Profile
@sawanoboly
sawanoboly / natty_rvm192
Created October 4, 2011 01:06
Debootstrapで作成したlxcのNattyコンテナにrvmでRuby1.9.2を入れるBootstrap
$ sudo echo deb-src http://archive.ubuntu.com/ubuntu natty main universe>> /etc/apt/sources.list
$ sudo apt-get -y update
$ sudo apt-get -y install git
$ sudo apt-get -y build-dep ruby1.9.1-full
$ sudo apt-get -y install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
$ sudo -s
# bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
## use older version rvm.
@sawanoboly
sawanoboly / Rakefile
Created October 5, 2011 04:20
Raketask: copy sshdconfigs from host to all lxc Containers. (igunore guest status.)
## lxc-tool for natty
## copy sshdconfigs from host to all guests. (ignore the guest status)
## author sawanobori@higanworks.com
## Usage: rake copyssh
require 'pp'
LXC_DIR = "/var/lib/lxc/"
rake_env = ENV['RAKE_ENV'] || "dafault"
@sawanoboly
sawanoboly / Rakefile
Created October 5, 2011 05:26
Raketask: Create inet_interface for lxc containers.
## lxc-tool for natty
## Create inet_interface for lxc containers. (ignore the guest status)
## author sawanobori@higanworks.com
## Usage: rake conf_ip RAKE_ENV=environment (default=default)
require 'pp'
require 'erb'
LXC_DIR = "/var/lib/lxc/"
rake_env = ENV['RAKE_ENV'] || "dafault"
@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
@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 / 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.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 / 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 / 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 / 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