I discovered an interesting new tactic in the website ad game. Like most people using Firefox, I use the AdBlock Plus extension. A short while ago, I found that Flickr stopped working very well – it was obvious to me that the CSS stylesheet wasn’t loading. After investigating, I found the reason. Some time ago, tired of Yahoo!-based banner ads, I blocked the domain yimg.com. Well, since Yahoo! bought Flickr, they have decided, ingeniously, to host the stylesheet for Flickr on yimg.com. So now, I have to unblock that domain or face an ugly Flickr. On many sites I’d be happy to deal with the ugly, but on an AJAX-intensive photo site, ugly doesn’t cut the mustard. It’s an interesting tactic, and I wonder if other companies will start to use it.
More on screen
While I don’t have a screen
for a graphical user environment (like X), I do have screen
for the terminal, and it rocks.
Here’s how I use it; I have four primary email accounts, each with their own .muttrc
. I open a screen
session for each account, plus one session as a scratch pad, for the variety of non-mail activities that I do each day. (If you’re thinking that one session for all non-mail activities is too few, you’d be right most of the time, but I have a solution for that too.) I start all of these sessions by calling screen
with a special config file, which I call .myscreenrc
, to separate it from the regular .screenrc
. It looks like this:
autodetach on shell -$SHELL screen -t scratch screen -t uoft u screen -t nerd n screen -t witteman w screen -t woolgathering wg
The -t
option givens me a title for each session within screen
– which helps me keep everything straight. I call this with a line in my .xinitrc
, like so:
sleep 1 && urxvt -geometry 80x56+0+0 -e screen -c .myscreenrc &
The delay helps it come up after my backdrop is drawn, so I don’t have a blank behind my transparent terminal.
All of this is now nicely set up, and I am in mutt
(the last email account). I hop between instances in three ways: Ctrl-a "
for a list of sessions to scroll through, Ctrl-a '
and the number of the session I want to be in or Ctrl-a n
or Ctrl-a p
for the next and previous session. If I need a fresh session, it’s as easy as Ctrl-a c
.
There are a couple of problems with this setup. The mutt
sessions only lasts as long as mutt
is open, so if my fingers, from long training, close mutt
, then I lose that session as well, and I have to start it afresh. The solution, rather than training my fingers, was to prevent mutt
from closing. I remapped q
in the browser and index modes to be the equivalent of c?
, which means that I can only close mutt
from the pager by hitting x
. Fine by me, and it lets me have long-lived sessions.
Now, whether I am sitting at my machine or ssh-ing in from work, I have all the same things at my disposal, and I can comfortably leave aspects of my work open when changing locations. If I have left my sessions running at home, I simply call screen -x
when at work, and I am in my familiar environment. If I have detached at home then screen -r
is the right call.
However, if I have detached at home and stopped my X session, I run into the other problem. When I started screen
via my .xinitrc
I also set the $DISPLAY
variable in each session. As such, when I am logged in remotely without X running, certain programs throw errors because I am not able to reach the X session. The sidestep for this is to unset DISPLAY
if I am going to be using programs that care about that variable, most notably vim
.
It sounds like work, but it is actually extremely sweet, and really easy.
screen for Windowing Environments
Anyone who regularly uses screen
knows how useful it can be to have long-lived sessions that you can detach from and come back to later. It is great to be able to start an email in mutt
via an SSH terminal, detach from that session, log off, shut the machine down and go home, and when I reattach to the session everything is as I left it. It is also nice to be able to start a long-running process, detach from it and open a new session, and just pop over to the other session occasionally to check on it.
What’s troublesome is that there is no equivalent in windowing environments. It would be hugely useful to be able to detach from an X session – even if it was just locally – so someone else could log in and use the machine without me having to close everything down. The Microsoft Remote Desktop makes some attempt to do this, but it is clunky and does not behave consistently. Ideally, when you start the machine it should launch a server process which in turn launches a login screen (or prompt) as a virtual machine or client instance, and whenever you wanted you could detach that instance from your display and input hardware, and then launch another instance. The standard should be a thin-client system, so you can do more with the same machine. This would be especially useful in the home, where one machine could have several heads, and anyone could use “their” computer from any head.