Tuesday, August 13, 2013

Updating Firefox and Thunderbird in LMDE

A couple of weeks ago, as you may recall, I switched from ever-changing Ubuntu to nearly frozen Linux Mint Debian Edition (LMDE). So how is it?

Nice. Not only does it have the Gnome 2-like MATE desktop, but because it is based on Debian Testing (currently known as jessie), LMDE is relatively slow to change.

What's irritating about LMDE is that, because it is based on Debian Testing, it is relatively slow to change.

This really isn't too much of a bother, except for Firefox and Thunderbird, which change versions at the drop of a hat, not that anyone wears a hat they can drop anymore. So, for example, as of this moment (it could change by tonight), Firefox is on version 23, and Thunderbird is on version 17.0.8. LMDE's versions, OTOH, are at 21 and 17(.0.0).

OK, this is not one of life's big tragedies. Most updates of Fox&Bird do not involve major changes. But I like to keep a little more current.

Fortunately, there is a relatively easy fix for this which won't do too much damage to your installation even if it completely craps out. The details are all in this LMDE forum post and the one above it, but I've added a little twist of my own, based on a post even further up the topic than the ones I've already mentioned and linked to.

What makes this relatively easy is that LMDE stores Firefox & Thunderbird files in the /opt directory, since pure Debian doesn't support them under their default names because of trademark issues (see iceweasel and icedove). That means any mucking around you have to do is confined to /opt, rather than such touchy directories as /usr/lib and the like.

So what to do:

  1. Install Fox&Bird, if you haven't already:
    $ sudo apt-get install firefox thunderbird (N.B. If you haven't already installed Firefox or Thunderbird, and don't miss them, you might ask yourself just what you are doing reading this post.)

  2. Become the superuser and go to the /opt directory.
    sudo -i
    # cd /opt

  3. Back up the firefox and thunderbird directories. This lets you get back to the original versions if you frak everything up. If you are particularly paranoid, back up your $HOME/.mozilla and $HOME/.thunderbird directories in the same way.
    # cp -rp firefox firefox_21
    # cp -rp thunderbird thunderbird_17.0
    The -rp options recursively copy everything and preserve all permissions and time stamps.

  4. Optional step: Change the ownership of firefox and thunderbird. If you do this, then you will be able to update both programs without becoming superuser. Otherwise, you'll have to launch the apps using sudo to do the upgrades. Technically this a regression, as it allows someone to update a core component of the machine without root access, i.e., it behaves like Windows XP. On a single user machine this is probably not a big problem.

    Assuming your username is, say, capaldi,
    # chown -R capaldi:capaldi firefox thunderbird If you do this step you can now get out of su mode:
    # exit

  5. Now for the trick. You need to put Fox&Bird into the release channel:
    $ vi /opt/firefox/defaults/pref/channel-prefs.js When you get here, look for a line that says
    pref("app.update.channel", "default"); and change default to release.

  6. Do the same thing for
    $ vi /opt/thunderbird/defaults/pref/channel-prefs.js In my copy, this was already set, which is why Thunderbird kept asking to update (and always failed, since it I wasn't root).

  7. Restart either app. In the Help menu click on About Firefox/Thunderbird. Updates should appear normally, though I had to go through the process a couple of times to get a successful update. In Thunderbird it took forever to do the update, but when I Xed out the update window and restarted Thunderbird it was properly updated. I'll let you know if this trend continues with the next update, which might occur as early as this week.

  8. Now if and when LMDE does push Fox&Bird updates, all of your lovely work will be overwritten. You can do that by locking the package. The easiest way to do this that I know is:

    1. Open synaptic. If you don't have it,
      $ sudo apt-get install synaptic
    2. Search for firefox and click on it.

    3. In the synaptic menu bar, click Package.

    4. Click Lock Version.

    5. Search again for Firefox and make sure it is locked. The whole Firefox line should be red.

    6. Repeat for Thunderbird.

And that should do it. Remember, if things get messed up, you can always use your backup directories to get back to the default distribution, or you can do complete remove/reinstall:
$ sudo apt-get purge firefox thunderbird
$ sudo apt-get install firefox thunderbird

Sunday, July 21, 2013


As long-threatened, I've finally followed the crowd and move from Ubuntu to Linux Mint. The main attraction was Mint's use of the MATE desktop, which is enough like Gnome 2 to keep me happy indefinitely, but I also liked the fact that the Debian edition, hereafter LMDE, is a rolling release, meaning I'm not going to have to do a complete upgrade in 6 months. The price is that some software is going to be a little behind the times, but, hey, at work we use CentOS. At least with LMDE it's unlikely that I won't be able to run Google Chrome or Chromium.

So a brief review:

Installation was simple enough. After several hours of backing up my /home partition (twice, to two separate USB disks), I downloaded the DVD and did the initial install. I left my /home and /usr/local directories, which were on separate partitions, intact, and let LMDE overwrite the root directory and install its version of Grub to run through the boot process. This took less than an hour, which was a pleasant surprise.

It then took me another couple of hours to pick out all the packages that weren't automatically installed, and get them up and running. Not too bad, really.

There were, of course, a few things that didn't quite work perfectly.

After a week, those are all the problems I've found. The system is stable, MATE is as good a Desktop as you're going to find these days, and I've had no difficulties in installing other software that I want.

This could be the beginning of a beautiful friendship.

Friday, July 12, 2013

Stupid Math Tricks

I have a weird mind that occasionally obsesses with some probably trivial math problems. I thought I'd this obsession with the world at large, even if the world isn't ready for it. But this blog isn't really the place for it, so I'm starting a new one:

Stupid Math Tricks, available at a browser near you, or from the sidebar on the right.

Don't worry, when I upgrade Hal to LMDE I'll post all about it right here.

Thursday, July 04, 2013

Galactus Rules

Now it can be told: I've been remiss in posting to this blog because I've fallen in love with my smartphone.

Well, maybe not love — more like extreme like — but the fact is, we've been spending a lot of time together. More time than is good, and time I'd ordinarily have for posting to this blog.

It's a Samsung Galaxy S3, currently running Android 4.1.2 on the Verizon Network. OK, it's not the latest and greatest (it was when I bought it in November), but it's still pretty damn good.

As a phone, it's a phone. As a Music Player — well, it does that, though I still use an old iPod at the gym because when I exercise there tends to be excess moisture.

So mainly I like it for the apps. Yes, most (all?) of the things I can do with apps are available for Hal, here, but Hal's downstairs, and my big TV is upstairs. So if I'm just doing casual idiot-box related browsing, or I'm on the road, the phone's the way to go.

What I thought I'd do today is to list some of my favorite Android Apps, why I like them, how the could be improved, and few suggestions for new/better apps. These aren't really in any particular order.

  • Google Maps:  not to mention Navigator and Earth. I use Maps every day to check the traffic patterns on the way to work so that I know if I should avoid the 11th Street Bridge or not. (No one has ever sung Slow Down, You Move to Fast about the 11th Street Bridge.)
  • ESPN Score Center:  This lets me keep up to date on the games I want to know about: mainly the Jayhawks, Nationals, and Royals (I go way back with the Royals, OK?). And it connects to ESPN's Game Center, so I can follow the action pitch-by-pitch. If you wanted to, you could use it to re-create games, as was once done by a former President.
  • IMDb:  I'm always checking this while we're watching TV, movies, whatever. The ultimate Who was that? App.
  • Jota Text Editor:  the Galaxy doesn't come with a decent notepad, as far as I can tell. This one is perfect. Almost EMACS-like.
  • Scanner Radio:  When they were hunting the Boston Bomber, we had CNN on the screen, but we got most of our news from this.
  • Units:  the smartphone version of the Unix program I've written about before.
  • And Bible:  Lots of translations. I particularly like The NET Bible, but you have to pay to get the translators' notes. Particularly useful at church, you can be pretending to follow the text of the sermon while surfing. [I jest. Mostly.]
  • Flipboard:  I probably use this more than any other App, except for Gmail/Email. Flipboard is essentially a graphical version of Google Reader: You sign up for a site's feed (some sites and users set up their own Flipboard magazines), and you drag the screen to flip from one site to the other, and within a site. The nice thing is that Top posts from your list are put right at the top of the App, if you're in a hurry and just want to see what's going on in the world. I also use it to scan Twitter, Google Plus, various news sites, and a handful of blogs. The Twitter reader automagically replaces long links by bit.ly URLs. If your Reader accessed 100+ sites, this isn't the App for you, but if you only follow a few it's perfect.
  • The March Meeting App:  That's the American Physical Society March Meeting. They managed to cram the entire set of Abstracts for 8000+ talks onto the phone (they stopped printing the full abstract book some years ago — something about deforestation). Tracks times/locations of talks. Would be better if it allowed off-app note taking, but even then it was extremely useful.
  • TuneIn Radio:  accesses the web streams of thousands of radio stations. I particularly like it in the fall, when I can listen to NFL football games while working outside. Not as useful in the spring/summer, as baseball games are hidden behind MLB's pay wall.
  • Newspapers USA:  This is essentially a list of bookmarks for every paper in the US. If you want a specific paper, such as the Washington Post or NY Times, use that paper's App. But if you find yourself wanting to look at the Deseret News for a story, this is the place to find it.

OK, that's the good stuff. What would I change?

  • There are two email clients: One for Gmail, one for Everything Else. The EE one will read your Gmail, but you have to sign up on the Gmail App.
  • On the iPod I use the iTunes store to manage my podcast feeds. It's easy to find everything, though painfully slow, but I don't have to search for a tiny little button to download, say, this week's episode of Car Talk. There may be Android Apps which do this kind of thing, but the one's I've looked at seem to mostly stream podcasts (unacceptable, as my gym doesn't have WiFi), or cost money. iTunes also does a better job of letting you organize Podcast playlists than either of the two music players that come with the Galaxy.

It looks like I'm going to have more time on my hands for the next few months, so I'll be posting here more. In particular, the time has come to move Hal off Ubuntu to a distribution that's not trying to force me off of my preferred Gnome 2-like interface. I'm probably going to follow Penguin Pete and move to Linux Mint, but I'll probably go to Debian Edition, as I like the idea of a rolling distribution that doesn't require me to update everything every six months. For now, spouse's computer, Harlie, will stay on Ubuntu 12.04 LTE, which shouldn't need updating until we trash it in a year or so. (Harlie started out life as a Vista box.)

Monday, May 20, 2013

Audrey and Tom

Yes, it has been a long time since the last post, and you probably won't get much out of me until summer, unless I decide to jump to Linux Mint before that.

But in the meantime, I'll give you this to watch: Audrey and Tom, a pair of osprey who live on the Chesapeake Bay not far from East Bowie:

Chesapeake Conservancy Osprey Cam

Tuesday, January 01, 2013

Sorting From Back to Front

The other day I was presented with a list of names and email addresses, something like this one:

Fred Flinstone <flintstone@bedrock.sag>
Barney & Wilma Rubble <bambamsfolks@bedrock.sag>
Steadholder Honor Harrington <dutchess@harrington.mdc>
Count Miles Vorkosigan <auditor@vorkosigan.byr>
Dennis & Margaret Mitchell <stilltrouble@funnies.comics.net>
Homer Simpson <donuts@springfield.st.us>
Rudolph <rednose@reindeer.np>
Kimball Kinnison <kinnison@graylens.gp>
Wile E. Coyote <genius@acme.net>
Tiberius Claudius Drusus Nero Germanicus Julius Caesar <imperator@spqr.rm>
Gen. Jack O'Neill <jack.oneill@stargate.oml>

Except that it had around 100 names. What I wanted to do was to alphabetize this by last name, to make it easier to figure out who was missing from the list, but keep the final result as
     FirstName MiddleName(s) LastName <email>
since this was input to an email list in that format.

This would not difficult if each person had exactly two names, say
     FirstName LastName <email>
in which case we'd just run the command
     sort -k 2 < elist
and we'd be done.

Unfortunately each line contains between two and eight fields, counting the email address, and we want to sort on the next to last one. As far as I can tell, sort doesn't support searches from the end of the line in.

However, the awk (or gawk) command does. For example, the command
     awk '{print $NF}' < elist
would list just the email addresses from the above file, and
     awk '{print $(NF-1)}' < elist
would list the last names — no, I don't know why you use parenthesis, but you do.

So what we need is a way to have awk pull out the last name from the file, sort those, then put everything back together. It turns out we can do that with a one-liner. I found it on the web yesterday, but I've lost the link, so I can't give proper credit. I did save the command, or my modification of it, at least:

awk '{print $(NF-1), $0}' < elist | sort | cut -f2- -d' '

Let's look at that in detail:

  • awk '{print $(NF-1), $0}' < elist
    prints out the next to last column of each line, followed by the entire line ($0).
  • sort
    then sorts everything on the first column, e.g. the last name. Unfortunately, that leaves you with entries like this:
     Simpson Homer Simpson <donuts@springfield.st.us>
    To get rid of these, we need
  • cut -f2- -d' '
    which separates fields by whitespace (the -d' ') and prints everything out starting from the second column (-f2- . If we wanted just the second and third column it would be -f2-3).

And the correctly sorted output is:

Tiberius Claudius Drusus Nero Germanicus Julius Caesar <imperator@spqr.rm>
Wile E. Coyote <genius@acme.net>
Fred Flinstone <flintstone@bedrock.sag>
Steadholder Honor Harrington <dutchess@harrington.mdc>
Kimball Kinnison <kinnison@graylens.gp>
Dennis & Margaret Mitchell <stilltrouble@funnies.comics.net>
Gen. Jack O'Neill <jack.oneill@stargate.oml>
Barney & Wilma Rubble <bambamsfolks@bedrock.sag>
Rudolph <rednose@reindeer.np>
Homer Simpson <donuts@springfield.st.us>
Count Miles Vorkosigan <auditor@vorkosigan.byr>

Fairly simple, huh? I generalized it a bit, so that we can sort on an arbitrary column from the end:

#! /bin/bash

# Usage

# lastsort N filename
# Sorts the file filename of the field N columns from the end
# N=0 is last column of the file

awk '{print $(NF-'$1'), $0}' $2 | sort | cut -f2- -d' '

Note the single quotes around the $1 in the awk command, which passes the first argument of the calling command to awk. Without the quotes you get an error.

OK, this could have a few bells and whistles, but I'm not going to bother with that now.