News for hackers. Stuff that matters.
Re:I swapped my MacBook for an iPad+Linode by scott_s on Wednesday November 02, 2011 @10:31AM (#3186849)
For anyone who spends their day (or most of some days) in a terminal connected to a remote server, I can't recommend using GNU Screen enough (brief tutorial: http://www.kuro5hin.org/story/2004/3/9/16838/14935).

I've worked almost exclusively on remote servers, using the command line and vim, for about eight years now. It's only been in the past year that I started using Screen, and I feel stupid for not using it sooner.

Re:I swapped my MacBook for an iPad+Linode by pyrhho on Wednesday November 02, 2011 @10:41AM (#3186915)
Since we're pimping terminal multiplexers, I quite enjoy tmux (http://tmux.sourceforge.net/). I used to use screen, but found tmux to be faster, smoother, and have more logical key-combos (your mileage may vary).
Re:I swapped my MacBook for an iPad+Linode by scott_s on Wednesday November 02, 2011 @10:46AM (#3186947)
I saw two people below who say they prefer tmux over Screen, so I just looked it up. What I care about most is persistence; I use multiple terminal sessions if I want to have multiple windows. Did you find any difference for that feature?
Re:I swapped my MacBook for an iPad+Linode by froseph on Wednesday November 02, 2011 @11:44AM (#3187300)
I've been using screen for years, and just switched to tmux since so many people have been raving about it. The reasons I switched were:

1/ Configs for status prompt were easier to grok

2/ Actively maintained. I used to use vertical split all the time and tmux had that where as gnu screen required hack patches.

If you only want persistence, screen, tmux, dtach do pretty much the same thing.

Re:I swapped my MacBook for an iPad+Linode by guyht on Wednesday November 02, 2011 @11:51AM (#3187340)
I used to use screen, but then moved on to tmux.

Main reasons for my move were

* Tmux handles split screens better (had horrible lag in screen, its a known bug)

* Panel and window navigation is easier in Tmux

Re:I swapped my MacBook for an iPad+Linode by scottschulthess on Wednesday November 02, 2011 @11:40AM (#3187277)
Can you explain your question better? I don't understand it enough to take a shot at an answer
Re:I swapped my MacBook for an iPad+Linode by scott_s on Wednesday November 02, 2011 @11:41AM (#3187288)
The only feature I care about is persistence. Is there a difference between Screen and tmux regarding persistence?
Re:I swapped my MacBook for an iPad+Linode by nzmsv on Wednesday November 02, 2011 @12:15PM (#3187473)
If you only need persistence, look into dtach. That's all it does.

Both screen and tmux offer multiple persistent sessions, the difference is the command syntax.

Back when I was deciding on a terminal multiplexer I picked tmux over screen because session sharing seemed to be done in a more sane way. But then again, had I used screen for any length of time I'm sure I'd have gotten used to it.

Re:I swapped my MacBook for an iPad+Linode by scott_s on Wednesday November 02, 2011 @12:59PM (#3187746)
Looking briefly at dtach, screen's handling of named sessions seems to be marginally better, so I'll stick with it.
Re:I swapped my MacBook for an iPad+Linode by djcapelis on Wednesday November 02, 2011 @12:04PM (#3187413)
No.
Re:I swapped my MacBook for an iPad+Linode by hack_edu on Wednesday November 02, 2011 @10:49AM (#3186969)
And anyone who uses GNU screen ought to know about Byobu, which makes screen a bit more visual and easy to navigate. Especially perfect for headless instances.

Not wanting to leave it is why I've not spent much time with tmux. Is there something similar for it?

Re:I swapped my MacBook for an iPad+Linode by ynniv on Wednesday November 02, 2011 @11:59AM (#3187394)
Ah! This is excellent! byobu appears to make screen configuration (particularly status lines) easier, while otherwise keeping out of the way. I won't be switching to F-key controls right away (I have a soft spot for the iTunes and volume bindings on Mac keyboards), but since byobu only speaks when spoken to, it is a welcome addition to my workspace!
Re:I swapped my MacBook for an iPad+Linode by hack_edu on Wednesday November 02, 2011 @01:38PM (#3187958)
Great! You can switch between screens using Control-A and the screen number. I hadn't even known about the function keys until now.
Re:I swapped my MacBook for an iPad+Linode by ynniv on Wednesday November 02, 2011 @01:57PM (#3188071)
Also $ESCAPE-space and $ESCAPE-backspace move sequentially among screens. control-a is screen's default $ESCAPE, but it's a poor choice given the use of control-a for beginning-of-line. I'm pretty happy with backtick (`) with no modifier now that I'm using $(...) for bash sub commands. You can't use byobu to change $ESCAPE to a sequence that doesn't use control, but it is easily set via "escape ``" in ~/.screenrc.
Re:I swapped my MacBook for an iPad+Linode by hack_edu on Wednesday November 02, 2011 @03:55PM (#3188657)
FYI, for the expected control-a behavior press the 'a' again after control-a.
Re:I swapped my MacBook for an iPad+Linode by ynniv on Wednesday November 02, 2011 @06:17PM (#3189199)
Yep. But "control-a" is a muscle reflex, and using anything else will make a certain set of users (at least emacs users) much happier.
Re:I swapped my MacBook for an iPad+Linode by kokey on Wednesday November 02, 2011 @01:12PM (#3187824)
I've been using screen for over 16 years now. The only time I have code on my local machine is if I'm writing code to interface with hardware directly or developing for a console like the GP2X. Otherwise, my computer has mostly been a terminal to servers out there which I never physically get to see. I can switch between machines at home or at work and resume my screen session.

In other words, it seems like I've been working in 'the cloud' for the past 16 years and it can appear to me that everyone else is slowly catching up to this nifty idea.

The reality is that trends swing between thin and thick clients, centralization and decentralization. They are competing forces.

Re:I swapped my MacBook for an iPad+Linode by zyfo on Wednesday November 02, 2011 @03:47PM (#3188628)
What about lag? I find sometimes on bad connections that tmux lags quite a bit (in Sweden, sever in UK). How do you deal with this? Surely packet loss and latency must've been a bigger problem a decade ago.
Re:I swapped my MacBook for an iPad+Linode by kokey on Thursday November 03, 2011 @07:24AM (#3191226)
Lag, well I used to dial up from South Africa, to places in Europe or the US. The call was normally blue boxed over analog satellite lines, one or two hops to a geostationary satellite and back. I used to bring my speed down to 7200bps since it was the most stable. I tolerated that because I had no other choice, and you learn to type very accurate that way and pause at certain moments because the next command will be a bad idea if you get the previous command wrong. (e.g. cd /tmp/bar ; rm -rf foo )

Things have improved for me a lot since. It does help that I live in the UK now. I believe nowadays within Europe something must be wrong to notice the difference (especially with SSH compression and screen), and the latency between the UK and the US has improved so much recently that I've forgotten that most of the servers I've been working on the past year is on the other side of the Atlantic.

Re:I swapped my MacBook for an iPad+Linode by andrewsardone on Wednesday November 02, 2011 @10:49AM (#3186975)
Here's a very quick crash course in GNU screen, getting you up to speed with the core components: https://github.com/cdzombak/crashcourse/blob/master/courses/...
Re:I swapped my MacBook for an iPad+Linode by srik on Wednesday November 02, 2011 @08:13PM (#3189531)
Quick, brief and to the point. I like the style. If only it existed when I was learning screen, much better than the man pages for sure.
Re:I swapped my MacBook for an iPad+Linode by sliverstorm on Wednesday November 02, 2011 @01:23PM (#3187876)
If you require a gui, NX is indispensable.
Re:I swapped my MacBook for an iPad+Linode by tripzilch on Thursday November 03, 2011 @02:02PM (#3192928)
Since I had to look it up, to save others my effort:

http://en.wikipedia.org/wiki/NX_technology

Looks pretty good. Bookmarked for whenever I need a good remote desktop.

Re:I swapped my MacBook for an iPad+Linode by sliverstorm on Thursday November 03, 2011 @09:32PM (#3194550)
It is the most useable remote desktop system I have ever used. On a medium-speed link it is nearly seamless, which is a lot more than I can say for RDP, VNC et al on a direct LAN connection.
Re:I swapped my MacBook for an iPad+Linode by vectorpush on Wednesday November 02, 2011 @12:37PM (#3187597)
My only very minor issue with screen is that it ignores window resizing escape codes. I have my .vimrc setup to resize on start/exit and screen doesn't care at all. I am totally vain I know.
Re:I swapped my MacBook for an iPad+Linode by srik on Wednesday November 02, 2011 @10:58AM (#3187026)
Screen is great. Though not it's fault, the only downside is that it cant persist through a machine restart.
Re:I swapped my MacBook for an iPad+Linode by pavel_lishin on Wednesday November 02, 2011 @11:32AM (#3187229)
Nope, but you can script both screen and tmux, and have it automatically start a screen session for you when you login.

I've got a little bash script for my VM that launches tmux, and starts a development web server in one of the windows, and tailing logs in another, and then dumps me into my project directory.

I also found tmux much, MUCH easier to script than screen.

Re:I swapped my MacBook for an iPad+Linode by SkyMarshal on Wednesday November 02, 2011 @03:27PM (#3188521)
Any good resources you'd recommend for scripting tmux?
Re:I swapped my MacBook for an iPad+Linode by pavel_lishin on Wednesday November 02, 2011 @03:36PM (#3188567)
I just googled around, read the man page, and eventually came up with https://github.com/pavellishin/dotfiles/blob/master/bin/vodk...
Re:I swapped my MacBook for an iPad+Linode by scott_s on Wednesday November 02, 2011 @11:15AM (#3187132)
This is true, but:

   11:12:52 up 44 days, 54 min, 63 users
The machines I connect to are restarted rarely. I expect this particular machine to be up until Christmass time, at which point there will probably be some scheduled maintenance.
Re:I swapped my MacBook for an iPad+Linode by bmelton on Wednesday November 02, 2011 @01:13PM (#3187839)
Can you say the same about your workstation? Can you say the same about your power grid? Can you say the same about your internet connection?

Screen/tmux/dtach are so trivial to implement and use and make the connection much more bulletproof that if you foresee there ever being a possibility that you might disconnect and lose work, then you should probably be using one of them.

Re:I swapped my MacBook for an iPad+Linode by scott_s on Wednesday November 02, 2011 @02:10PM (#3188130)
I think you misunderstood me. I'm the person who said how great Screen is at the top of this thread. My uptime comment was in response to someone who said "the only downside is that it cant persist through a machine restart." That's not much of a downside for me because the machines I have my Screen sessions on are down so rarely - literally, less than half a dozen times a year.

In other words, I use Screen when I connect to remote machines. Those machines go down rarely.

Re:I swapped my MacBook for an iPad+Linode by bmelton on Thursday November 03, 2011 @10:17AM (#3191819)
You are 100% correct. My apologies.

My point though, which I'm sure you'll agree with, was to preempt the idea that "my machines don't crash, so I don't need it."

Re:I swapped my MacBook for an iPad+Linode by X-Istence on Wednesday November 02, 2011 @01:52PM (#3188032)
This is my workstation at home:

    %uptime
    11:49AM  up 143 days, 17:08, 1 user, load averages: 0.00, 0.00, 0.00
My internet connection has been up for the last 65 days (yay for actually logging data). I don't keep remote connections to servers as I do all my work on my workstation and push when needed at which point my servers automatically pick up the changes and put them into {testing,staging,production} depending on where I push.
Re:I swapped my MacBook for an iPad+Linode by there on Wednesday November 02, 2011 @12:16PM (#3187480)
Re:I swapped my MacBook for an iPad+Linode by simonista on Thursday November 03, 2011 @01:48AM (#3190490)
Just went and checked it out, the specifically list screen as something they'd like to support soon, but that doesn't work (I think because "Multiple processes with hierarchy" doesn't work yet).

So... maybe someday, but not yet.

Re:I swapped my MacBook for an iPad+Linode by moconnor on Wednesday November 02, 2011 @11:11AM (#3187110)
I've never restarted my Linode ;-)
Re:I swapped my MacBook for an iPad+Linode by dspillett on Wednesday November 02, 2011 @11:54AM (#3187366)
What about when a kernel update is due? Is something fancy like live patches (via http://en.wikipedia.org/wiki/Ksplice or the like) happening or are you simply skipping security updates?
Re:I swapped my MacBook for an iPad+Linode by moconnor on Wednesday November 02, 2011 @12:09PM (#3187444)
Well, I've only had it for a month. No, I'm not going to try to do anything fancy, the machine will go down for kernel updates just like any other.
Re:I swapped my MacBook for an iPad+Linode by kiranryali on Wednesday November 02, 2011 @06:50PM (#3189289)
byobu is fantastic as well