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
# init_ec2.sh | |
curl -o /tmp/init_ec2.sh https://gist.github.com/pacojp/5703761/raw | |
nohup /bin/bash /tmp/init_ec2.sh > /tmp/init_ec2.sh.log && rm -f /tmp/init_ec2.sh & | |
# install_nginx.sh | |
curl -o /tmp/install_nginx.sh https://gist.github.com/pacojp/5704628/raw | |
nohup /bin/bash /tmp/install_nginx.sh > /tmp/install_nginx.sh.log && rm -f /tmp/install_nginx.sh & | |
# install_mysql_server.sh | |
curl -o /tmp/install_mysql_server.sh https://gist.github.com/pacojp/5707825/raw |
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 | |
# | |
# # sample usage | |
# curl -o /tmp/install_wordpress.sh https://gist.github.com/pacojp/5721025/raw | |
# /bin/bash /tmp/install_wordpress.sh ${HOSTNAME} | |
# | |
WORDPRESS_VERSION=3.5.1 |
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/sh | |
# | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
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 | |
# | |
# this script expects user data field set like below. | |
# | |
#========================== | |
#hostname hogehostname | |
#somekey fugafuga | |
#========================== | |
# |
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
# | |
# for small cache based wordpress service (ex. aws ec2.micro instance) | |
# | |
# this is beta version | |
# | |
# | |
# estimated physical memory size for this mysql server | |
# 200M | |
# |
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 | |
# | |
# # sample usage | |
# curl -o /tmp/install_mysql_server.sh https://gist.github.com/pacojp/5707825/raw | |
# nohup /bin/bash /tmp/install_mysql_server.sh > /tmp/install_mysql_server.sh.log && rm -f /tmp/install_mysql_server.sh & | |
# | |
# Make sure only root can run our script | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 |
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 | |
# | |
# # sample usage | |
# curl -o /tmp/install_nginx.sh https://gist.github.com/pacojp/5704628/raw | |
# nohup /bin/bash /tmp/install_nginx.sh > /tmp/install_nginx.sh.log && rm -f /tmp/install_nginx.sh & | |
# | |
# Make sure only root can run our script | |
if [ "$(id -u)" != "0" ]; then |
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 | |
# | |
# # sample usage | |
# curl -o /tmp/init_ec2.sh https://gist.github.com/pacojp/5703761/raw | |
# nohup /bin/bash /tmp/init_ec2.sh > /tmp/init_ec2.sh.log && rm -f /tmp/init_ec2.sh & | |
# | |
# Make sure only root can run our script | |
if [ "$(id -u)" != "0" ]; then |
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 'mysql2' | |
def r_signal(sig) | |
@kill = true | |
end | |
SIGNALS = [ :QUIT, :INT, :TERM, :USR1, :USR2, :HUP ] | |
SIGNALS.each { |sig| trap(sig){r_signal(sig)} } | |
def access_mysql |
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 ruby | |
# | |
# ruby source code indenter | |
# | |
# need ruby 1.9.3 | |
# need a lot of refactoring!!!(but too tired now) | |
# | |
# |