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 | |
# $1 : password | |
set +o posix # require process substitution | |
HASH='$6$'`sha1sum <(date) | awk '{print $1}'` | |
set -o posix | |
python -c "import crypt; print crypt.crypt(\"${1}\", \"${HASH}\")"; |
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
# http://stackoverflow.com/questions/9676113/lua-os-execute-return-value | |
local handle = io.popen("ls") | |
local result = handle:read("*a") | |
handle:close() | |
print(result) |
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
# http://y-ken.hatenablog.com/entry/apache-tips-ltsv-access-log | |
LogFormat "host:%h\tident:%l\tuser:%u\ttime:%{%Y-%m-%dT%H:%M:%S%z}t\tmethod:%m\turi:%U%q\tprotocol:%H\tstatus:%>s\tsize:%b\tresponse_time:%D\trefer:\"%{Referer}i\"\tuser_agent:\"%{User-Agent}i\"" ltsv |
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
# 実行時間(time) | |
mysqldumpslow -s t /path/to/log | |
# 平均実行時間(average time) | |
mysqldumpslow -s at /path/to/log | |
# ロック時間(lock time) | |
mysqldumpslow -s l /path/to/log | |
# 平均ロック時間(average lock time) |
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
# 1.4.14 | |
yum install -y perl-AnyEvent perl-YAML | |
rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/extras/RPMS/memcached-1.4.14-1.el6.rfx.x86_64.rpm | |
mkdir /var/run/memcached | |
service memcached start | |
# 1.4.15 | |
rpm -ivh ftp://rpmfind.net/linux/remi/enterprise/6/remi/x86_64/memcached-1.4.15-2.el6.remi.x86_64.rpm | |
## remi |
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
# RPM GPG KEY | |
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi | |
# el5 | |
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm | |
# el6 | |
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
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 | |
## /path/to/retrieve_working_directory.sh | |
DIR=`dirname $0` | |
echo $DIR # /path/to |
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/ruby | |
require 'nokogiri' | |
@file = File.open("/path/to/test.xml") | |
@xml = Nokogiri::XML(@file) | |
@file.close | |
@xml.at("hoge").children.remove | |
puts "# remove hoge children" |
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
# dstat | |
yum intall -y dstat | |
# iostat, sar ... | |
yum install -y sysstat | |
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
# el5 | |
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-5 | |
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
# el6 | |
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 | |
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |