Screen
Ubuntu Open Week - Screen-Profiles - DustinKirkland - Mon, Apr 27th, 2009
UTC -4
(02:01:44 PM) kirkland: jcastro: thank you Mr. Castro (02:01:52 PM) kirkland: alrighty .... screen-profiles! (02:02:12 PM) kirkland: so i'm going to divide this track up into a couple of small sets (02:02:17 PM) kirkland: set 1 is a brief intro (02:02:18 PM) Gordon- left the room. (02:02:24 PM) kirkland: set 2 is a shared session demo (02:02:40 PM) kirkland: and in set 3, you'll play with this on your own systems (02:02:50 PM) kirkland: okay ... set 1 (02:02:57 PM) kirkland: GNU screen is a text-based window manager (02:03:22 PM) kirkland: the Ubuntu server differs from several other server distributions in that it does not install a graphical desktop by default (02:03:31 PM) kirkland: we try to keep our server very lean and mean! (02:03:45 PM) kirkland: however, many people ask us why don't we ship a graphical desktop (02:03:57 PM) ewsubach left the room ("has left the building."). (02:04:02 PM) kirkland: in many cases, i actually believe that a *window manager* is actually what people want/need (02:04:04 PM) jcastro: .oO (You can listen to Dustin's interview about screen profiles on http://ubuntupodcast.net/) -ed. (02:04:39 PM) kirkland: a window manager gives you the ability to run multiple programs at the same time, in parallel, attach, detach, monitor system status, etc. (02:04:53 PM) kirkland: screen has been around for 20+ years (02:05:07 PM) kirkland: but in the default configuration, it's exceedingly difficult to customize (02:05:30 PM) kirkland: so, for Ubuntu, we've created a phenomenal little program call screen-profiles that makes screen even more useful and user-friendly (02:05:39 PM) kirkland: okay, so now for our demo .... (02:05:46 PM) kirkland: so set 2, group demo! (02:06:01 PM) kirkland: for this, you'll want to keep IRC open, where I'll explain what I'm doing (02:06:18 PM) kirkland: but you'll also want to open up a terminal window, and ssh to this system .... (02:06:30 PM) kirkland: ssh guest@guest@ec2-67-202-41-73.compute-1.amazonaws.com (02:06:45 PM) kirkland: that's an instance of Ubuntu Jaunty running in Amazon's ec2 (02:06:50 PM) kirkland: the password is "guest" (02:07:11 PM) kirkland: i'm going to give 60 seconds here for people to login (02:07:38 PM) jcastro: .oO (the ssh url and password are in the topic if you need to refer to them) (02:07:44 PM) kirkland: so what you're looking at is a shared screen session (02:07:53 PM) kirkland: i have write access, and everyone else has read-only access (02:08:05 PM) kirkland: for demo purposes, of course (02:08:16 PM) kirkland: you should see across the bottom of your terminal two light grey lights (02:08:19 PM) kirkland: lines (02:08:27 PM) kirkland: the top line says: (02:08:32 PM) kirkland: 0*&$ shell(guest) Menu:<F9> (02:08:39 PM) kirkland: we currently have one window open (02:08:43 PM) kirkland: (that's going to change in a moment) (02:08:46 PM) kirkland: the second line says: (02:08:51 PM) kirkland: \o/ Ubuntu 9.04 2! 20# 0.57 2.6GHz 1.6GB,6% 2009-04-27 18:07:48 (02:08:57 PM) kirkland: i'm going to explain those shortly (02:09:10 PM) kirkland: first, i'm going to launch the F9:Menu (02:09:16 PM) kirkland: and I want to show you the help menu (02:09:26 PM) kirkland: in your terminal, press F4 (02:09:36 PM) jcastro: kirkland: seems like some people can't get in, maybe there's a client limit? (02:09:36 PM) kirkland: this will move your view over to the 2nd window I created (02:09:49 PM) jcastro: but keep going (02:09:50 PM) kirkland: jcastro: hmm, we have 25 people in (02:09:58 PM) kirkland: 28+ and counting (02:10:01 PM) jcastro: ok good (02:10:23 PM) jcastro: continue, sorry (02:10:27 PM) kirkland: anyone who can't see this in the ec2 instance, please run 'screen' locally (02:10:32 PM) kirkland: (which will be set 3) (02:10:49 PM) kirkland: okay, if you're in the screen session, please hit F4 to navigate to your 2nd window (02:10:53 PM) kirkland: this is sort of like alt-tab (02:11:57 PM) kirkland: okay, now, i've launched the help memu (02:11:58 PM) kirkland: menu (02:12:11 PM) kirkland: here, you can see that there are a couple of special actions bound to your F-keys (02:12:18 PM) kirkland: in our shared screen session, i've disabled them (02:12:50 PM) kirkland: but if you run 'screen' on your local jaunty system, (and choose the light profile) you should be able to use them (02:12:56 PM) kirkland: so f2 will create a new window (02:13:05 PM) kirkland: f3/f4 will go back and forth among open windows (02:13:18 PM) kirkland: f5 will reload the profile (will demo in a moment) (02:13:22 PM) kirkland: f6 will detach (02:13:29 PM) kirkland: f7 will enter scrollback/search mode (02:13:37 PM) kirkland: f9 will launch this menu (02:13:49 PM) kirkland: and f12 will lock the screen (like a screensaver for the terminal) (02:13:55 PM) kirkland: okay (02:14:10 PM) kirkland: so another thing i can do from this menu is change my profile (02:14:20 PM) kirkland: i have created a dozen or so different colored profiles (02:14:27 PM) kirkland: i like a different color profile on each of my servers (02:14:38 PM) kirkland: we're currently using the light profile (02:14:48 PM) kirkland: i'm going to change it to a different one, then hit F5 to reload (02:15:01 PM) sean is now known as Guest76893 (02:15:32 PM) kirkland: (this is somewhat laggy) (02:15:42 PM) kirkland: (my apologies for that) (02:16:26 PM) kirkland: okay, profile reloaded (02:16:30 PM) kirkland: now it's white on black (02:16:49 PM) kirkland: as you can see, there are other colors available, please play with them on your local setup later (02:17:06 PM) kirkland: now, let's take a look at the bottom bar (02:17:16 PM) kirkland: that's our status indicator (02:17:34 PM) kirkland: \o/ is intended to be an approximation of the ubuntu logo (3 colors) (02:17:44 PM) kirkland: followed by our current distro and release version (02:17:59 PM) kirkland: the 2! indicates that there are 2 updates available (02:18:12 PM) kirkland: 41# tells me that there are 41 user logged on :-) (02:18:15 PM) kirkland: woohoo! (02:18:25 PM) kirkland: the current load is 2.14 (changing every 2 seconds) (02:18:35 PM) kirkland: this system has a single cpu, running at 2.6GHz (02:18:50 PM) kirkland: but this also changes every 2 seconds, which is useful if you have cpu frequency scaling available (02:18:57 PM) kirkland: there's 1.6GB of memory, of which 10% is used (02:19:04 PM) kirkland: and of course, the current date and time (02:19:17 PM) kirkland: but this is only a small subset of the status items you can enable (02:19:31 PM) kirkland: this is intended to mimic gnome's applets in your gnome-panel (02:19:50 PM) kirkland: so now i'm going to toggle some status notifications (02:20:02 PM) kirkland: arch is the architecture of the system (02:20:12 PM) kirkland: the battery is useful on laptops (not in ec2, though!) (02:20:22 PM) kirkland: however, ec2-cost is very useful here! (02:20:33 PM) kirkland: so i'm going to enable that (02:20:38 PM) kirkland: as well as the hostname (02:20:53 PM) kirkland: network bandwidth might be interesting on this system (02:20:57 PM) kirkland: since so many of us are logged in (02:21:27 PM) kirkland: also, note that there's a reboot-required icon that would popup if a system updated required (02:21:30 PM) kirkland: a reboot (02:21:38 PM) kirkland: this would look like this (@) (02:21:50 PM) kirkland: so now I'm going to apply these, and refresh my profile (02:22:23 PM) kirkland: (this operation apparently takes a minute when there's 44 of you connected!) (02:22:37 PM) kirkland: okay, now we can see that this system has been up for 2 hours and 32 minutes (02:22:49 PM) kirkland: and my current bill to ec2 is $0.31 :-) (02:22:58 PM) kirkland: money well spent, sabfl ;-) (02:23:03 PM) kirkland: sabdfl, rather (02:23:22 PM) kirkland: there's a few more options here, that i'm going to skip (02:23:26 PM) kirkland: but the last one is interesting (02:23:32 PM) kirkland: "Install screen by default at login" (02:23:41 PM) kirkland: this is what I did with your guest account before you logged in (02:23:55 PM) kirkland: this is why you jumped immediately into this screen session, when you logged in (02:24:05 PM) kirkland: in fact, i enable this feature on *all* of my server (02:24:23 PM) kirkland: jcastro: okay, i'm going to pause now for questions (02:24:32 PM) kirkland: jcastro: you want to paste them here? (02:24:34 PM) jcastro: ok (02:24:36 PM) jcastro: yep, one sec (02:24:49 PM) jcastro: QUESTION: Why doesn't the marketing department highlight supercool features like screen profiles for the server? Instead they say it would "further improve infrastructure management efficiencies" (buzzword bingo) (02:25:09 PM) kirkland: jcastro: hah :-) (02:25:19 PM) kirkland: jcastro: well, i accept the compliment, screen-profiles is awesome! (02:25:33 PM) kirkland: jcastro: and i hope that you, the community, can help spread the good word (02:25:48 PM) kirkland: jcastro: i'm hoping for karmic that screen-profiles is used ubiquitously on the sever (02:25:55 PM) jcastro: <peplin> QUESTION: What's the proper way to modify screen-profiles settings? I have a screenrc that I would like to use in combination with the profiles, but there doesn't seem to be an easy way to get rid of the top hardstatus line. (02:26:06 PM) kirkland: jcastro: that it becomes as important to the Ubuntu server as Gnome/KDE are to Ubuntu/Kubuntu (02:26:43 PM) kirkland: peplin: well, screen-profiles sources your local ~/.screenrc last (02:27:11 PM) kirkland: peplin: does it not accept overrides of that hardstatus line? (02:27:38 PM) peplin: I can override the bottom hardstatus, but seemingly not the line above that (02:27:41 PM) kirkland: peplin: if not, i can add a feature to screen-profiles that would allow you to disable/enable the window list and/or the status line\ (02:28:03 PM) kirkland: peplin: please open a bug ;-) i'll try to get that fixed for karmic (02:28:04 PM) jcastro: <qense> QUESTION: Some programs also use the F* keys. How does that work? Currently screen catches them first and they aren't processed by the program (02:28:45 PM) kirkland: qense: correct. you can disable screen-profiles keybindings (02:28:54 PM) kirkland: everyone, back over to the shared screen session (02:29:10 PM) kirkland: see "Change keybinding set" (02:29:30 PM) kirkland: you can accept the 'common' set of keybindings (f-keys), or take none of them (02:29:50 PM) kirkland: in which case you'd need to use the bindings that screen provides, rather than our shortcuts (02:29:55 PM) kirkland: note that i did *not* use: (02:30:15 PM) kirkland: f1 -> help in gnome terminal, f10 -> menu, or f11 -> fullscreen (02:30:24 PM) kirkland: so as not to conflict with gnome-terminal (02:30:54 PM) kirkland: jcastro: any more q's? (02:30:58 PM) jcastro: https://launchpad.net/~screen-profiles/+archive/ppa (02:31:07 PM) kirkland: jcastro: ah, great point .... (02:31:09 PM) jcastro: I wanted to mention where people can get it for older versions of Ubuntu (02:31:23 PM) jcastro: <qense> QUESTION: So actually GNU Screen is a shell wrapper giving you tabs and status indicators? (02:31:27 PM) kirkland: right, so screen-profiles is packaged and in main for Jaunty (02:31:51 PM) kirkland: however, i am providing packages for Hardy and Intrepid machines in a PPA (02:32:01 PM) kirkland: I will, perhaps, try to get it into the backports archive (02:32:13 PM) kirkland: but for now, you can use the the PPA very well (02:32:28 PM) kirkland: qense: sort of ... (02:32:36 PM) kirkland: qense: GNU screen is a "window manager" (02:32:48 PM) kirkland: qense: that has a 50+ page manpage (02:32:56 PM) kirkland: qense: really flexible, but complicated to setup (02:33:23 PM) kirkland: qense: screen--profiles is sort of a best practices configuration for screen, packaged and made easy for Ubuntu\ (02:33:28 PM) jcastro: <tm> QUESTION: Should I be seeing any sort of lag with screen-profiles on vs off? (02:33:36 PM) jcastro: <tm> I'm noticing the clock will pause and then jump ahead. Text input is slower than with stock screen (02:33:57 PM) kirkland: tm: on your local instance, or on the ec2 shared screen? (02:34:04 PM) kirkland: tm: or on some other server you have access to? (02:34:06 PM) jcastro: his linode (02:34:10 PM) tm: ^^ (02:34:30 PM) tm: I understand there's going to be some hit, but it seems quite noticeable (02:34:30 PM) kirkland: tm: there's actually a bug fix for that in jaunty-proposed; should make it to jaunty-updates any day now (02:34:34 PM) tm: cool (02:34:43 PM) kirkland: tm: i think it should be fixed in jaunty-updates (02:34:51 PM) jcastro: service with a smile! (02:34:54 PM) jcastro: <HoellP> QUESTION: How do I send F* keys to the remote screen session i'm viewing in my local session? (02:35:03 PM) kirkland: tm: basically, i had ionice/cpunice'd screen-profiles to the point at which there was lag; i've disabled this in the update (02:35:21 PM) tm: ah (02:35:25 PM) tm: thanks! (02:35:28 PM) kirkland: HoellP: screen within screen? (02:35:39 PM) HoellP: yes... (02:35:49 PM) kirkland: HoellP: don't :-) or, if you figure out how, tell me :-) (02:36:05 PM) kirkland: so to better answer HoellP's question, i do my screening like this ... (02:36:17 PM) kirkland: i open one gnome-terminal tab per server I connect to (02:36:27 PM) kirkland: so one ssh-session per gnome-terminal tab (02:36:40 PM) kirkland: and then in each ssh/tab, I run screen, with multiple windows per server (02:37:39 PM) kirkland: jcastro: okay, i'll move on to set 3 ... (02:37:46 PM) kirkland: jcastro: and take a few more questions after (02:37:56 PM) jcastro: sure! (02:38:02 PM) kirkland: so, ladies and gents ... let's try this on your own system (02:38:11 PM) kirkland: if you're running jaunty, you can just run 'screen' (02:38:20 PM) kirkland: if you're not, head over to the PPA that jcastro pasted (02:38:31 PM) kirkland: and install screen-profiles from there (02:38:33 PM) jcastro: https://launchpad.net/~screen-profiles/+archive/ppa (02:38:50 PM) kirkland: (note that the screen-profiles from that PPA is newer than the one in Jaunty, and as such includes *even more* features) (02:39:18 PM) kirkland: once the screen-profiles package is installed, run 'screen' (02:39:28 PM) kirkland: the first time you run it, it should prompt you to select a profile (02:39:37 PM) kirkland: the 'plain' profile is actually not a screen profile (02:39:47 PM) kirkland: rather, this is the system default /etc/screenrc (02:39:59 PM) kirkland: very boring, includes *none* of the features i've been discussing (02:40:12 PM) kirkland: as such, upstream, i've renamed this NONE instead of plain (02:40:25 PM) kirkland: the screen-profiles package just comes with light, dark, and black (02:40:29 PM) kirkland: 3 very simple profiles (02:40:39 PM) kirkland: install screen-profiles-extras for about a dozen other colors (02:40:54 PM) kirkland: so choose, one of those profiles, and now you're in screen (02:41:02 PM) kirkland: play with the F-keys (02:41:10 PM) kirkland: hit F2 to open a new window (02:41:20 PM) kirkland: run something in that window, maybe "top" (02:41:35 PM) kirkland: hit f3/f4 to switch back and forth between your windows (02:41:45 PM) kirkland: now, let's detach, and reattach (02:41:48 PM) kirkland: hit F6 (02:42:01 PM) kirkland: that'll detach, but your program (top, etc) will still be running the background (02:42:12 PM) kirkland: i use this *all the time* when I'm doing something like a big wget, or rsync (02:42:19 PM) kirkland: now, reattach with "screen -r" (02:42:25 PM) kirkland: you should be back in your screen session (02:42:36 PM) kirkland: now, let's try scrollback mode (02:42:47 PM) kirkland: (i'll demo this in the ec2 session for anyone not doign this locall) (02:43:09 PM) kirkland: if you're in the ec2 session, go to the leftmost window (02:43:17 PM) kirkland: if you're doing this locally, hit F7 (02:43:32 PM) kirkland: this will put you in a vi-like mode scrolling and searching (02:43:50 PM) kirkland: you can type terms and search just like vi (02:44:07 PM) kirkland: also, this is per-window (02:44:25 PM) kirkland: so if you hit f4, and go to your next window, and enter scrollback, you're scrolling for that window (02:44:41 PM) kirkland: also, try F9 (02:44:56 PM) kirkland: you can adjust your screen-profile's colors (02:45:00 PM) kirkland: toggle status notifications (02:45:03 PM) kirkland: install screen by default (02:45:12 PM) kirkland: or uninstall screen by default at login (02:45:17 PM) kirkland: if you do enable that (02:45:23 PM) kirkland: detach (F6) (02:45:25 PM) kirkland: then ssh localhost (02:45:34 PM) kirkland: such that you login (02:45:51 PM) kirkland: you should see screen launch by default, re-attaching to your most recent screen session (02:46:12 PM) kirkland: jcastro: i'll pause again for questions ... wanna paste a few here? (02:46:43 PM) jcastro: <haliner> QUESTION: How do you set up the read-only session? (02:46:50 PM) jcastro: popular question. :p (02:46:55 PM) kirkland: haliner: ah :-) (02:46:59 PM) kirkland: that's a complicated one (02:47:04 PM) kirkland: let me get you a url ... (02:47:13 PM) kirkland: http://www.linux.com/feature/56443 (02:47:14 PM) jcastro: we can perhaps blog that later or something (02:47:22 PM) jcastro: I am sure lots of people can think of creative ways to use this (02:47:25 PM) kirkland: basically, you have to make /usr/bin/screen.real setuid (02:47:31 PM) jcastro: <gQuigs> QUESTION: just closing gnome-terminal keeps screen open and running.. doing that won't break anything right? (02:47:31 PM) kirkland: then play with screen's acl's (02:47:39 PM) jcastro: <gQuigs> aka.. do we really need to manually detach (02:47:58 PM) kirkland: see http://manpages.ubuntu.com/manpages/jaunty/en/man1/screen.1.html, chacl (02:48:24 PM) kirkland: gQuigs: right (02:48:35 PM) kirkland: gQuigs: you can manually detach, if that's what you explicitly want to do (02:48:53 PM) kirkland: in fact, as you "leave" the ec2 shared screen session, that's probably the only way you can do it (02:48:53 PM) jcastro: <ktenney> does scrollback offer selection, yank, paste ... (02:49:00 PM) kirkland: ktenney: yes! (02:49:26 PM) kirkland: ktenney: see "copy" mode in http://manpages.ubuntu.com/manpages/jaunty/en/man1/screen.1.html (02:49:43 PM) kirkland: ktenney: F7 is just a keybinding that puts you straight into copy/scrollback mode (02:50:13 PM) kirkland: jcastro: any other pending questions? (02:50:42 PM) jcastro: nope, continue (02:50:48 PM) kirkland: jcastro: cool (02:50:54 PM) jcastro: but BugeyeD say: can 'leave' by disconnecting via ssh as well: <enter>~. (02:50:57 PM) kirkland: okay ... last feature i'm going to go over (02:51:04 PM) kirkland: jcastro: BugeyeD: cool, thanks. (02:51:23 PM) kirkland: so siretart has packaged screen-profiles for debian (02:51:36 PM) kirkland: and i've heard mumblings that others are working on it for other distros too (02:51:52 PM) kirkland: but people have asked me quite a bit about screen-profiles on other linux systems (02:51:56 PM) jcastro: james wilcox has put it in opensuse (02:52:03 PM) kirkland: jcastro: righto (02:52:20 PM) kirkland: but what about ubuntu systems, where you don't have admin access, but you want to run screen-profiles? (02:52:21 PM) kirkland: aha! (02:52:26 PM) kirkland: screen-profiles-export (02:52:42 PM) kirkland: from a system where you do have screen-profiles, you can run the screen-profiles-export command (02:53:05 PM) kirkland: this will create a tarball that you can unzip on almost any linux system that has screen installed (02:53:15 PM) kirkland: and you'll get about 90% of screen-profiles functionality (02:53:21 PM) kirkland: you won't get the F9 menu command (02:53:30 PM) kirkland: (the python-newt deps aren't everywhere) (02:53:38 PM) kirkland: but you can cd ~/.screen-profiles (02:53:49 PM) kirkland: and manually edit the mostly-intuitive configuration files there (02:54:13 PM) kirkland: such as ~/.screen-profiles/status (02:54:26 PM) kirkland: that's how you turn on/off the status notifications in the bottom window (02:55:09 PM) kirkland: so that's about all i have to say (02:55:14 PM) jcastro: woo! (02:55:21 PM) kirkland: i have some new features planned for karmic (02:55:25 PM) dresi: hi! (02:55:33 PM) kirkland: or, if you use the screen-profiles PPA, you'll get this sooner ;-) (02:55:41 PM) dresi: i am from spain. Any person talnking in spanish? (02:55:51 PM) jcastro: dresi: #ubuntu-classroom-chat please (02:55:55 PM) dresi: ok (02:56:08 PM) kirkland: i'll take any other questions at this point (02:56:16 PM) kirkland: or turn it over to jcastro ;-) (02:56:30 PM) jcastro: ok, thanks dustin! (02:56:36 PM) jcastro: what's your blog so we can follow along? (02:56:48 PM) kirkland: jcastro: :-) http://blog.dustinkirkland.com (02:57:10 PM) kirkland: i will be booting everyone off of ec2 now :-) (02:57:14 PM) Veeyawn: Thanks Dustin (02:57:23 PM) thegrieve: /me cheers (02:57:24 PM) somnoliento: This was awesome! thanks! (02:57:25 PM) thegrieve: hehe (02:57:34 PM) thegrieve: thanks alot (02:57:37 PM) JFo: screen is my new favorite thing (02:57:41 PM) JFo: thanks kirkland (02:58:20 PM) kirkland: ||^o (02:58:29 PM) ***kirkland takes a bow (02:58:57 PM) ***gQuigs claps (02:59:14 PM) kirkland: #screen-profiles if you want to discuss further, with other members of the screen-profiles community (03:00:13 PM) jcastro: kirkland: what was the final cost of the demo? (03:00:23 PM) jcastro: according to the applet? (03:00:25 PM) kirkland: jcastro: $0.42 (03:00:28 PM) kirkland: (appropriate)
MeetingLogs/openweekJaunty/Screen (last edited 2009-04-27 19:10:20 by pool-70-16-48-183)