[1+1=2]

OneAndOneIs2

« Virtual networkingLetting vim take the strain »

Mon, Feb 17, 2014

[Icon][Icon]Level up

• Post categories: Omni, FOSS, Technology, My Life, Programming, Helpful

I've been a big user of GNU Screen for.. erm... hang on, let me count.. OMG, it's been very near to two decades now. Holy *&^%!

(I've looked at tmux a few times but never found any compelling reason to switch)

I first started running it at University because the servers weren't the fastest, and I didn't want to hang around for ages waiting for my email client to start up & load all the messages just so I could tell if I had any new ones. Also, I was on a few MUDs and things, which I also didn't want to have to keep re-joining. So I would just leave myself logged in via Screen and re-attach to it as and when. Quite a time-saver.

I started using it for work purposes a couple of jobs ago because it was the most convenient way to share a screen to work with somebody else: You can grant other users permission to acccess your session via 'acladd'

That worked great when I was doing all work on one remote machine, but then at my last job, I was working on multiple servers & VMs. I really needed one Screen running on each box, but that then meant I needed too many windows. So I started a new trend: A container Screen that all my other Screen sessions could live within. So long as the container used a different escape key to the usual Ctrl-a this was no problem.

And now in my current workplace I again feel the need for multiple screens, because I again need to be on multiple machines at once, and also I have multiple scripts & utilities running in the background whenever I'm logged in.

Ordinarily, I just set them up manually and got on with it, because I reboot so rarely. But we've had a few power cuts lately, so I finally decided to automate it all.

So now I have a script that starts up three screen sessions for me, via the format:

  • screen -dm -S <name> -c .screen/<name>

The -S switch gives the session a name, which is vital when running multiple screens: You can attach via screen -x name instead of having to know/guess the right ID number.

Each session has its own config file, because: the container needs to have a unique escape key (I use X in the place of A); Some screens I want to have a visible toolbar, others I don't; and I want to run different startup commands for each.

And then in the config files, I have entries in the format:

  • screen -t <name> <number> <command>

So I can define the name of the individual screens within each session; what number they start on; and what command they run on startup.

This means a single command run on startup gives me easily-navigable screens connected to multiple machines, bring up IRC&IM, load utilities like my dynamic wallpaper (Xplanet), and set up some ssh tunnels.

Very convenient.

It feels like I just levelled up the the next level of geekiness, and it's hard to say whether that should engender pride or shame :)


No feedback yet

 

[Links][icon] My links

[Icon][Icon]About Me

[Icon][Icon]About this blog

[Icon][Icon]My /. profile

[Icon][Icon]My Wishlist

[Icon]MyCommerce

[FSF Associate Member]


July 2016
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Search

User tools

XML Feeds

eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by b2evolution free blog software