Saturday, September 22, 2007

Screen

I've been playing with these things for years, and I only discovered screen a couple days ago. I have no idea how I survived without it.

The man page has a good description of what the program does:

When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill existing windows, view a list of windows, turn output logging on and off, copy-and-paste text between windows, view the scrollback history, switch between windows in whatever manner you wish, etc.


In other words, from one shell, you can have multiple virtual "windows," allowing for easy multitasking. In addition, when you normally disconnect from a shell, it closes your session, ending whatever program may be running. Using screen, however, you can "detach" from the virtual shell world, leaving everything you had open running in the background. Later, you can reattach to screen and pick up where you left off.

To begin, type screen at the terminal. Once you're past the welcome message, you'll return to a normal-looking shell, but this time, you're in the virtual world of screen. To control screen, use Ctrl+A followed by a command key. Use the following for basic navigation:

c -- Create a new virtual window.
0-9 -- Switch between windows 0 through 9.
w -- Show open windows.
k -- Close a window.

To detach from screen, use Ctrl+A followed by d. You'll return to the "real" shell. Everything's still running, though. Check the status of screen:


ryan@frizzzzle:~$ screen -ls
There is a screen on:
        17842.pts-7.frizzzzle (Detached)
1 Socket in /var/run/screen/S-ryan.


To reattach:

ryan@frizzzzle:~$ screen -r

Everything is just as you left it.

You can also run multiple instances of screen if you run out of windows in one, or want to keep separate tasks isolated and organized. Just type screen again at your regular prompt (doesn't look like it does anything if you do it when attached) to open a new instance.

ryan@frizzzzle:~$ screen -ls
There are screens on:
        23116.pts-7.frizzzzle (Detached)
        21101.pts-7.frizzzzle (Detached)
        17842.pts-7.frizzzzle (Detached)
3 Sockets in /var/run/screen/S-ryan.


Each instance is designated by [PID].[TTY].[host]. To reattach in this case, use: screen -r [PID]. Naturally, if you're doing this for the sake of organization, you'll want to use something a little more descriptive. You can label an instance with screen -S [label].

ryan@frizzzzle:~$ screen -S namethething
[detached]
ryan@frizzzzle:~$ screen -ls
There are screens on:
        25514.namethething (Detached)
        23116.pts-7.frizzzzle (Detached)
        21101.pts-7.frizzzzle (Detached)
        17842.pts-7.frizzzzle (Detached)


Neat, huh? This program has a lot more features than what I've outlined here. If you want more, follow the links.

Screen Wiki -- many more links here.
Manpage -- Everything explained.

Wednesday, September 12, 2007

Remember Where We're Going

Today's the anniversary, you know, of those awful attacks we still use as our rallying cry. "Remember 9/11," we say, and we do. We do. We remember the awful vision of the towers collapsing in upon themselves, and we remember that sinking, helpless feeling we had watching it on TV.

While it's important to remember where we came from, we seem to have a tendency to forget just where we're going. We're angry, for sure, and we've got guns, and by golly, we're shooting people with them, but it seems we're just sort of wandering about looking for targets.


AccusedExecuted




I don't do politics very well, since it just seems so silly to me. It's like watching a really fat man eat a hamburger. You don't tell people he's going to die of a heart attack -- they can already tell he's fat. So, then, here's to stating the obvious. Cheers.

Thursday, September 6, 2007

RIP, Big Guy

Here's to remembering. He's squeezed tears from me more than once.

Sunday, September 2, 2007

Story of Adventure

I did end up adventuring yesterday. Wandered around downtown, backpack strapped, just like I fancied. On the way back to the car, I crossed a field laden with doves hiding in the grass. I couldn't see them until I stepped out into the field, when they took flight in a flurry of wings and a hundred "cloocloocloos" they made as they flew wildly about. I hadn't meant to cause such chaos, but standing there surrounded by a panic-stricken swarm of birds made me feel powerful, like a magical villain in a dark fantasy story. They settled down immediately after I'd embraced that idea, like I'd somehow fallen into sync with the birds -- with the groove God had fashioned just for that moment -- balancing that tiny corner of reality. The rest of my crossing met with little ado from the birds, and once the field was behind me, I returned to the physical realm for the rest of my journey.

I do like being a spiritual animal. I'm pretty sure God is the force that defines everything, but to actually understand God is far beyond me. I sorta like the idea of a universal equation. One day, when we are actually able to define God, we will, as a result, be able to define everything. We'll be God, ourselves.

Adventures, they're good for the spirit :-)