Skip to content

Instantly share code, notes, and snippets.

@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'))) {
@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 / 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 from=nagiosadmin@www2203.sakura.ne.jp 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 / 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
[extensions]
foo = /path/to/foo.py
@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"
"""
@hashimotor
hashimotor / gist:3845513
Created October 6, 2012 17:19
Check server spec.
# http://codezine.jp/article/detail/4830
# cat /proc/cpuinfo | grep "model name"
model name : Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz
model name : Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz
# cat /proc/meminfo | grep MemTotal
MemTotal: 2015528 kB
# cat /etc/redhat-release
CentOS release 5.3 (Final)
# uname -a
Linux host 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
@hashimotor
hashimotor / gist:4571897
Created January 19, 2013 10:40
Report Inappropriate Apps
This app[1] retrieves all the name, address, phone number, e-mail address from all the phone which the app is installed. This app discloses those private, confidential or not intend to be publicly accessible information to all the users of the app.
The user of this apps can search persons' address and phone number easily by querying using name or e-mail address.
The developer of the app says[2][3] this app is now fetching all of address book in which this app is installed, and they are now adding to the developer's databases.
The app violates the Content Policy: Personal and Confidential Information. also the app may be used in order to do Illegal Activities and Hate Speech.
[1] https://play.google.com/store/apps/details?id=info.jigensha.whitepage
@hashimotor
hashimotor / gist:5330440
Created April 7, 2013 13:13
iOSソフトウェア使用許諾契約
日本語
重要:お客様がiPhone、iPadまたはiPod touch(以下「iOSデバイス」といいます)をご使用になることで、お客様は、以下のAppleの定める各条項に基づく拘束を受けることに同意されたことになります。
A. Apple iOSソフトウェア使用許諾契約
B. Appleからの通知について
Apple Inc.
iOSソフトウェア使用許諾契約
シングルユースライセンス