Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # scavenger's .screenrc - 20130807
- #1) in your profile, loads this 2 lines:
- # export SCREENRC=${DIREXPLOIT}/etc/.screenrc
- # alias screen='screen -UxdRR -t ${HOSTNAME}'
- #2) launching "screen" will then everytime reconnect the current session
- ################ global parameters #########
- autodetach on # Never, ever turn this off.
- startup_message off # Don't display the copyright page
- msgwait 1 # message timeout
- vbell off # tab-completion flash in heading bar
- nonblock on # If a window goes unresponsive, don't block the whole session waiting for it.
- defnonblock 5 # flaky/slow ssh lines
- altscreen on # restore display on exit (vim, vi, but more/less)
- defutf8 on # Run everything in UTF-8.
- defmonitor on # turn monitoring on
- defscrollback 2048 # too much scrollback lines will mess with putty so don't be too greedy
- nethack on # print wackier status messages
- defbce on # use current bg color for erased chars
- defflow off # disable Ctrl-S/Ctrl-Q "flow control"
- deflogin on # Log new screen windows in utmp.
- ############################################
- # logging
- deflog on
- logfile /tmp/screen_%y-%m-%d_%0c
- # http://ccn.ucla.edu/wiki/index.php/Using_Screen
- # Make the output buffer large for (fast) xterms.
- # termcapinfo xterm* OL=10000
- termcapinfo xterm* OL=100
- ######## bellow is just for trace ##########
- # Enable 256-color mode when screen is started with TERM=xterm-256color
- # Taken from: http://frexx.de/xterm-256-notes/
- #
- # Note that TERM != "xterm-256color" within a screen window. Rather it is
- # "screen" or "screen-bce"
- #
- # terminfo and termcap for nice 256 color terminal
- # allow bold colors - necessary for some reason
- # http://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html#faq-screen
- # termcapinfo xterm-256color|xterm|xterms|xs|rxvt 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # AB = background, AF=foreground
- # termcapinfo xterm-256color|xterm|xterms|xs|rxvt ti@:te@
- # terminfo rxvt-unicode ti@:te@:
- # term screen-256color
- ############################################
- ### multi xterm 256 colors compatibility ###
- # http://superuser.com/questions/310251/use-terminal-scrollbar-with-tmux
- # workaround to fool the multiplexers into thinking that the terminal has no "alternate screen":
- # The end result is that the overflow ends up in the terminal's scrollback buffer instead of disappearing
- # + terminfo and termcap for nice 256 color terminal :
- termcapinfo screen*|xterm*|rxvt*|xs 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # AB = background, AF=foreground
- termcapinfo screen*|xterm*|rxvt*|xs 'hs:ts=\E]0;:fs=\007:ds=\E]0;\007'
- #termcapinfo screen*|xterm*|rxvt*|xs 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'
- termcapinfo screen*|xterm*|rxvt*|xs ti@:te=\E[3J
- termcapinfo screen*|xterm*|rxvt*|xs hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
- termcapinfo screen*|xterm*|rxvt*|xs hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
- attrcolor b ".I" # allow bold colors - necessary for some reason
- term 'xterm-256color' # 256 terminal for xterm
- # http://serverfault.com/questions/14323/gnu-screen-putty
- #termcapinfo screen*|xterm*|rxvt*|xs ks@:ke@ # this will bind numeric keypad, but disable arrows :(
- ############################################
- ######### super bindings for putty #########
- # PREVIOUS WINDOW
- # Ctrl+Alt+Left from putty
- bindkey ^[^[[D prev
- # NEXT WINDOW
- # Ctrl+Alt+Right from putty
- bindkey ^[^[[C next
- bind R eval "source ${DIREXPLOIT}/etc/.screenrc" "echo '.screenrc reloaded!'"
- # Finally! Shift-pg up or down to view scrollback buffer
- bindkey "^[[5;2~" eval "copy" "stuff ^u"
- bindkey -m "^[[5;2~" stuff ^u
- bindkey -m "^[[6;2~" stuff ^d
- # remove some dangerous key bindings
- bind ^.
- bind .
- bind ^\
- bind \\
- bind ^h
- bind h
- bind ^x
- bind x
- bind }
- bind ^}
- ############################################
- ################## backtick ################
- # backtick id lifespan autorefresh cmd args... that means your window will get back to the bottom every tick.
- # that means also you cannot wheel scroll a long log file anymore, you constantly get disturbed. I'm not a fan.
- # now add '%1`%% CPU' to your hardstatus string. Result is like 38.4% CPU.
- # cpu.sh: awk 'NR==1 {p=substr(sprintf("%3.2f", ($2+$3)/($2+$3+$4+$5)*100),0,4); printf "%g", p;}'</proc/stat
- #backtick 1 15 15 ${DIREXPLOIT}/bin/cpu.sh
- #hardstatus string "%H %1`%% CPU %{..Y} %Y%m%d.%c:%s "
- #backtick 2 600 600 uptime
- #hardstatus string "%H %2`%% CPU %{..Y} %Y%m%d.%c "
- ############################################
- ############# messaging ####################
- # change the default activity message to include a bell.
- activity "Activity in window %n ^G"
- # Time a message is displayed if screen is not disturbed by
- # other activity. The default is 5 seconds:
- msgwait 60
- msgminwait 1
- # caption is up the hardstatus, so you get 2 lines at the bottom
- caption always
- # minimal caption:
- #caption string "%-w%{+b}%n-%t%{-}%+w"
- # nice and smooth caption:
- caption string "%{.bW}%-w%{.BW}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y%m%d "
- hardstatus on
- hardstatus alwayslastline
- ############################################
- # always use a login shell
- shell -$SHELL
- ############# bash examples ################
- # HOWTO change xterm title :
- #http://slackware.osuosl.org/slackware-3.3/docs/mini/Xterm-Title
- # echo -e "\033]2; putty xterm window title \007"
- # HOWTO change screen titles and so on:
- #http://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html
- #http://yz.kiev.ua/www/etc/screen-virt-term.txt
- # echo -e '\033k'window_title'\033\\'
- # echo -ne "\ek window_title\e\\"
- # echo -ne "\e! hardstatus_global_message\e\\"
- # echo -ne "\e^ hardstatus_private_message\e\\"
- # This doesn't work yet :
- # echo -ne "\e]0; %{.BW}%{..G}colored hardstatus try\e\\"
- # echo -ne "\e_ %{.BW}%{..G}colored hardstatus try\e\\"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement