This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
c=/nix/var/nix/profiles/per-user/$USER/channels | |
nix-env --delete-generations -p $c old | |
nix-env --delete-generations old | |
nix-store --gc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix = ~/pkg/nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rc | |
# usage: doing [-d yyyy-mm-dd] [message ...] | |
# ラベル | |
# 開始時間 | |
# 終了時間 | |
# (空行) | |
dir=$home/lib/doing | |
boundary=4 # 日付をまたぐ時間[0..$boundary][$boundary+1..23] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sudo -p 'Password for %u:' bash -c " | |
cd $PLAN9/secstore | |
if [[ ! -d .git ]] | |
then | |
git init | |
git remote add origin git@ghe.fenrir-inc.com:$USER/secstore.git | |
fi | |
if [[ -z \$(git status -s) ]] |
- ディスクからブートする場合、diskload.cの
trydiskboot()
を呼ぶ trybootfile()
でBoot構造体のstateはINITKERNELにセットされる- fs.cの
fsboot()
でブートを開始する(最終的にカーネルの実行に移るので戻らない) fsboot()
は found 9pcflop.gz のようなメッセージを出力する- カーネルを8KBずつ読み込み、
bootpass()
に渡す(bufはnon-nil)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type responseWriter struct { | |
gin.ResponseWriter | |
buf bytes.Buffer | |
} | |
func (w *responseWriter) Write(b []byte) (int, error) { | |
w.buf.Write(b) | |
return w.ResponseWriter.Write(b) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
flagh=0 | |
case $1 in | |
-h) flagh=1 | |
shift | |
;; | |
-*) echo usage: $(basename $0) [-h] [file ...] >&2 | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: goinstall [pkg ...] | |
if [[ -z $GOPATH ]] | |
then | |
echo $(basename $0): requires GOPATH >&2 | |
exit 1 | |
fi | |
IFS=: paths=($GOPATH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ref https://groups.google.com/forum/#!topic/comp.os.plan9/dL9RQnlY6So | |
w=acme/$winid | |
echo -n Edit ,d | 9p write $w/body | |
echo -n /Edit ,d/ | 9p write $w/addr | |
echo -n 'dot=addr' | 9p write $w/ctl | |
9p read $w/addr | awk '{printf("MX%s %s\n", $1, $2)}' | 9p write $w/event |
OlderNewer