# reminder: hosts file in Windows c:/Windows/system32/drivers/etc/hosts # workstation setup for cygwin Be sure to install openssh autossh screen vim rsync mintty bash-completion dos2unix curl wget tcl (for expect) gcc-core make xinit (for linux GUI) xorg-server (for linux GUI ssh forwarding) xorg-common (for linux GUI ssh forwarding) mate-terminal mate-session-manager (for X11 if desired) xhost (for setting display for X11 forwarding) ########################################## # This is what Cygwin.bat needs to look like: @echo off SET MAKE_MODE=Unix SET CYGWIN=notty SET HOME=C:\path\to\cygwin\home\login SET TERM=VT100 chdir C:\path\to\cygwin\bin SET PATH=C:\path\to\cygwin\bin;C:\path\to\cygwin\usr\local\bin;C:\path\to\cygwin\usr\bin;%PATH% bash --login -i ########################################## FOR THE ABOVE: To find the location (in Windows) of your current Cygwin home directory, use this command line formula: cygpath -w ~ ########################################## # Add this to .bash_profile alias vi=/usr/bin/vim export VISUAL=/usr/bin/vim # add next line if using cygwin on Windows and nmap alias nmap="cygdrive/c/Program\ Files/nmap_7.80/nmap.exe" echo "Hello from .bash_profile!" ########################################## # Add this to .bashrc # set prompt string PS1="\[\e[4;35m\]\u@\h \[\e[34m\]\w\[\e[0m\]\$ " alias vi=/usr/bin/vim HOSTNAME=`hostname` thisos=`uname -a |tr '\n\r' ' '` echo "Hello from bashrc!" function title() { echo -e "\033]2; ${HOSTNAME}:${PWD} \007"; } function cd () { dir=$1; if [ -z "$dir" ]; then dir=~; fi; builtin cd "$dir" && title `pwd`; } cd `pwd` #use this function to UN-Set title bar in Cygwin terminal windows function clear () { title `pwd`; } clear # use this function to: # 1. Set title bar in Cygwin terminal to reflect host # 2. Modify it for any special settings you want to add to ssh function ssh2 () { sshstr='ssh' while [ -n "$1" ]; do sshstr="$sshstr $1" shift done # read -r -e line # echo "command = $sshstr" if echo $sshstr | egrep -q '@' ; then # get substring from @ to end of line newhost=`echo $sshstr |sed 's/.*@//'` else # get substring from last space to end of line newhost=`echo $sshstr |sed 's/.*\s//'` fi # echo "newhost = $newhost" echo -ne "\e]0;${newhost}\a" $sshstr } # alias ssh=ssh2 alias ssh="ssh -o TCPKeepAlive=yes -o ServerAliveCountMax=200 -o ServerAliveInterval=15" # make forked tty's respect the bell-style none directive in .inputrc bind -f ~/.inputrc ########################################## # Add this to .vimrc set nocompatible set backspace=indent,eol,start set term=builtin_ansi let &t_ti.="\e[1 q" let &t_SI.="\e[5 q" let &t_EI.="\e[1 q" let &t_te.="\e[0 q" set ls=2 set tabstop=4 set belloff=all ########################################## # Create file .minttyrc # add input following: CursorType=block Font=Lucida Console FontWeight=400 FontIsBold=no # BoldAsFont=no FontHeight=12 FontSmoothing=full BackgroundColour=255,190,0 ForegroundColour=0,0,0 # BackgroundColour=255,255,191 CursorColour=0,90,0 Locale=C Charset=UTF-8 BackspaceSendsBS=yes Term=xterm BellType=0 ########################################## # Add this to .inputrc set bell-style none ########################################## ########################################## ########################################## # ssh setup # The host you can ssh TO (your destinaton) is the 'server' # The permissions need to be correct on ~/ ~/.ssh and ~/.ssh/authorized_keys # Permissions for ssh files (on both client and server but especially server): chmod go -w ~/ chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys # The ssh key needs to be created on the client (your home base or workstation). # The "key" part remains on the client. # The "public" part needs to be copied into ~/.ssh/authorized_keys on the remote server. # When generating keys, the key type you create depends on the command # you use to generate the key: # -t option is "type" of key: rsa, dsa, ecdsa ssh-keygen -t ecdsa SSH local config: ~/.ssh/config ServerAliveInterval 15 ServerAliveCountMax 200 TCPKeepAlive yes