Skip to content

Instantly share code, notes, and snippets.

ryotarai /
Last active Jul 18, 2018
Disable SPDY of Google Chrome
CHROME="/Applications/Google Chrome"
if [ -f "${CHROME}.orig" ]; then
echo "Spdy already seems to be disable" >&2
exit 1
mv "$CHROME" "${CHROME}.orig"
cat <<EOC > "$CHROME"
ryotarai / mina_execute_as.rb
Created Sep 20, 2013
mina 'execute_as' patch
View mina_execute_as.rb
module Mina
module SshHelpers
def ssh(cmd, options={})
require 'shellwords'
cmd = cmd.join("\n") if cmd.is_a?(Array)
# monkey patch
cmd = "sudo -u #{Shellwords.escape(execute_as)} bash -c #{Shellwords.escape(cmd)}" if execute_as?
# end
script = Shellwords.escape(cmd)
ryotarai /
Created Aug 30, 2013
Replace cd by pushd and add bd using popd.
if [ $# -eq 0 ]; then
builtin pushd "${DIR}" > /dev/null
# echo -n "DIRSTACK: "
ryotarai / Gemfile
Last active Dec 21, 2015
UFJ account reporter
View Gemfile
source ''
gem 'selenium-webdriver'
gem 'mail'
ryotarai /
Last active Dec 18, 2015
log for serverspec PR#138 about check_installed

on Debian Squeeze

vagrant@debian-607-x64-vbox4210:~$ dpkg -s tree && ! dpkg -s tree | grep -E "^Status: .+ not-installed$"
Package `tree' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
vagrant@debian-607-x64-vbox4210:~$ echo $?
vagrant@debian-607-x64-vbox4210:~$ sudo apt-get install tree
vagrant@debian-607-x64-vbox4210:~$ dpkg -s tree &amp;&amp; ! dpkg -s tree | grep -E "^Status: .+ not-installed$"
ryotarai / Hybrid.itermcolors
Last active Dec 18, 2015
View Hybrid.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Background Color</key>
<key>Blue Component</key>
<key>Green Component</key>
ryotarai /
Last active Aug 17, 2020
git-commit && change committer and author automatically


  1. Clone
$ git clone /path/to/somewhere
$ echo 'export PATH="/path/to/somewhere:$PATH"' >> ~/.bashrc
$ source ~/.bashrc
ryotarai / gist:4639449
Last active Dec 11, 2015
iSSH crashed and exited when "Mosh Compatibility" is turned on.
View gist:4639449
Jan 26 10:06:03 unknown iSSH[338] <Error>: +[NSIndexPath indexPathForItem:inSection:]: unrecognized selector sent to class 0x3f85ccb4
Jan 26 10:06:03 unknown iSSH[338] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSIndexPath indexPathForItem:inSection:]: unrecognized selector sent to class 0x3f85ccb4'
*** First throw call stack:
(0x37e8f88f 0x331c0259 0x37e9292f 0x37e91915 0x37dec650 0x36cbc1 0x37de93fd 0x30c83e07 0x30c83dc3 0x30c83da1 0x30c83b11 0x370ab933 0x37e63a33 0x37e63699 0x37e6226f 0x37de54a5 0x37de536d 0x362c8439 0x30c96cd5 0x72409 0x6f818)
Jan 26 10:06:03 unknown ReportCrash[347] <Notice>: MS:Notice: Installing: (null) [ReportCrash] (690.10)
Jan 26 10:06:04 unknown ReportCrash[347] <Notice>: Formulating crash report for process iSSH[338]
Jan 26 10:06:04 unknown[1] <Warning>: (UIKitApplication:com.yourcompany.iSSH[0x3a6f]) Job appears to have crashed: Abort trap: 6
ryotarai / gist:4121776
Created Nov 20, 2012
td-agent failed when stop
View gist:4121776
$ cat /etc/debian_version
$ sudo bash -c "echo 'deb lucid contrib' > /etc/apt/sources.list.d/"
$ sudo apt-get update
$ sudo apt-get install td-agent
$ dpkg -l | grep td-agent
ii td-agent A data collector agent for Treasure Data
# do_stop内のstart-stop-daemonの--quietオプションを無効に
$ diff -u td-agent.init /etc/init.d/td-agent