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
# 事前に、環境変数 APP_NAME、PROWL_APIを設定しておく | |
# | |
# なお、下記ソースではエラーの重複排除を行っていないため | |
# 連続エラーで大量に送信されることになるので注意 | |
require 'prowler' | |
# prowlの困ったところとして、メッセージの終端がきちんと表示出来ないことがある。 | |
# そのため、メッセージに改行2つ付け加えてます。 | |
def notify_sys_error(msg) |
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 | |
# macでフォーマットしたipodをWindowsに持ってきたときUnicodeの正規化により | |
# 困ったことになるのを解消 | |
# Windows上で、cygwinとnkfが入っている環境を想定。 | |
CMD_NKF=nkf32 | |
CMD_AWK=gawk | |
IFS=$'\n' |
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
require 'active_support/core_ext' | |
Array.class_eval do | |
def stringify_keys | |
map { |v| v.respond_to?('stringify_keys') ? v.stringify_keys : v } | |
end | |
end | |
Hash.class_eval do | |
alias :old_stringify_keys :stringify_keys |
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 -*- | |
require 'mail' | |
require 'active_support/core_ext' | |
require 'date' | |
require 'toodledo' | |
gmail_account = 'xxxxxxxxx' | |
gmail_password = 'xxxxxxxx' |
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
# キーボード入力向け日付補完 | |
# 動作検討版 | |
# | |
# sugar.jsに依存しています | |
class DateSuggest | |
now: new Date() | |
japan_year: | |
"m": 1867, | |
"t": 1911, |
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 | |
PING_TARGET=$1 | |
COUNT_LIMIT=$2 | |
echo "try ping to ${PING_TARGET}" | |
COUNT=1 | |
while true;do |
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 | |
IP_ADDR_FILE="/var/lib/jenkins/current_global_ip" | |
CURRENT_IP_ADDR=`curl --max-time 10 -s http://inet-ip.info/` | |
CURL_STATUS=$? | |
if [ ${CURL_STATUS} -ne 0 ]; then | |
echo "error HTTP response / connect NG" | |
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
#!/bin/sh | |
for mid in `vim-cmd vmsvc/getallvms | awk '{print $1}' | grep -v "Vmid"` | |
do | |
if [ "`vim-cmd vmsvc/power.getstate ${mid} | grep 'Powered'`" == "Powered on" ]; then | |
echo "power on : ${mid}" | |
fi | |
done |
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 | |
ANSIBLE_DIR=$1 | |
mkdir -p ${ANSIBLE_DIR}/roles | |
cd ${ANSIBLE_DIR} | |
cat << EOS > galaxy.yml | |
# java install | |
- src: williamyeh.oracle-java |
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
--- | |
- hosts: localhost | |
connection: local | |
become: yes | |
tasks: | |
- name: remove ipv6 hosts entry | |
shell: sed -i -e '/::/d' -e '/IPv6/d' /etc/hosts | |
- name: find ipv6 kernel parameter | |
shell: sysctl --all | egrep '^net.ipv6\..*disable' | awk '{print $1}' | |
register: ipv6_sysctl_list |