Skip to content

Instantly share code, notes, and snippets.

View t17a's full-sized avatar

Tomo t17a

  • Tokyo, Japan
  • 00:40 (UTC +09:00)
View GitHub Profile
@t17a
t17a / pidof.sh
Created August 25, 2014 02:07
pidof shell script for mac by reference to http://hints.macworld.com/article.php?story=20030618114543169
#!/bin/sh
ps axc|awk "{if (\$5==\"$1\") print \$1}";
function zshaddhistory() { # {{{
# http://mollifier.hatenablog.com/entry/20090728/p1
local line cmd
line=${1%%$'\n'}
cmd=${line%% *}
# Add command to history if it meets the following conditions
[[ ${#line} -ge 5
&& ${cmd} != (l|l[sal])
&& ${cmd} != (c|cd)
@t17a
t17a / rm_shutter_sound_on_iphone.sh
Created April 3, 2013 03:36
Remove camera shutter sound on iphone. This hack is useful for japanese iphone jail-breaker.
cd /System/Library/Audio/UISounds
mv photoShutter.caf photoShutter.caf.bak
@t17a
t17a / tmux_open_windows.sh
Created April 1, 2013 07:48
create and attach multiple tmux session
#!/bin/sh
if ! type tmux >/dev/null 2>&1; then
echo 'Error: tmux command not found' 2>&1
exit 1
fi
if [ -n "$TMUX" ]; then
echo "Error: tmux session has already been attached" 2>&1
exit 1
@t17a
t17a / gist:5275211
Last active December 15, 2015 14:29
Make and link Homebrew man page
sudo gem install ronn
rbenv rehash
cd /usr/local/homebrew/Library/Contributions/cmd
HOMEBREW_REPOSITORY=/usr/local/homebrew HOMEBREW_PREFIX=/usr/local ./brew-man
cd /usr/local/homebrew/share/man/man1/
ls
ln -s brew.1 /usr/local/share/man/man1/
man brew
brew install cmigemo
mkdir -p ~/.vim/bundle/manual/migemo/plugin
cd ~/.vim/bundle/manual/migemo/plugin
curl -L -O https://raw.github.com/koron/cmigemo/master/tools/migemo.vim
vi ~/.vimrc
NeoBundle 'migemo', {'type' : 'nosync', 'base' : '~/.vim/bundle/manual'}
mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
passwd <username>
# check latest file at https://code.google.com/p/iterm2/downloads/list
curl -L -O https://iterm2.googlecode.com/files/tmux-for-iTerm2-xxxxxxxx.tar.gz
tar zxvf tmux-for-iTerm2-xxxxxxxxx.tar.gz
cd tmux
sh autogen.sh
./configure
make clean && make
sudo make install