Advertisement
audioscavenger

.screenrc

Aug 7th, 2013
765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. # scavenger's .screenrc - 20130807
  2. #1) in your profile, loads this 2 lines:
  3. # export SCREENRC=${DIREXPLOIT}/etc/.screenrc
  4. # alias screen='screen -UxdRR -t ${HOSTNAME}'
  5. #2) launching "screen" will then everytime reconnect the current session
  6.  
  7. ################ global parameters #########
  8. autodetach on # Never, ever turn this off.
  9. startup_message off # Don't display the copyright page
  10. msgwait 1 # message timeout
  11. vbell off # tab-completion flash in heading bar
  12. nonblock on # If a window goes unresponsive, don't block the whole session waiting for it.
  13. defnonblock 5 # flaky/slow ssh lines
  14. altscreen on # restore display on exit (vim, vi, but more/less)
  15. defutf8 on # Run everything in UTF-8.
  16. defmonitor on # turn monitoring on
  17. defscrollback 2048 # too much scrollback lines will mess with putty so don't be too greedy
  18. nethack on # print wackier status messages
  19. defbce on # use current bg color for erased chars
  20. defflow off # disable Ctrl-S/Ctrl-Q "flow control"
  21. deflogin on # Log new screen windows in utmp.
  22. ############################################
  23.  
  24. # logging
  25. deflog on
  26. logfile /tmp/screen_%y-%m-%d_%0c
  27.  
  28. # http://ccn.ucla.edu/wiki/index.php/Using_Screen
  29. # Make the output buffer large for (fast) xterms.
  30. # termcapinfo xterm* OL=10000
  31. termcapinfo xterm* OL=100
  32.  
  33.  
  34. ######## bellow is just for trace ##########
  35. # Enable 256-color mode when screen is started with TERM=xterm-256color
  36. # Taken from: http://frexx.de/xterm-256-notes/
  37. #
  38. # Note that TERM != "xterm-256color" within a screen window. Rather it is
  39. # "screen" or "screen-bce"
  40. #
  41. # terminfo and termcap for nice 256 color terminal
  42. # allow bold colors - necessary for some reason
  43. # http://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html#faq-screen
  44. # termcapinfo xterm-256color|xterm|xterms|xs|rxvt 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # AB = background, AF=foreground
  45. # termcapinfo xterm-256color|xterm|xterms|xs|rxvt ti@:te@
  46. # terminfo rxvt-unicode ti@:te@:
  47. # term screen-256color
  48. ############################################
  49.  
  50.  
  51. ### multi xterm 256 colors compatibility ###
  52. # http://superuser.com/questions/310251/use-terminal-scrollbar-with-tmux
  53. # workaround to fool the multiplexers into thinking that the terminal has no "alternate screen":
  54. # The end result is that the overflow ends up in the terminal's scrollback buffer instead of disappearing
  55. # + terminfo and termcap for nice 256 color terminal :
  56.  
  57. termcapinfo screen*|xterm*|rxvt*|xs 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # AB = background, AF=foreground
  58. termcapinfo screen*|xterm*|rxvt*|xs 'hs:ts=\E]0;:fs=\007:ds=\E]0;\007'
  59. #termcapinfo screen*|xterm*|rxvt*|xs 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'
  60. termcapinfo screen*|xterm*|rxvt*|xs ti@:te=\E[3J
  61. termcapinfo screen*|xterm*|rxvt*|xs hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
  62. termcapinfo screen*|xterm*|rxvt*|xs hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
  63. attrcolor b ".I" # allow bold colors - necessary for some reason
  64. term 'xterm-256color' # 256 terminal for xterm
  65.  
  66. # http://serverfault.com/questions/14323/gnu-screen-putty
  67. #termcapinfo screen*|xterm*|rxvt*|xs ks@:ke@ # this will bind numeric keypad, but disable arrows :(
  68. ############################################
  69.  
  70.  
  71.  
  72. ######### super bindings for putty #########
  73. # PREVIOUS WINDOW
  74. # Ctrl+Alt+Left from putty
  75. bindkey ^[^[[D prev
  76. # NEXT WINDOW
  77. # Ctrl+Alt+Right from putty
  78. bindkey ^[^[[C next
  79.  
  80. bind R eval "source ${DIREXPLOIT}/etc/.screenrc" "echo '.screenrc reloaded!'"
  81.  
  82. # Finally! Shift-pg up or down to view scrollback buffer
  83. bindkey "^[[5;2~" eval "copy" "stuff ^u"
  84. bindkey -m "^[[5;2~" stuff ^u
  85. bindkey -m "^[[6;2~" stuff ^d
  86.  
  87. # remove some dangerous key bindings
  88. bind ^.
  89. bind .
  90. bind ^\
  91. bind \\
  92. bind ^h
  93. bind h
  94. bind ^x
  95. bind x
  96. bind }
  97. bind ^}
  98. ############################################
  99.  
  100.  
  101. ################## backtick ################
  102. # backtick id lifespan autorefresh cmd args... that means your window will get back to the bottom every tick.
  103. # that means also you cannot wheel scroll a long log file anymore, you constantly get disturbed. I'm not a fan.
  104.  
  105. # now add '%1`%% CPU' to your hardstatus string. Result is like 38.4% CPU.
  106. # cpu.sh: awk 'NR==1 {p=substr(sprintf("%3.2f", ($2+$3)/($2+$3+$4+$5)*100),0,4); printf "%g", p;}'</proc/stat
  107.  
  108. #backtick 1 15 15 ${DIREXPLOIT}/bin/cpu.sh
  109. #hardstatus string "%H %1`%% CPU %{..Y} %Y%m%d.%c:%s "
  110.  
  111. #backtick 2 600 600 uptime
  112. #hardstatus string "%H %2`%% CPU %{..Y} %Y%m%d.%c "
  113. ############################################
  114.  
  115.  
  116. ############# messaging ####################
  117. # change the default activity message to include a bell.
  118. activity "Activity in window %n ^G"
  119.  
  120. # Time a message is displayed if screen is not disturbed by
  121. # other activity. The default is 5 seconds:
  122. msgwait 60
  123. msgminwait 1
  124.  
  125. # caption is up the hardstatus, so you get 2 lines at the bottom
  126. caption always
  127.  
  128. # minimal caption:
  129. #caption string "%-w%{+b}%n-%t%{-}%+w"
  130.  
  131. # nice and smooth caption:
  132. caption string "%{.bW}%-w%{.BW}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y%m%d "
  133.  
  134. hardstatus on
  135. hardstatus alwayslastline
  136. ############################################
  137.  
  138.  
  139. # always use a login shell
  140. shell -$SHELL
  141.  
  142.  
  143. ############# bash examples ################
  144. # HOWTO change xterm title :
  145. #http://slackware.osuosl.org/slackware-3.3/docs/mini/Xterm-Title
  146. # echo -e "\033]2; putty xterm window title \007"
  147.  
  148. # HOWTO change screen titles and so on:
  149. #http://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html
  150. #http://yz.kiev.ua/www/etc/screen-virt-term.txt
  151. # echo -e '\033k'window_title'\033\\'
  152. # echo -ne "\ek window_title\e\\"
  153. # echo -ne "\e! hardstatus_global_message\e\\"
  154. # echo -ne "\e^ hardstatus_private_message\e\\"
  155. # This doesn't work yet :
  156. # echo -ne "\e]0; %{.BW}%{..G}colored hardstatus try\e\\"
  157. # echo -ne "\e_ %{.BW}%{..G}colored hardstatus try\e\\"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement