default shell for redhat lab machines is c shell. startup script: ~/.cshrc vi mode: bindkey -v (set -o vi for bash) turn off system beep: xset -b ls -cltr: sort by creation time. reverse ls -ltr: sort by modification time
X11 Forwarding
If X11 Forwarding doesn't work even if you enabled it when ssh-ing, try install xauth first.
syntax highlight in less
http://blog.tersmitten.nl/archives/1015
grep|ls coloring: ls|grep --color=always hello|less -R
install fonts
installing fonts is necessary especially when using acroread for viewing PDFs. Lacking fonts can cause real ugly renderings. Run:
ttmkfdir fc-cache -f [dirs]download some free Microsoft fonts from here: http://avi.alkalay.net/software/webcore-fonts/
copy and paste with xterm.
usually copy/paste from xterm to X-Window clipboard is not well supported. It seems to handle copy/paste via its own buffer.
Read this one: http://www.davidsimmons.com/soft/xtermhacks/
Or launch your xterm by this:
xterm -xrm 'XTerm*VT100.translations: #override <Btn1Up>: select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0)'
for loop on pairs http://compgroups.net/comp.unix.shell/for-loop-on-pair
bash prompt http://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html debugging under linux:now I solely use gdbtui 'set args' to set up initial args r,c,i,bt,n,s (as short as there is no ambiguity) info b: list all breakpoints finish d(elete) num: delete break point num display, und(isplay) u(ntil): finish current loop ret: return to caller set va(riable) name=value Ctrl-N/Ctrl-P: bt f i(nfo) lo(cals) dir default command file: .gdbinit or use 'source filename'
cut:
sort
-n: sort by numerical value
sort -k4 -t, data/tmp_injects_small.csv |cut -f4 -d,|uniq|wc
ssh
ssh remote_machine top -n 1 -b|more
ssh -t username@domain screen -d -r
awk
awk -F, '{print $1+0.1}' fn.txt
simple stat: awk -F, '{a[$1]++;count++;} END {for (i in a) print a[i] " " a[i]/count *100 "% " i;}' prod1.csv
Mine on my mac:
1 129 25.8% ls
2 103 20.6% cd
3 28 5.6% pwd
4 21 4.2% ulimit
5 21 4.2% sudo
6 16 3.2% vim
7 15 3% grep
8 12 2.4% find
9 9 1.8% man
10 8 1.6% wget
Mine on the server:
1 215 21.5215% ls
2 110 11.011% cd
3 95 9.50951% screen
4 79 7.90791% vim
5 74 7.40741% pwd
6 66 6.60661% cat
7 48 4.8048% ssh
8 24 2.4024% top
9 20 2.002% gmake
10 17 1.7017% ps
After several months:
1 205 20.5% ls
2 127 12.7% vim
3 98 9.8% cd
4 68 6.8% pwd
5 59 5.9% cp
6 41 4.1% cat
7 39 3.9% grep
8 19 1.9% ssh
9 19 1.9% perl
10 16 1.6% screen