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
# LUAJIT のディレクトリは適宜変更 | |
LUAJIT_LIB=/usr/local/lib | |
NGX_VERSION=1.4.3 | |
wget "http://nginx.org/download/nginx-$NGX_VERSION.tar.gz" | |
tar zxvf nginx-$NGX_VERSION.tar.gz | |
# ./configure: error: the HTTP rewrite module requires the PCRE library. | |
yum install pcre pcre-devel | |
yum install openssl openssl-devel zlib zlib-devel readline readline-devel libxml2 libxml2-devel libxslt-devel |
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
ionice -c 2 -n 7 nice -n 19 du -a /path/to/dir | sort -nr | awk '{if ($1 < 1000) { printf("%.2fK %s\n", $1, $2); } else if ($1 < 1000000) { printf("%.2fM %s\n", $1 / 1000, $2); } else if ($1 < 1000000000) { printf("%.2fG %s\n", $1 / 1000 / 1000, $2); }}' | head -n 200 |
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
# http://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux | |
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm" -O /tmp/jdk.rpm | |
curl -b "gpw_e24=http%3A%2F%2Fwww.oracle.com" -L "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm" -o /tmp/jdk.rpm |
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
$ gem install capistrano --no-ri --no-rdoc | |
# cap install STAGES=local,sandbox,qa,production | |
$ cap install | |
mkdir -p config/deploy | |
create config/deploy.rb | |
create config/deploy/staging.rb | |
create config/deploy/production.rb | |
mkdir -p lib/capistrano/tasks | |
Capified |
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/ruby | |
# gem install bcrypt-ruby | |
require "bcrypt" | |
# 1.9.3 or later | |
require "io/console" | |
print "Enter password: " | |
password = STDIN.noecho(&:gets) |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<hudson> | |
<disabledAdministrativeMonitors/> | |
<version>1.0</version> | |
<numExecutors>2</numExecutors> | |
<mode>NORMAL</mode> | |
<useSecurity>true</useSecurity><!-- セキュリティ有効化 --> | |
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy"/> | |
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm"> | |
<disableSignup>true</disableSignup><!-- ユーザにサインアップを許可 --> |
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
# ruby | |
# 2000-01-01 01:01:01 | |
Time.now.strftime('%F %T') | |
Time.now.strftime('%Y-%m-%d %H:%M:%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
#!/bin/sh | |
# | |
# nginx Startup script for nginx | |
# | |
# chkconfig: - 85 15 | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx | |
# pidfile: /var/run/nginx.pid | |
# description: nginx is an HTTP and reverse proxy server |
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/sh | |
# $1 : path to dir | |
# $2,$3 : regex (sed format) | |
FILES=`find ${1} -type f` | |
for FILE in $FILES; do | |
RENAMED=`echo ${FILE} | sed -e "s/$2/$3/g"` | |
mv $FILE $RENAMED |
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
`nginx -V 2>&1` |