Skip to content

Instantly share code, notes, and snippets.

@yoshikaw
yoshikaw / gist:984945
Created May 21, 2011 22:09
その端末で一番始めに動作しているscreenがアタッチされてるかを、zshの変数展開でがんばって取得してみたけど、自分でもワケが分からない。。。
### screen 4.1.0 at Mac OS X
% screenx -list
There are screenxs on:
1502.ttys000.nadleeh (Attached)
86105.ttys011.nadleeh (Detached)
2 Sockets in /tmp/uscreens/S-yoshikaw.
% screenx -list | egrep '^[[:space:]]+[[:digit:]]' | head -n1 | cut -f 4,3 | cut -f 2
(Attached)
@yoshikaw
yoshikaw / gist:998928
Created May 30, 2011 13:55
screenのレジスタを複数扱いやすくするための設定をとりあえず考えてみた。10個あれば足りるだろ。
# to yank/put registers easily.
# override default `C'(clear) mapping
bind C eval 'command -c yank' 'echo "specify the yank buffer: [0-9]"'
bind -c yank 0 eval 'paste . 0' 'echo "yank to 0"'
bind -c yank 1 eval 'paste . 1' 'echo "yank to 1"'
bind -c yank 2 eval 'paste . 2' 'echo "yank to 2"'
bind -c yank 3 eval 'paste . 3' 'echo "yank to 3"'
bind -c yank 4 eval 'paste . 4' 'echo "yank to 4"'
bind -c yank 5 eval 'paste . 5' 'echo "yank to 5"'
bind -c yank 6 eval 'paste . 6' 'echo "yank to 6"'
@yoshikaw
yoshikaw / bs=1M jobs=4
Created June 16, 2011 15:19
iops=41 ...orz
# /usr/local/bin/fio -filename=/tmp/file5G -direct=1 -rw=randwrite -bs=1m -size=5G -numjobs=4 -runtime=10 -group_reporting -name=file1
file1: (g=0): rw=randwrite, bs=1M-1M/1M-1M, ioengine=sync, iodepth=1
...
file1: (g=0): rw=randwrite, bs=1M-1M/1M-1M, ioengine=sync, iodepth=1
fio 1.55
Starting 4 processes
file1: Laying out IO file(s) (1 file(s) / 5120MB)
Jobs: 4 (f=4): [wwww] [100.0% done] [0K/52224K /s] [0 /49 iops] [eta 00m:00s]
file1: (groupid=0, jobs=4): err= 0: pid=2613
write: io=429056KB, bw=42679KB/s, iops=41 , runt= 10053msec
@yoshikaw
yoshikaw / gist:1033471
Created June 18, 2011 20:18
うん、screenでのエンコーディング設定とgit版でのフォーカス移動がうまくまとまったかな。
# switch window encoding
bind ^E eval 'command -c sencoding' 'echo "switch encoding to: [u]tf8 [e]ucjp [s]jis / with LANG env [U]tf8 [E]ucjp [S]jis"'
bind -c sencoding u eval 'encoding utf8' 'info'
bind -c sencoding e eval 'encoding eucjp' 'info'
bind -c sencoding s eval 'encoding sjis' 'info'
bind -c sencoding U eval 'encoding utf8' '!!!echo "LANG=ja_JP.utf8; export LANG"' 'info'
bind -c sencoding E eval 'encoding eucjp' '!!!echo "LANG=ja_JP.eucJP; export LANG"' 'info'
bind -c sencoding S eval 'encoding sjis' '!!!echo "LANG=ja_JP.sjis; export LANG"' 'info'
# continuous switch focus to other region(like vi)
@yoshikaw
yoshikaw / gist:1050460
Created June 28, 2011 04:01
OSX上の濁点、半濁点をとりあえず合成させないようにするすごく適当なパッチ。
Patch: osx-comment-combined-char.patch
Probrem: display corruption at some combining characters.
Solution: comment out some combined char from mapping table
- 0x3099 voiced sound mark
- 0x309A semi-boiced sound mark
Author: Kazuhiro Yoshikawa <yoshikaw@gmail.com>
Files: src/encoding.c
--- a/encoding.c 2009-09-26 00:50:28.000000000 +0900
+++ b/encoding.c 2010-05-03 00:26:03.000000000 +0900
@yoshikaw
yoshikaw / gist:1160214
Created August 21, 2011 05:55
homebrewのrlwrapにしたらSIGSEGVで落ちる...
% rlwrap --version
rlwrap 0.37
% which rlwrap
/usr/local/bin/rlwrap
% ldd /usr/local/bin/rlwrap
/usr/local/bin/rlwrap:
/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/readline/6.2.1/lib/libreadline.6.2.dylib (compatibility version 6.0.0, current version 6.2.0)
@yoshikaw
yoshikaw / gist:1172815
Created August 26, 2011 06:14
OSXのFirefoxでメニュー項目の余白を調整するスタイルシート
menu label, menuitem label, menupopup label {
font-size: 9pt !important;
margin-top: 0 !important;
margin-bottom: 0 !important;
padding: 0 !important;
}
menu hbox, menuitem hbox, menupopup hbox,
menu image, menuitem image, menupopup image
{
@yoshikaw
yoshikaw / gist:1172817
Created August 26, 2011 06:15
OSXのFirefoxでブックマーク項目のフォント、余白を調整するスタイルシート
toolbarbutton.bookmark-item * {
font-size: 10px !important;
font-weight: normal !important;
}
menu.bookmark-item, menuitem.bookmark-item {
font-size: 10pt !important;
padding: 0 0 !important;
padding: 1px 5px !important;
}
@yoshikaw
yoshikaw / gist:1195105
Created September 5, 2011 14:25
GNU Screenのレイアウトの切り替え用キーバインド
# trigger for layout sub-commands
bind ^Y eval 'command -c layout' 'layout show'
bind y eval 'command -c layout' 'layout show'
# create/remove layout
bind -c layout c eval 'layout new' 'layout show'
bind -c layout X eval 'layout remove' 'layout show'
# change the current layout title or number
bind -c layout A colon 'layout title '
@yoshikaw
yoshikaw / gist:1252833
Created September 30, 2011 06:07
svnlog.vimを日本語環境にも対応(かなりやっつけ)
--- .vim/syntax/svnlog.vim.bak 2007-04-02 18:52:27.000000000 +0900
+++ .vim/syntax/svnlog.vim 2011-09-30 15:06:26.000000000 +0900
@@ -44,14 +44,14 @@
syn match svnLogLines /\d\+ lines\?/ skipnl nextgroup=svnChangedPaths,svnLogComment
" Changed paths highlighting
-syn region svnChangedPaths start=/^Changed paths:$/ end=/^$/ transparent contains=svnChangeLine,svnChange nextgroup=svnLogComment
+syn region svnChangedPaths start=/^\(Changed paths\|変更のあったパス\):$/ end=/^$/ transparent contains=svnChangeLine,svnChange nextgroup=svnLogComment
-syn match svnChangeLine /^Changed paths:$/ skipwhite skipnl skipempty contained nextgroup=@svnChange