From the Canyon Edge -- :-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

Tuesday, October 8, 2013

Going paperless means, "Email me a PDF", not "Email me your URL"


I love going paperless.  When it's done properly, anyway.

My tiny little Austin, Texas lawn service does it correctly!  Ashley emails me once a month, thanking me for my business, and attaches a PDF invoice.  And I send them an electronic check.

While Wells Fargo, the largest bank in the world, does not...  Wells Fargo sends me an email, politely informing me that it is now my responsibility to log into their customer service portal, click through 3 links and then download my latest statement.  I'm sorry, but that's crap.

The positive, "green" environmental impact, saving some paper, is lovely of course.  What I really appreciate is having my own digital archive of information, from bills to legal documents, especially when coupled with something like Google Docs, that I can use to search, anywhere, any time.

That said, I find it completely unacceptable when accounts offer/suggest/insist that you "go paperless" with them, but rather than emailing you an HTML or PDF snapshot, they instead send you a link to log into their website and view your paperless account information.


This is, frankly, a very insidious form of vendor lock-in that cloud computing has invited into our daily lives, and most of us haven't even noticed it yet.

The burden has shifted from your account managers pushing (mailing) information to you, and instead it now resides on you to pull that information from their archive regularly and archive it on your end.

Before...


After...


Do you see the difference?

What happens when you close that account?  What happens when that entity goes out of business?  Or gets acquired?  Merges with a different entity?   Automatically expires some information as too-old-to-be-archived-any-longer?  Rolls out some completely unnecessary changes to their website interface which requires Internet Explorer? Or deprecates the archive functionality entirely?

Or worse, what happens when unethical business practices affect your personal account information and your data gets modified under you?  It's pretty trivial for a sysadmin or rogue process to update some records in a database and comprehensively regenerate millions of reports...

Many people trusted Bernie Madoff with their money...
That's right -- you may no longer have accurate access to your own account information, if you didn't download, snapshot, and back it up yourself when it was originally published.

I learned this lesson the hard way.  I recently rolled over my 401(k) from a previous employer's plan manager.  And when I did so, they terminated my online account access.  I certainly understand why, as I no longer had any funds under management.  The consequence, though, is that I immediately lost access to several years of digital statements associated with my account.  Poof.



I'm sorry, but, "Yes, I want to go paperless" means, "Email me a PDF" not, "Email me a link to your damn website once a month".

p.s. And while you're implementing that, how about sending me something machine readable, in addition to a PDF?  Oh, and please sign and encrypt that email.  I know, I know...  Techmology is hard.  I'm asking way too much...  Arg.

Dustin

Tuesday, October 1, 2013

Fingerprints are Usernames, not Passwords


As one of the maintainers of eCryptfs, and a long time Thinkpad owner, I have been asked many times to add support to eCryptfs for Thinkpad's fingerprint readers.

I actually captured this as a wishlist bug in Launchpad in August 2008, but upon thinking about it a bit more, I later closed the bug "won't fix" in February 2009, and discussed in a blog post, saying:
Hi, thanks so much for the bug report.I've been thinking about this quite a bit lately. I'm going to have to mark this "won't fix" for now. The prevailing opinion from security professionals is that fingerprints are perhaps a good replacement for usernames. However, they're really not a good replacement for passwords. Consider your laptop... How many fingerprints of yours are there on your laptop right now? As such, it's about as secret as your username. You don't leave your password on your spacebar, or on your beer bottle :-) This wikipedia entry (although it's about Microsoft Fingerprint Readers) is pretty accurate: * http://en.wikipedia.org/wiki/Microsoft_Fingerprint_ReaderSo, I'm sorry, but I don't think we'll be fixing this for now.
I'm bringing this up again to highlight the work released last week by The Chaos Computer Club, which has demonstrated how truly insecure Apple's TouchID is.


There may be civil liberties at issue as well.  While this piece is satire, and Apple says that it is not sharing your fingerprints with the government, we've been kept in the dark about such things before.  I'll leave you to draw your own conclusions on that one.

But let's just say you're okay with Apple sharing your fingerprints with the NSA, as I've already told you, they're not private at all.  You leave them on everything you touch.  And let's say you're insistent on using fingerprint (biometric) technology because you can.  In that case, your fingerprints might identify you, much as a your email address or username identifies you, perhaps from a list.

I could see some value, perhaps, in a tablet that I share with my wife, where each of us have our own accounts, with independent configurations, apps, and settings.  We could each conveniently identify ourselves by our fingerprint.  But biometrics cannot, and absolutely must not, be used to authenticate an identity.  For authentication, you need a password or passphrase.  Something that can be independently chosen, changed, and rotated.  I will continue to advocate this within the Ubuntu development community, as I have since 2009.

Once your fingerprint is compromised (and, yes, it almost certainly already is, if you've crossed an international border or registered for a driver's license in some US states and countries), how do you change it?  Are you starting to see why this is a really bad idea?

There are plenty of inventions that exist, but turned out to be bad ideas.  And I think fingerprint readers are another one of those.

This isn't a knock on Apple, as Thinkpad have embedded fingerprint readers for nearly a decade.  My intention is to help stop and think about the place of biometrics in security.  Biometrics can be use used as a lightweight, convenient mechanism to establish identity, but they cannot authenticate a person or a thing alone.

So please, if you have any  respect for the privacy your data, or your contacts' information, please don't use fingerprints (or biometrics, in general) for authentication.

kthxbye,
:-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, September 10, 2013

Introducing run-one-constantly, run-one-until-failure and run-one-until-success


Necessity is truly the mother of invention.  I was working from the Isle of Man recently, and really, really enjoyed my stay!  There's no better description for the Isle of Man than "quaint":
quaint
kwānt/
adjective1. attractively unusual or old-fashioned.
"quaint country cottages"
synonyms:picturesque, charming, sweet, attractive, old-fashioned, old-world
Though that description applies to the Internet connectivity, as well :-)  Truth be told, most hotel WiFi is pretty bad.  But nestle a lovely little old hotel on a forgotten little Viking/Celtic island and you will really see the problem exacerbated.

I worked around most of my downstream issues with a couple of new extensions to the run-one project, and I'm delighted as always to share these with you in Ubuntu's package!

As a reminder, the run-one package already provides:
  • run-one COMMAND [ARGS]
    • This is a wrapper script that runs no more than one unique instance of some command with a unique set of arguments.
    • This is often useful with cronjobs, when you want no more than one copy running at a time.
  • run-this-one COMMAND [ARGS]
    • This is exactly like run-one, except that it will use pgrep and kill to find and kill any running processes owned by the user and matching the target commands and arguments.
    • Note that run-this-one will block while trying to kill matching processes, until all matching processes are dead.
    • This is often useful when you want to kill any previous copies of the process you want to run (like VPN, SSL, and SSH tunnels).
  • keep-one-running COMMAND [ARGS]
    • This command operates exactly like run-one except that it respawns the command with its arguments if it exits for any reason (zero or non-zero).
    • This is useful when you want to ensure that you always have a copy of a command or process running, in case it dies or exits for any reason.
Newly added, you can now:
  • run-one-constantly COMMAND [ARGS]
    • This is simply an alias for keep-one-running.
    • I've never liked the fact that this command started with "keep-" instead of "run-one-", from a namespace and discoverability perspective.
  • run-one-until-success COMMAND [ARGS]
    • This command operates exactly like run-one-constantly except that it respawns "COMMAND [ARGS]" until COMMAND exits successfully (ie, exits zero).
    • This is useful when downloading something, perhaps using wget --continue or rsync, over a crappy quaint hotel WiFi connection.
  • run-one-until-failure COMMAND [ARGS]
    •  This command operates exactly like run-one-constantly except that it respawns "COMMAND [ARGS]" until COMMAND exits with failure (ie, exits non-zero).
    • This is useful when you want to run something until something goes wrong.
I am occasionally asked about the difference between these tools and the nohup command...
  1. First, the "one" part of run-one-constantly is important, in that it uses run-one to protect you from running more than one instances of the specified command. This is handy for something like an ssh tunnel, that you only really want/need one of.
  2. Second, nohup doesn't rerun the specified command if it exits cleanly, or forcibly gets killed. nohup only ignores the hangup signal.
So you might say that the run-one tools are a bit more resilient than nohup.

You can use all of these as of Ubuntu 13.10 (Saucy), by simply:

sudo apt-get install run-one

Or, for older Ubuntu releases:

sudo apt-add-repository ppa:run-one/ppa
sudo apt-get update
sudo apt-get install run-one

I was also asked about the difference between these tools and upstart...

Upstart is Ubuntu's event driven replacement for sysvinit.  It's typically used to start daemons and other scripts, utilities, and "jobs" at boot time.  It has a really cool feature/command/option called respawn, which can be used to provide a very similar effect as run-one-constantly.  In fact, I've used respawn in several of the upstart jobs I've written for the Ubuntu server, so I'm happy to credit upstart's respawn for the idea.

That said, I think the differences between upstart and run-one are certainly different enough to merit both tools, at least on my servers.

  1. An upstart job is defined by its own script-like syntax.  You can see many examples in Ubuntu's /etc/init/*.conf.  On my system the average upstart job is 25 lines long.  The run-one commands are simply prepended onto the beginning of any command line program and arguments you want to run.  You can certainly use run-one and friends inside of a script, but they're typically used in an interactive shell command line.
  2. An upstart job typically runs at boot time, or when "started" using the start command, and these start jobs located in the root-writable /etc/init/.  Can a non-root user write their own upstart job, and start and stop it?  Not that I can tell (and I'm happy to be corrected here)...    Turns out I was wrong about that, per a set of recently added features to Upstart (thanks, James, and Stuart for pointing out!), non-root users can now write and run their own upstart jobs..   Still, any user on the system can launch run-one jobs, and their own command+arguments namespace is unique to them.
  3. run-one is easily usable on systems that do not have upstart available; the only hard dependency is on the flock(1) utility.
Hope that helps!


Happy running,
:-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

Thursday, August 22, 2013

Gentlemen, Start Your Engines!


Mark kicked this Ubuntu Edge campaign off a month ago with an analogy that's near and dear to my heart, as an avid auto race fan.  He talked about how the Ubuntu Edge could be a platform like Formula 1 race cars, where device manufacturers experiment, innovate, and push the limits of the technology itself.

Late yesterday, the Ubuntu Edge crowd funding campaign closed its 30-day run, without hitting its $32M goal.  That's a bummer, because I still want a PC that fits in my pocket, and happens to make phone calls.  There are at least 27,488 of us who pledged our support, and are likely bummed too.


In retrospect, I think there's a better analogy for the Edge, than Formula 1...  Time will show that the Edge worked more like a Concept Car.

"A concept vehicle or show vehicle is a car made to showcase new styling and/or new technology. They are often shown at motor shows to gauge customer reaction to new and radical designs which may or may not be mass-produced. General Motors designer Harley Earl is generally credited with inventing the concept car, and did much to popularize it through its traveling Motorama shows of the 1950s.Concept cars never go into production directly. In modern times all would have to undergo many changes before the design is finalized for the sake of practicality, safety, the meeting the burden of regulatory compliance, and cost. A "production-intent" vehicle, as opposed to a concept vehicle, serves this purpose.[1]"
I love reading about the incredible concept cars unveiled at the Detroit Auto Show every year, particularly as a Corvette and Cadillac enthusiast myself.


I think the Cadillac Cien (2002) is my favorite concept car of all time.  It's a beautifully striking vehicle, with edgy design, and crazy stupid power (750hp!).


While never mass produced, the Cien captured the imagination and updated the innovation around the Cadillac brand itself.  That concept vehicle, in a few short years, evolved in the production car I drive today, the Cadillac CTS-V -- a very different Cadillac than the land yachts your grandparents might lull around in :-)


This car has invigorated a generation of new Cadillac owners for General Motors, competing with long established players from BMW (M5), Mercedes (E63), and Audi (S6), and recapturing a valuable market of younger drivers who have been buying German performance sedans.

Without a doubt, I'm disappointed that I won't be holding this beautiful piece of hardware, at, all told, a very reasonable price (I pledged for two at the $600 level).


But that's only half of the story.  Ubuntu Touch, the software that would have powered the Edge, lives!!!

I'm actually running it right now on an LG E960 Google Nexus 4.  The hardware specs are pretty boring, and the device itself is not nearly as sexy as the Edge, but it's a decent run-of-the-mill, no-frills mobile phone that exists in the market today.


The unlocked, international version showed up on my doorstep in 18 hours and $394 from Amazon.  Amazingly, it took me less than 30 minutes to unbox the phone, download and install the phablet-tools on my Ubuntu 13.04 desktop, unlock the device, and flash Ubuntu Touch onto it.  There's so much potential here, I'm still really excited about it.

We are told, with confidence, that there will be Ubuntu smartphones in the market next year.  It just won't be the Edge.  As much as I lust to drive one of these elite Cadillac Cien concept cars, I love what it evolved into, and it's pure joy to absolutely drive the hell out of a CTS-V ;-)  And along those lines, this time next year, many of us will have Ubuntu smartphones, even it they won't be the Edge concept.

Gentlemen, start your engines!

Dustin

Printfriendly