Skip to content

Instantly share code, notes, and snippets.

@hashimotor
hashimotor / watchdog-file.py
Created September 29, 2012 04:52
File watchdog
"""
File watchdog.
REQUIREMENT
Watchdog Python package <http://packages.python.org/watchdog/>
USAGE
python watchdog-file.py echo something changed. # Ctrl-C to stop.
python watchdog-file.py "make test && make install"
"""
[extensions]
foo = /path/to/foo.py
@hashimotor
hashimotor / localrc
Created April 16, 2012 21:29
devstack localrc essex
HOST_IP=192.168.xx.xx
NOVA_BRANCH=stable/essex
SWIFT_BRANCH=stable/essex
SWIFT_KEYSTONE_BRANCH=stable/essex
GLANCE_BRANCH=stable/essex
KEYSTONE_BRANCH=stable/essex
NOVNC_BRANCH=rebased
HORIZON_BRANCH=stable/essex
NOVACLIENT_BRANCH=tree/2012.1
KEYSTONECLIENT_BRANCH=tree/2012.1
@hashimotor
hashimotor / commands.cfg
Created March 20, 2012 09:50
NagiosでGmailへ通知を飛ばす
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | env MAILRC=/dev/null [email protected] smtp-use-starttls= smtp=smtp://smtp.gmail.com:587 smtp-auth-user=`cat mail-address` smtp-auth-password=`cat password` smtp-auth=login /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
@hashimotor
hashimotor / gist:884692
Created March 24, 2011 07:11
Y!東京電力 bookmarklet
http://www.yahoo.co.jp/#%22onload=%22this.parentNode.removeChild%28this%29;s=document.createElement('script');s.src='http://bit.ly/dGoA8i';document.body.appendChild(s);id=window.setInterval(function(){if(window['jQuery']['fn']['offset']]){{window.clearInterval(id);$("#yahooservice>ul").prepend("<li><a style='background:url(http://www.tepco.co.jp/favicon.ico) repeat-y'>東京電力</a></li>")}},100};void%280%29%22
@hashimotor
hashimotor / yammer-shirangana-button.js
Created March 19, 2011 17:21
Yammer Shirangana Button UI
function hasTsukkomi(messageid){
if(false){
return true;
} else {
return false;
}
}
var u=document.getElementsByClassName("yj-actions");
for(var i=0;i<u.length;i++){
if(hasTsukkomi(u[i].parentNode.parentNode.getAttribute('data-message-id'))) {