From the Canyon Edge -- :-Dustin
Showing posts with label Byobu. Show all posts
Showing posts with label Byobu. Show all posts

Tuesday, September 30, 2014

Apply updates to multiple systems simultaneously using Byobu and Shift-F9

A StackExchange question, back in February of this year inspired a new feature in Byobu, that I had been thinking about for quite some time:
Wouldn't it be nice to have a hot key in Byobu that would send a command to multiple splits (or windows?
This feature was added and is available in Byobu 5.73 and newer (in Ubuntu 14.04 and newer, and available in the Byobu PPA for older Ubuntu releases).

I actually use this feature all the time, to update packages across multiple computers.  Of course, Landscape is a fantastic way to do this as well.  But if you don't have access to Landscape, you can always do this very simply with Byobu!

Create some splits, using Ctrl-F2 and Shift-F2, and in each split, ssh into a target Ubuntu (or Debian) machine.

Now, use Shift-F9 to open up the purple prompt at the bottom of your screen.  Here, you enter the command you want to run on each split.  First, you might want to run:

sudo true

This will prompt you for your password, if you don't already have root or sudo access.  You might need to use Shift-Up, Shift-Down, Shift-Left, Shift-Right to move around your splits, and enter passwords.

Now, update your package lists:

sudo apt-get update

And now, apply your updates:

sudo apt-get dist-upgrade

Here's a video to demonstrate!


In a related note, another user-requested feature has been added, to simultaneously synchronize this behavior among all splits.  You'll need the latest version of Byobu, 5.87, which will be in Ubuntu 14.10 (Utopic).  Here, you'll press Alt-F9 and just start typing!  Another demonstration video here...




Cheers,
Dustin

Tuesday, August 12, 2014

Learn Byobu in 10 minutes while listening to Mozart


If you're interested in learning how to more effectively use your terminal as your integrated devops environment, consider taking 10 minutes and watching this video while enjoying the finale of Mozart's Symphony No. 40Allegro Assai (part of which is rumored to have inspired Beethoven's 5th).

I'm often asked for a quick-start guide, to using Byobu effectively.  This wiki page is a decent start, as is the manpage, and the various links on the upstream website.  But it seems that some of the past screencast videos have had the longest lasting impressions to Byobu users over the years.

I was on a long, international flight from Munich to Newark this past Saturday with a bit of time on my hands, and I cobbled together this instructional video.    That recent international trip to Nuremberg inspired me to rediscover Mozart, and I particularly like this piece, which Mozart wrote in 1788, but sadly never heard performed.  You can hear it now, and learn how to be more efficient in command line environments along the way :-)


Enjoy!
:-Dustin

Thursday, November 7, 2013

Byobu's Ubuntu Color Scheme for Manpages and Grep

I've been trying to bring Ubuntu's beautiful color palette to the command line through Byobu, starting with the command prompt, by defining a new $PS1 value.

As of Byobu 5.63 (in Trusty now, or in the Byobu PPA for other Ubuntu releases), we now have an Ubuntu theme for less, the default interface for reading manpages at a command line, as well as grep.

Double bright mode is defined to a lighter shade of Ubuntu orange, standout mode is either background Ubuntu orange or italics (depending on your terminfo), and underline mode is a lighter shade of aubergine.

Grep highlights matches in an Ubuntu orange.  A special thanks to goes to Nick Moffit for that one, who is quite proudly not a Byobu user :-)

Here are some screenshots of Gnome Terminal with a few of the default color profiles.  Enjoy!






:-Dustin

Wednesday, October 30, 2013

My Linux Rigs

Steven Ovadia graciously invited me to participate in his collection of Linux desktops surveyed in his blog, My Linux Rig...  My answers to his interview are cross-posted on both his site and mine.  Enjoy!

1. Who are you, and what do you do?

My name is Dustin Kirkland.

I work for Mark Shuttleworth at Canonical, as a Product Manager on the Ubuntu Cloud, building enterprise solutions and server products on top of Ubuntu.  My work on open source software at Canonical often spills over into my nights and weekends, developing free software for fun as well. I have authored, and continue to maintain over two dozen open source projects, including Byobu, eCryptfs, among others.

2. Why do you use Linux?

I have been using Linux since 1997, when I was in college at Texas A&M University.  For one Computer Science class, I was "required" to buy a Zip Drive, which could hold 100MB on a special (i.e. expensive) proprietary disk cartridge.  This seemed like an absolutely awful solution to the problem of carrying data from one place to another (and Dropbox wouldn't be invented for another 11 years).

I negotiated with that professor to let me use a web server on the Internet for uploading and downloading my assignments.  So I bought a few hundred MBs from a web host in 1997.  When I received my credentials, I quickly realized that I would need an SSH client and that I would have to learn Red Hat Linux.  So I bought a book and immediately fell in love!

I used Red Hat Linux until Fedora was released, running that until 2006 when I first installed Ubuntu.  My wife was an elementary school teacher at the time, and I installed Edubuntu on a couple of perfectly-working-but-old computers that her school had basically thrown away :-(  I rescued them out of the trash, and installed Ubuntu 6.06 LTS (Dapper Drake).  Days later, I installed MythTV on Ubuntu on several machines I had throughout the house, and I was smitten.  I never really returned to Red Hat based system.  Almost everything in Ubuntu just worked, and where it didn't, there was an abundance of quality documentation.

Professionally, I worked at IBM in Tivoli and the Linux Technology Center in Austin, TX from 2000-2007, on various aspects of Linux security and certifications.  I also spent most of 2005 working for IBM on-site at Red Hat in Westford, MA, making some excellent friends and helping enable RHEL on PowerPC.  In 2008, I started working at Canonical, as one of the early developers building the Ubuntu server and virtualization platform.

We run Linux almost exclusively in the Kirkland house.  Looking at my dd-wrt router for static IP leases, I can count over 40 active Linux devices currently drawing IP addresses!  A couple of laptops (Ubuntu, ChromeOS), desktops (Ubuntu), routers (dd-wrt), TVs, PS3's, phones (Android, Ubuntu Touch), tablets (Android, Ubuntu Touch), Kindles, a Chumby, a Raspberry Pi, Synology NAS, etc.  I do have one Mac Mini running OS X, for a few apps that have no viable workaround on Linux (mostly crappy teleconference software used by Windows/Mac users).

Across the board, Linux has given me the power and flexibility I expect out of computing systems, for nearly two decades.  And what's most amazing is that it just keeps getting better!

3. What distribution do you run on your main desktop/laptop?

Ubuntu.  I am an Ubuntu Core Developer, and I tend to run the development (bleeding edge) Ubuntu Desktop and Server (in virtual machines and containers).

4. What desktop environment do you use and why do you use it?

Unity.  I use Unity mostly in the interest of dog-fooding the default Ubuntu setup.  Frankly, I have very little need of a desktop environment.  Unity works fine for me.  Though so does Gnome, KDE, XFCE, etc.

Basically, I need a browser (Chromium), an IRC client (xchat2), a terminal (gnome-terminal), and my desktop manager to stay out of my way :-)

5. What one piece of software do you depend upon with this distribution? Why is it so important?

Byobu.

I use Byobu all day, every day.  I usually run Byobu in a gnome-terminal, maximized on a 1920x1080 Samsung 40" LCD.  I then use splits (Shift-F2, Ctrl-F2) to carve up my terminal into smaller panes.  Some horizontal (builds or something with lots of scrolling output), some vertical (side-by-side code review), some combinations (dev + test + monitoring) -- whatever makes sense for my current task.  I use the keyboard to navigate around those splits (Shift-Up/Down/Left/Right).  Sometimes I'll create a new window (F2), if I want to background some work in a separate window, with its own splits.  If I need to SSH to a remote system, I open a new tab in gnome-terminal (Shift-Ctrl-t), and attach to a remote Byobu session, where perhaps I've left some other work running in the background.  I use Byobu's status line at the bottom to monitor what machine I'm on, it's distro and version, an updates that are available, uptime count, CPU speed and temperature, battery level, WiFi signal, system load, memory usage, hostname/IP address, and the time/date.  Byobu adds hours of productivity to my work week, every week :-)

6. What kind of hardware do you run this setup on?

I currently use a Thinkpad x230 with a dual-core hyper-threaded i7, 16GB of RAM, 240GB Intel SSD, 9-cell battery.

I absolutely love the 12" form factor, as it's nice an compact for traveling while still offering beast mode CPU/Memory.  The 9-cell battery gives me 8+ hours of up time.  I tend to replace my primary laptop on a yearly basis and sell my gently used model on CraigsList, or give it to a family member.

When I'm not traveling or working from my front/back porch, I keep it in a docking station, attached to a 40" Samsung LCD (primary monitor) and a 23" Samsung LCD (secondary monitor), a Logitech c920 web cam, Klipsch THX 2.1 speakers, gigabit Ethernet, a Simtec entropy key, a Yubikey multi-factor auth, and a Thinkpad USB keyboard.

I have used Thinkpads since about 2000, and I'm generally a pretty big fan.  I simply cannot live without "the dot".  I might consider an HP or Dell laptop sometime, but it absolutely must have a Track point, as I like to keep my fingers on the keyboard, in the home position, and still have access to the cursor.  I disable touch pads with a vengeance, and then curse the engineers who continue to embed them in laptops :-)

7. Will you share a screenshot of your desktop?

Sure.  I usually run my browser/terminal/IRC maximized in the 40" monitor on the left, and use the 23" monitor on the right only when using Skype or G+ Hangouts.  The background is just the stock Ubuntu background.  No icons on my desktop.  Ever, ever, ever.


Cheers!
:-Dustin

Wednesday, October 16, 2013

Byobu T-shirts are here!


Byobu t-shirts are here!  I just received mine in the mail today and I'm really, really pleased with the comfort and quality!


Super comfortable American Apparel® brand, made from sustainable organic cotton.  I ordered the off white, with unique green stitching, featuring the vector rendered Byobu logo and the Ubuntu font.

Though it is also available in classic hack3r black ;-)  My closet is pretty loaded with black t-shirts, so I thought I'd change it up a bit.


You can show your support for the Byobu project, if you like, by ordering a shirt here.  Thanks!


Enjoy,
:-Dustin

Friday, September 20, 2013

Byobu Prompt Now Includes Exit Code of Previous Command and ⟫

Three changes landed in Byobu yesterday, just ahead of Ubuntu 13.10 User Interface Freeze.  These are incremental changes on the work I recently introduced with Byobu's fancy new $PS1 command prompt...


  1. The prompt now shows the previous command's exit status, if it's non-zero.  This integer is the $? exit code of the previous command.  I was sitting next to Martin Pitt in New Orleans, at the Linux Plumbers conference and immediately fell in love with this idea.  How many times have we not noticed that the previous command exited non-zero...  Never again!!!
  2. The prompt now ends with ⟫ instead of ❭.  I tested every terminal I could get my hands on in Ubuntu, including: gnome-terminal, xterm, uxterm, terminator, konsole.  It turns out that the ⟫ symbol is rendered correctly in more of these (xterm and friends) than ❭.
  3. There is also a new keybinding, Alt-F5, which toggles on and off UTF-8 support in the status bar and on the PS1.  The goal here is to provide a fix and an easy escape route when you end up in a terminal that does not properly support UTF-8 out of the box (and Byobu is not able to accurately determine this), like here and here.
Of course, you can always trivially enable and disable Byobu's prompt using:

byobu-enable-prompt
and
byobu-disable-prompt

Cheers,
Dustin

Tuesday, August 27, 2013

Ubuntu Fun with $PS1

tl;dr? 
From within byobu, just run:
byobu-enable-prompt

Still reading?

I've helped bring a touch of aubergine to the Ubuntu server before.  Along those lines, it has long bothered me that Ubuntu's bash package, out of the box, creates a situation where full color command prompts are almost always disabled.

Of course I carry around my own, highly customized ~/.bashrc on my desktop, but whenever I start new instances of the Ubuntu server in the cloud, without fail, I end up back at a colorless, drab command prompt, like this:


You can, however, manually override this by setting color_prompt=yes at the top of your ~/.bashrc, or your administrator can set that system-wide in /etc/bash.bashrc.  After which, you'll see your plain, white prompt now show two new colors, bright green and blue.


That's a decent start, but there's two things I don't like about this prompt:
  1. There's 3 disparate pieces of information, but only two color distinctions:
    • a user name
    • a host name
    • a current working directory
  2. The colors themselves are
    • a little plain
    • 8-color
    • and non-communicative
Both of these problems are quite easy to solve.  Within Ubuntu, our top notch design team has invested countless hours defining a spectacular color palette and extensive guidelines on their usage.  Quoting our palette guidelines:


"Colour is an effective, powerful and instantly recognisable medium for visual communications. To convey the brand personality and brand values, there is a sophisticated colour palette. We have introduced a palette which includes both a fresh, lively orange, and a rich, mature aubergine. The use of aubergine indicates commercial involvement, while orange is a signal of community engagement. These colours are used widely in the brand communications, to convey the precise, reliable and free personality."
With this inspiration, I set out to apply these rules to a beautiful, precise Ubuntu server command prompt within Byobu.

First, I needed to do a bit of research, as I would really need a 256-color palette to accomplish anything reasonable, as the 8-color and 16-color palettes are really just atrocious.

The 256-color palette is actually reasonable.  I would have the following color palette to chose from:


That's not quite how these colors are rendered on a modern Ubuntu system, but it's close enough to get started.

I then spent quite a bit of time trying to match Ubuntu color tints against this chart and narrowed down the color choices that would actually fit within the Ubuntu design team's color guidelines.


This is the color balance choice that seemed most appropriate to me:


A majority of white text, on a darker aubergine background.  In fact, if you open gnome-terminal on an Ubuntu desktop, this is exactly what you're presented with.  White text on a dark aubergine background.  But we're missing the orange, grey, and lighter purple highlights!


That number I cited above -- the 3 distinct elements of [user, host, directory] -- are quite important now, as they map exactly to our 3 supporting colors.

Against our 256-color mapping above, I chose:
  • Username: 245 (grey)
  • Hostname: 5 (light aubergine)
  • Working directory: 5 (orange)
  • Separators: 256 (white)
And in the interest of being just a little more "precise", I actually replaced the trailing $ character with the UTF-8 symbol ❭.  This is Unicode's U+276D character, "MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT".  This is a very pointed, attention-grabbing character.  It directs your eye straight to the flashing cursor, or the command at your fingertips.


Gnome-terminal is, by default, set to use the system's default color scheme, but you can easily change that to several other settings.  I often use the higher-contrast white-on-black or white-on-light-yellow color schemes when I'm in a very bright location, like outdoors.


I took great care in choosing those 3 colors that they were readable across each of the stock schemes shipped by gnome-terminal.



I also tested it in Terminator and Konsole, where it seemed to work well enough, while xterm and putty aren't as pretty.

Currently, this functionality is easy to enable from within your Byobu environment.  If you're on the latest Byobu release (currently 5.57), which you can install from ppa:byobu/ppa, simply run the command:

byobu-enable-prompt

Of course, this prompt most certainly won't be for everyone :-)  You can easily disable the behavior at any time with:

byobu-disable-prompt

While new installations of Byobu (where there is no ~/.byobu directory) will automatically see the new prompt, starting in Ubuntu 13.10 (unless you've modified your $PS1 in your ~/.bashrc). But existing, upgraded Byobu users will need to run byobu-enable-prompt to add this into their environment.

As will undoubtedly be noted in the comments below, your mileage may vary on non-Ubuntu systems.  However, if /etc/issue does not start with the string "Ubuntu", byobu-enable-prompt will provide a tri-color prompt, but employs a hopefully-less-opinionated primary colors, green, light blue, and red:



If you want to run this outside of Byobu, well that's quite doable too :-)  I'll leave it as an exercise for motivated users to ferret out the one-liner you need from lp:byobu and paste into your ~/.bashrc ;-)

Cheers,
:-Dustin

Sunday, January 20, 2013

Introducing the byobu.co website!

It's hard to believe that it's been almost a year since the last Byobu blog post here!  How time flies :-)  I've been a little busy on the home front, as well as the work front in the last year, so hopefully you'll forgive me...

But at this time, I'm delighted to introduce the new Byobu community website at byobu.co.


The layout is loosely based on the same template as our eCryptfs.org site.  And likewise, here, you'll find all the usual links in an open source project website.

  • About the project
  • Download and installation instructions for:
    • Arch, Debian, Fedora, Gentoo, Mac OS, Mint, and Ubuntu
  • Source code links for Launchpad and Github
  • Support and FAQs
  • Documentation and manpages
  • News links

Also new...

As usual, feedback and suggestions are welcome.

Cheers,
:-Dustin

Tuesday, March 27, 2012

Some Statistics on mondrian.byobu.co (as a honeypot)

Just following up on my recent post about Piet Mondrian and Byobu...

I had planned on running the guest@mondrian.byobu.co HP/OpenStack instance for just one day, but I've actually kept it running for 3 weeks now!

I compiled a few statistics for you over those 3 weeks.  There have been:
  • 2,405 successful password authentications as the guest user!
  • 308 successful public key authentications as the ubuntu user
    • from 2 different IP addresses which I can confirm are both mine (home and office), whew!
  • 16,002 failed password attempts for the root user
    • seriously, people?
  • 6,813 more failed password attempts for some 4,929 other random invalid users on the system, originating from the following malicious IP addresses, damn you!
    • 108.15.99.40
    • 115.178.77.152
    • 115.238.176.98
    • 118.67.249.136
    • 119.10.114.200
    • 121.14.46.119
    • 123.125.149.134
    • 123.215.30.134
    • 124.238.214.46
    • 176.32.184.75
    • 199.119.204.3
    • 211.91.224.131
    • 216.196.184.5
    • 216.230.144.226
    • 222.174.35.3
    • 60.31.123.54
    • 61.135.199.195
    • 61.50.247.173
    • 68.169.46.31
    • 76.176.60.100
Well that was a fun honeypot :-)  Does anyone know of some fun utilities that I could point at my /var/log/auth.log* for more in depth analysis?

So take this as a lesson....  Make sure you disable password authentication on your servers.  There are automated unsavory types out there, all of the time, constantly poking and prodding at your cloud instances, looking for an easy way in!

:-Dustin

Friday, March 9, 2012

Video Podcast with Amber Graner

I spent a good half hour on Monday morning with Amber Graner of Linaro.  This was my first experience with G+ On Air, a mechanism for conducting video interviews over G+ Hangouts and record them for rebroadcast over YouTube later.

I've known Amber for nearly 4 years now, and she's such a warm, fun, and energetic person.  I'm always humbled by her interest and willingness to branch out and learn about new technologies.  She's truly an inspiration for us all :-)

In this interview, we talked about Linaro, ARM, Android, Ubuntu, Cloud, Gazzang, Encryption, eCryptfs, and (of course) Byobu :-)  Enjoy!




:-Dustin

Wednesday, March 7, 2012

Byobu is Celebrating Piet Mondrian's 140th Birthday

A little while ago, I added a fun Easter Egg to Byobu, in honor of one of my favorite artists, Piet Mondrian [Wikipedia, Artsy].

All day today, you'll be able to ssh into a shared Byobu session in HP's OpenStack cloud and see the Easter Egg in action!
  • ssh guest@mondrian.byobu.co
The password is piet.

March 7, 2012 happens to be Piet Mondrian's 140th birthday!


For an engineer and a scientist, I'm probably more of an art lover than most.  I studied art history a bit in college, and even worked for the art department at Texas A&M University, which earned me a few free art classes over my usual engineering workload.  I generally seek out both boutique art galleries and the big ones when traveling.  All that said, Piet Mondrian is one of my favorite artists.  His lines, colors, proportions, precision, balance, symmetry and asymmetry speak to a part of my soul that's hard to explain.

You might recognize some of these, as his most recognizable works:






In the spirit of Google Doodles, I thought I'd call attention to Byobu's Piet Mondrian function quietly nestled in Byobu.  If you're running byobu in tmux mode (which you can launch with byobu-tmux), then you can simply press ctrl-alt-F12 in most environments (my sympathies if you're off the beaten path).  You should see something like this:



This is the output of the 116 line shell script found at /usr/lib/byobu/include/mondrian.  I don't think I've ever narrated my source code in my blog before, but I reckon I will do so here.  It's not that I'm particularly proud of the implementation or the code, but rather that I'd like to explain the algorithm I have applied to Mondrian's art :-)
  1. First, it hardcodes the color values of red, yellow, blue, and white from a 256 color palette.  To do so, I used the color picker utility in gimp against Mondrian's Composition 10, 1939–1942.
  2. Next, it chooses some random number of rectangles between 10 and 40, which seemed to me to be fairly representative of most of Mondrian's geometric compositions.
  3. Then, from the randomly numbered rectangles, 3 are chosen -- 1 for red, 1 for yellow, and 1 for blue.  I fully well appreciate that Mondrian put far more thought into what regions where colored, and which color, how much, with great precision and balance.  I hope one day to decode his algorithm, but for now, my code simple chooses these at random.
  4. Now, tmux does a bit of the hard work for us, creating a new window in byobu, sets the background to our particular white, and splitting that window into a number of panes matching our randomly chosen amount.
  5. Finally, one pane each is colored red, yellow, and blue.  Note that tmux does not support the classic UNIX terminal feature bce (background color erase), so instead, we use a one-line perl script to color each pane.
And there you have it!  A random approximation of a Mondrian composition right there in your terminal!

Here's a few images produced by implementation of the algorithm above...






Now surely I'm not the first programmer/art-lover who has tried to reproduce Mondrian masterpieces in source code?

Hardly!!! :-)

In 1966, Michael Noll of Bell Labs produced this incredibly interesting paper and research project, where his computer program produced a reproduction of a Mondrian work (Composition with Lines, 1917), and presented it to 100 human subjects.


Only 28% of the human subjects were able to determine the computer generated replica.  Somehow, 59% preferred the computer generated piece!  (I am not in that majority.)

So it seems I'm hardly the first, and Mondrian has been piquing the interest of computer programmers for at least 50 years.  To the contrary, it seems more likely to me that Mondrian was so far ahead of his time that he may have presupposed the precision and mathematics of computer generated images.

Hats off to you, Mondrian.  Rest assured that many, many people continue to enjoy your work, and it continues to inspire artists and engineers alike!

:-Dustin

Thursday, January 26, 2012

UDW: Pair Programming and Code Reviews in the Cloud

Next week is yet another installment of the Ubuntu Developer Week education series.  If you been wanting to get involved in Ubuntu or Free Software development, or perhaps just hone your existing skill set, please join us in #ubuntu-classroom on irc.freenode.net Tuesday/Wednesday/Thursday next week.  Check the schedule, and hopefully you'll find something that piques your interest.

I'm pleased to note that each member of Gazzang's engineering team will be attending at least two sessions per day!  With today's shrinking education budgets, perhaps you can convince your employer to let you attend some excellent, continuing technical education at no additional expense to them.  Should be an easy sell ;-)

I will be leading an hour long session on Thursday, February 2nd from 18:30-19:30 UTC -- that's 12:30pm-1:30pm in my local Central Standard Time.  My session is on Pair Programming and Code Review in the Cloud.

I've used Pair Programming for years -- ever since I was introduced to the Extreme Programming methodologies in the Tivoli Bootcamp as an intern in 2000.  Pair Programming is a relatively simple concept -- two people, one keyboard and screen.  It's a great way to teach, learn, and review code.  Back then, we were a couple of developers, sitting side by side in the Arboretum in Austin, Texas.

But times have changed!  It's highly unlikely that I'm sitting next to the person I need to pair program with.  Rather, they're sitting somewhere far across the world.

Welcome to 2012!  I'll spend an hour, sharing a screen with a few dozen of you, showing you how some Ubuntu developers work with colleagues across the world, through the Cloud!

I'm going to fire up Amazon's largest instance splurging $2.10 an hour for 60GB of RAM and 16 CPUs.  You hardly need this, but I thought it would be fun.  If nothing else, drop in and have a look at what this kind of hardware looks like :-)  We'll import SSH public keys and users will SSH into a shared Byobu/Tmux session, where I'll demonstrate how to make the most use of our screen resources.  We'll split the window horizontally and vertically, look at code side by side, while still tailing log files and conducting builds.

Prerequisites:

  • A terminal and an SSH client with Internet access
And to maximize your experience:


As a teaser, here's what my terminal currently looks like, and a taste of where we'll get to, in this session.    This session can be detached and reattached later, or even by multiple users at the same time.

I have 8 panes open in a single Byobu session.  The first two windows have some eCryptfs source code (mount.ecryptfs_private.c and pam_ecryptfs.c).  Next, I have a little test window where I'm checking my changes, with a foobar@x220 user logged in, and it's just above a small window where I'm reading some manpage documentation.  To the far right, I'm re-compiling the new ecryptfs sources.  Across the bottom, I'm tailing 4 log files (kern.log, dmesg, auth.log, syslog).  Note that I'm using tail -f and ccze for colorized log files -- which really helps separate warnings and errors (in warm reds and yellows) from the rest (in cool blues and greens).

Hope to Pair Program with you on Thursday!

Cheers,
:-Dustin

Monday, December 26, 2011

Byobu 5 Released!


Happy Holidays everyone!  And for you, I have a gift -- Byobu 5.0!

I've been working hard over the last few months pulling together some big changes in the 4.x series, culminating in yesterday's release.  I gave an early preview during a lightning talk (31:02 mark) at the Ubuntu Developer Summit in Orlando, Florida a couple of months ago.

History

The Byobu project started a little over 3 years ago as a set of best practices and configuration profiles for GNU Screen with the screen-profiles package.  Byobu builds on top of existing text-based window managers and adds real-time dynamic status reporting, helper configuration utilities, and convenient keybindings.

Earlier this year, we started to reach the limits of what we could do with GNU Screen within Byobu.  The GNU Screen project hasn't been officially released in over 3 years, and Ubuntu is currently carrying nearly 20,000 lines in 48 patches to the upstream source.   I started looking into alternatives and learned a bit about Tmux, a newly redesigned and actively maintained window manager springing from the OpenBSD project.  The code is modern and elegant, and has an excellent programmable interface.  In June, I polled some Byobu users, asking of their interest in Tmux and the response was overwhelming!  I started porting Byobu to Tmux almost immediately.

New in 5.0

The most significant change that Byobu 5.0 introduces is a shift from GNU Screen to Tmux as the default backend.  You can still run Byobu in Screen-mode, but the default experience now uses Tmux.

Selecting your Back end

You can select your default back end using:

$ byobu-select-backend 

Select the byobu backend:
  1. tmux
  2. screen

Choose 1-2 [1]: 

After which, just running byobu will use your selected back end.  Alternatively, you can run byobu-screen or byobu-tmux at any time, to launch Byobu with a particular back end.

The New Byobu Look

When you start Byobu 5.0, you may notice a couple of immediate changes.  For starters, there's only one line of status at the bottom.  Your windows and status items are all in the same line.  You can set multiple status combinations in your ~/.byobu/status line, and cycle through them using Shift-F5.  Personally, I run Byobu maximized and use horizontal and vertical splits for efficiency (more on that in a minute!).


Tmux offers several advantages in the status line, namely: UTF8 characters and 256 colors.  If you look at the lower left of the screen shot, you should see the Ubuntu brandmark, u, as well as other nice symbols in the status bar, such as "▴2.0Mb ▾53kb".  Also, with 256 colors, we can get much closer to the right aubergine and orange.

The Help Menu

You can bring up Byobu's new help menu any time by pressing Shift-F1, with which you can find a comprehensive list of Byobu's keybindings.


Creating Windows, Splits, and Sessions

All of the "creation" actions are conveniently found under the F2 key.

  • Create new windows with F2
  • Create new horizontal splits with Shift-F2
  • Create new vertical splits with Ctrl-F2
  • Create new sessions with Ctrl-Shift-F2


Navigating Windows, Splits, and Sessions

As in previous versions, you can use F3 and F4 to move right and left among windows.

But far more intuitively, you can also use the up/down/left/right arrow keys with the alt/ctrl/shift modifiers.

  • Move between windows with Ctrl-Shift-Left and Ctrl-Shift-Right
  • Move between sessions with Alt-Up and Alt-Down
  • Move focus among splits with Shift-Up, Shift-Down, Shift-Left, and Shift-Right
    • Note that the split with the focus will be highlighted in purple
  • Re-size a split using Ctrl-Up, Ctrl-Down, Ctrl-Left, and Ctrl-Right
You can also:
  • Move a split using Ctrl-F3 and Ctrl-F4
  • Move a window using Ctrl-Shift-F3 and Ctrl-Shift-F4
The Status Bar

As usual, the F5 key deals with your status line.

  • Refresh all status and reload your profile with F5
  • Toggle through multiple status configurations with Shift-F5
  • Reconnect ssh, gpg, dbus, and X sessions with Ctrl-F5
    • sometimes, these connections become stale on session disconnect/reconnect
  • Randomly select the background color of the status line with Ctrl-Shift-F5
    • visually identify each system by its unique color
Disconnecting and Reconnecting Sessions

The F6 key handles disconnecting and detaching.
  • Detach the current session and logout with F6
  • Detach the current session, but do not logout with Shift-F6
  • Kill the current split with Ctrl-F6
Running byobu will automatically prompt you to select a session, if there are more than one running.  Or running byobu-select-session will also list the available sessions and prompt for selection.

$ byobu-select-session 

Byobu sessions...

  1. tmux: 0: 8 windows (created Sun Dec 25 09:59:05 2011) [170x42]
  2. tmux: 1: 1 windows (created Sun Dec 25 10:00:46 2011) [170x42]
  3. tmux: 3: 2 windows (created Sun Dec 25 12:30:55 2011) [136x36]
  4. Create a new Byobu session (tmux)
  5. Run a shell without Byobu (/bin/bash)

Choose 1-5 [1]: 

Scroll back and History

Each window and each split has an independent history buffer that can be scrolled and even searched, as usual with F7.

  • Enter scroll back with F7
  • Enter and navigate scroll back with Alt-PageUp and Alt-PageDown
  • Exit scroll back with Enter
  • Search scroll back with / and ? and then typing your search term
Window and Split Arrangement

As in previous versions, you can change a window's name with F8, but F8 also provides some advanced features around split arrangements.
  • Rename a window with F8
  • Cycle through preset split arrangements with Shift-F8
  • Restart a saved split layout with Ctrl-F8
  • Save the current split layout with Ctrl-Shift-F8
Configuration Window

As always, you launch the Byobu configuration menu with F9.  It's greatly simplified from previous versions.  (I'm actually hoping to deprecate it entirely one day, as the dependency on python-newt here has always been a little inconvenient from an upstream perspective.  I'm trying to make most of the features usable from key bindings.  Getting there eventually...)



Full Screen, Joining, and Breaking Out Splits

The F11 key is probably used by your X window manager to toggle a window from full screen and back.  Byobu uses Alt, Shift, and Ctrl and F11 to provide a few other features.

  • Break the current split out into a full window of its own with Alt-F11
  • Join the current window into a horizontal split with Shift-F11
  • Join the current window into a vertical split with Ctrl-F11
Escapes, Toggling Key bindings, and Piet Mondrian

The default escape sequence in Tmux is actually Ctrl-B.  To maintain consistency with Byobu and Screen, Byobu changes this back to Ctrl-A.  Byobu also loads a set of key bindings that operate Tmux with the same commands that are familiar to Screen users.
  • The F12 key is actually an alias for the escape sequence
  • Toggle on and off Byobu's key bindings with Shift-F12
    • this is useful when running programs that conflict with Byobu's keys, such as mc
  • For Piet Mondrian inspired fun, press Ctrl-Shift-F12




And with that, I'll leave you for now.  Give Byobu 5.0 a shot and let me know what you think.  Cheers everyone!  Hope you're having a wonderful holiday!

:-Dustin

Monday, December 12, 2011

I've Joined the Gazzang Team!


A few weeks ago, I joined a fun, new start-up company here in Austin called Gazzang.  I was a little surprised that this was published in the form of a rather flattering press release :-)  Let's just say that my Mom was very proud!

I know that some of you in the Ubuntu community are wondering how that career change will affect my responsibilities and contributions to Ubuntu.  I'm delighted to say that I'll most certainly continue to contribute to Ubuntu and many of my upstream projects.  Gazzang is quite supportive of my work in both Ubuntu and open source.

Most directly, you should see me being far more active in my regular maintenance, development, bug triage, and support of eCryptfs.  Gazzang's core business is in building information privacy and data security solutions for the Cloud.  eCryptfs is at the heart of their current products, and in my new role as Gazzang's Chief Architect, we're working on some interesting innovations in and around eCryptfs.  A healthy, high-quality, feature-filled, high-performance eCryptfs is essential to Gazzang's objectives, and I'm looking forward to working on one of my real passions in eCryptfs!

More specifically, looking at the projects I maintain, I expect to continue to be very active in:
  • eCryptfs (essential to my new job)
  • byobu (mostly around tmux, and because hacking on byobu is fun and awesome :-)
  • manpages.ubuntu.com and manpg.es (because that's how I read manpages)
  • musica (because that's how I've streamed music since 1998)
  • pictor (because that's how I've managed and shared pictures since 1998)
You'll probably see opportunistic development (nothing active, but when an opportunity or bugs spring up), including the usual bzr/launchpad dance, developing, testing, upstream releasing, packaging, and uploading to Ubuntu, of:
And finally, as prescribed by the Ubuntu Code of Conduct, I'm gracefully stepping away from a few other projects I've founded or maintained in the past.  I'll help out if and when I can, but for now I've transferred all of the necessary rights, responsibilities and ownership of:


Finally, I must say that the last 4 years have been the most amazing 4 years of my entire 12 year professional career.  It's been quite rewarding to witness the fledgling Ubuntu Server of February 2008 (when I joined Canonical), and the tiny team of 5 grow and evolve to the 20+ amazing people now working directly on the Ubuntu Server.  And that list doesn't even remotely cover the dozens (if not hundreds!) of others around Canonical and the Ubuntu Community who contribute and depend on the amazing Server and Cloud distribution that is Ubuntu.

I'm really looking forward to my new opportunities around Gazzang and eCryptfs, but you'll still most certainly see me around Ubuntu too :-)  As crooned by The Beatles...
You say "Yes", I say "No". \\ You say "Stop" and I say "Go, go, go". \\ Oh no. \\ You say "Goodbye" and I say "Hello, hello, hello". \\ I don't know why you say "Goodbye", I say "Hello, hello, hello". \\ I don't know why you say goodbye, I say hello!
 Cheers,
:-Dustinhttp://www.gazzang.com

Friday, September 16, 2011

Ubuntu Monospace Font

At long last, we have a Beta of the Ubuntu Monospace font available!  (Request membership to the  ubuntu-typeface-interest team in Launchpad for access.)

Here's a screenshot of some code open in Byobu in the new font!


It really has a light, modern feel to it.  I like the distinct differences between "0" and "O", and "1" and "l", which are often tricky with monospace fonts.  Cheers to the team working on this -- I really appreciate the efforts, and hope these land on the console/tty at some point too!

I've only encountered one bug so far, which looks to have been filed already, so I added a comment to: https://bugs.launchpad.net/ubuntu-font-family/+bug/677134  I think the "i" and "l" are a little too similar.  if-fi statements in shell are kind of hard to read.

Anyway, nice job -- looking forward to using this font more in the future!

Enjoy,
:-Dustin

Printfriendly