Skip to content

Instantly share code, notes, and snippets.

# 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
#!/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
#!/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
#!/bin/bash
#
# this script expects user data field set like below.
#
#==========================
#hostname hogehostname
#somekey fugafuga
#==========================
#
#
# for small cache based wordpress service (ex. aws ec2.micro instance)
#
# this is beta version
#
#
# estimated physical memory size for this mysql server
# 200M
#
#!/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
#!/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
@pacojp
pacojp / init_ec2.sh
Last active December 18, 2015 01:28
#!/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
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
@pacojp
pacojp / gist:4166996
Created November 29, 2012 05:28
ruby source code identer
#!/usr/bin/env ruby
#
# ruby source code indenter
#
# need ruby 1.9.3
# need a lot of refactoring!!!(but too tired now)
#
#