2011-10-12

screen tricks

GNU screen has been a staple tool for a few years now that I do most thing on remote machines. My main hangup with it is switching windows which I do a lot and requires multiple keypresses (C-a #).  This can be alleviated some by splitting the screen (C-a S) so I don't have to switch as often. But that introduces yet another sequence of key strokes (C-a TAB). It's something I can only stomach on a larger screen since I hate terminals with too few lines.

It occurred to me today that I could open up to ssh sessions and have both joined to the same screen session, so that I could keep different windows open in each. Simply open the second terminal with "screen -x".

Another trick I discovered was to add the following to my bashrc.
if [ "$TERM" = "screen" ]; then
  screen_set_window_title () {
    local HPWD="$PWD"
    case $HPWD in
      $HOME) HPWD="~";;
      *) HPWD=`basename "$HPWD"`;;
    esac
    printf '\ek%s\e\\' "$HPWD"
  }
  PROMPT_COMMAND="screen_set_window_title; $PROMPT_COMMAND"
fi
And now my windows have a more sensible name; I do find myself constantly cycling through windows till I find the right screen in the right directory.

VPN, Win7, and not seeing the LAN computers

Here's another one of those mystical computer problems that (at least) one wonderful genius found a solution to that defies explanation as to how he figgered it out.

Problem: I VPN in to work but for some reason cannot see what used to be called the "Network Neighborhood".  Basically, if there's a file on the network that I need I can't click on the link to get to it.

Search:  Turns out I can use the IP address in an explorer window to see the contents, but hell if I'm going to look up every IP address that I need.  It logically leads to a lot of guesswork on the nets looking for a solution that involves network settings, DNS, configs, and even domains and workgroups.  Most threads of which drop off without a satisfactory answer and an occasional "works for me"

Solution: Then I found this lonely page quite apart from the other threads in content and direction but which did the trick.  How the hell are we supposed to know that something called TCP Auto-tuning would be the culprit?

solution copied here for future reference:

Disable TCP Auto-Tuning
1.Open elevated command prompt with administrator’s privileges.
2.Type the following command and press Enter:
netsh interface tcp set global autotuning=disabled
Enable TCP Auto-Tuning
1.Open elevated command prompt with administrator’s privileges.
2.Type the following command and press Enter:
netsh interface tcp set global autotuning=normal