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/bash | |
set -u # Check unset variables only | |
#set -ue # Check unset variables. Exit on error | |
LANG=C | |
# Trap signals | |
trap_HUP() { | |
echo "Trap HUP signal." | |
exit 1 | |
} |
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"?> | |
<zabbix_export> | |
<version>2.0</version> | |
<date>2012-09-29T13:36:16Z</date> | |
<groups> | |
<group> | |
<name>Templates</name> | |
</group> | |
</groups> | |
<templates> |
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/bash | |
set -ue | |
# Options "-f filename" is a mandatory option | |
readonly OPTION_DESC="[-h] [-t] -f filename" | |
usage(){ | |
echo "Usage: $0 $OPTION_DESC ..." >&2 | |
exit 1 | |
} | |
# "set -u" requires all variables are defined |
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
# CPUコア数が16の場合 | |
# 50%にしたい場合はコア数の半分で。HTがある場合はHTのスレッド数 | |
CORE=16; seq 1 $CORE | xargs -P $CORE -n1 yes >/dev/null |
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/bash | |
SCRIPT_DIR=$(cd $(dirname $0);pwd) | |
# $(dirname $(readlink -f $0)も可能だが、こちらはMac OS Xのreadlinkでは動かない。(-fオプションがないため) |
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
#-*- coding:utf-8 -*- | |
from fabric import api | |
hostlist = [] | |
for fourth_octet in [20, 21, 22, 23, 24]: | |
hostlist.append("192.168.11." + str(fourth_octet)) | |
api.env.hosts = hostlist | |
#api.env.password = 'password' | |
print 'Target: ', |
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
Zabbixサーバ自身を監視するためのテンプレート | |
http://blog.zabbix.com/monitoring-how-busy-zabbix-processes-are/457/ |
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://tokkono.cute.coocan.jp/blog/slow/index.php/programming/markdown-skills-for-github-beginners/ |
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
# .ssh Directory | |
if [ -w ~/.ssh ]; then | |
cat >> ~/.ssh/config <<EOL | |
Host github | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa.github | |
EOL | |
fi |
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
cat <<EOT >> ~/.bashrc | |
alias ishikawasan_gomennasai='sudo sed -i "s/\(SELINUX=\).*/\1disabled/" /etc/selinux/config \ | |
&& echo-sd "石川さんごめんなさい" 2>/dev/null \ | |
|| banner "石川さんごめんなさい" 2>/dev/null \ | |
|| echo "石川さんごめんなさい" | |
# お詫びのeject | |
eject -T 2>/dev/null && eject -T | |
sudo reboot' | |
EOT |
OlderNewer