Cheatsheet

共 55 篇文章。

For those who just migrate from RedHat Linux...

• Cheatsheets

Just for fun:

Add the following to your /etc/csh.cshrc:
setenv LSCOLORS ExGxFxdxCxegedabagExEx
setenv CLICOLOR yes
set prompt = ‘[%B%n@%m%b] %B%~%b%# ’
set autolist
bindkey “^W” backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward

And execute:
sed -i.bak -E s/set\ prompt/#set\ prompt/g /root/.cshrc

Then re login.

参与评论

How to optimize your FS?

• Kernel

It turns out that we have to optimize our FS before benchmarking. I have read some articles and maillist archives so I got some impression:

  1. Give correct parameters to newfs(1)
    avgfilesize, filesperdir, will control DIRPERF hashing.

  2. Turn on noatime mounts.

  3. etc.

Just make a note.

参与评论

Useful sed(1) regular expressions

• Cheatsheets

Source code cleanup:

sed -i '' -E s/\ \	/\	/g *.c *.h
sed -i '' -E s/^\ \ \ \ \ \ \ \ /\	/g *.c *.h
sed -i '' -E s/\	\ \ \ \ \ \ \ \ /\	\	/g *.c *.h
sed -i '' -E s/\ +\$//g *.c *.h
阅读全文… ( 本文约 76 字,阅读大致需要 1 分钟 )

Two Powerful UNIX(R) command lines

• Cheatsheets

Top ten established HTTP connection from IP to our box: (IP=127.0.0.1)

netstat -na | grep “127\.0\.0\.1\.80 " | grep ESTABLISHED | cut -c43- |cut -f1-4 -d’.’ | sort | uniq -c | sort -nr | head -10

Merge FreeBSD-CURRENT changes to delphijfork:
retag `cvs -d /home/fcvs rdiff -rHEAD -rDELPHIJ_FORK_LASTMERGE src | grep Index: | awk ‘{print $2;}’ | grep src`

参与评论