.oO  |  List directory  |  History  |  Similar  |  Print version
Home 
Main 
   Databases 
   qmail 
   Old Braindump Pages 
Linux 
FreeBSD 

Linux > Screen and other settings for a new host

 
rw-rw-r--   ian   linux

Screen and other settings for a new host

GNU/screen

http://www.wlug.org.nz/Screen

~/.screenrc:

startup_message off
bind ' ' windowlist -b
defscrollback 5000
defmonitor on
hardstatus alwayslastline
caption always
caption string '%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<'
shelltitle '$ |bash'
  • Ctrl-A 'space' brings up the list of running windows
  • Ctrl-A c - create a new window
  • Ctrl-A ? - list of more screen commands
  • Ctrl-A k - kill the current window (when using screen as a serial console 'screen /dev/ttyUSB0 9600')

auto-title for screen

This sets the window title to the command you are currently running on localhost.

~/.bashrc:

...
PROMPT_COMMAND='echo -n -e "\033k\033\\"'

The following sets the screen title to the ssh host you have connected to.

~/.ssh/config:

Host *
    PermitLocalCommand yes
    LocalCommand tty -s && echo -ne "\ek%h\e\\"

(On every ssh connection 'LocalCommand' is run, which formats the remote hostname into the needed escape sequence for screen to set the window title).

SSH keepalive

To keep SSH sessions from timing out:

Host *
    ...
    TCPKeepAlive yes

TCP keepalive

To keep all TCP sessions from timing out:

# sysctl -w net.ipv4.tcp_keepalive_time=200
# echo net.ipv4.tcp_keepalive_time=200 >> /etc/sysctl.conf


Reference http://braindump.mrzesty.net/Linux/ScreenAndOtherSettingsForANewHost

Comments: 0 New comment

Prev. Connect Ubuntu to Windows Mobile 3G   GlusterFS Next


Home | Main | Linux | FreeBSD