Pragmatic IT

IT Infrastructure and Software Development from the Customer's Perspective

Use Mate with Cheap Hardware

[Update: This whole post is a lie. See how Chrome is the culprit here. and see my confirmation that Cinnamon is fine here.]

A few weeks ago I switched to Linux Mint and chose the Cinnamon desktop. That turned out to be a disaster with my cheap Dell laptop (Vostro 1440). The performance was excruciatingly slow – apps would take tens of seconds to open, the mouse would freeze, etc. Switching to Mate has made it bearable. Unfortunately, switching the desktop, while doable (Google it) doesn’t work perfectly. I have duplicate items in some menus, or multiple ways to do the same thing. I never know when I’m going to see Nautilus or Caja when I open a folder.

Upgrading Android Phone With Linux

I’ve had a Samsung Galaxy S II with Android 2.3.3 from Virgin Mobility in Canada since last year at this time. Part of the reason I went Android is I wanted to get away from having to have a Windows VM just to manage my phone. When I got the Galaxy I asked how upgrades worked, and I was told it was a stand-alone upgrade.

Time goes by and I rather enjoy not having my phone’s behaviour change every time I plug it in to my computer. For that matter, I enjoy not having to plug it into a computer all the time. Lately, however, some of the things that I didn’t like about my phone bugged me enough that I thought I should do something about them. And before doing that, I thought, well I better upgrade Android first.

So it turns out I needed a PC or a Mac to upgrade using the Samsung Kies software. No stand-alone upgrade like they told me. Crap. Well, I thought, I’m a Linux user so suck it up and Google for the solution. Many Androids do indeed have a stand-alone upgrade on the phone, and people report it works quite well, although it’s best to be connected to WiFi first. I suspect, therefore, that either it’s something that Virgin/Bell did to their version of Android, or it’s an artefact of the old version of Android.

In other words, these instructions are only for if you can’t find the stand-alone upgrade on your phone. Look under Settings-> About Phone.

Without the stand-alone upgrade, here’s what I did:

  1. I went to [samfirmware.com][1] to find the version of software for my exact model of phone, a GT-I9100M and download it. The version I got was 4.0.3 (Ice Cream Sandwich)
  2. I uncompressed it
  3. Heimdall is the Linux program to flash the Samsung's firmware. I [downloaded heimdall][2]{: target="_blank"} 1.3.1, both frontend and the base, from the [heimdall github site][3]{: target="_blank"}. At the time I wrote this, heimdall 1.3.2 was the most recent, but apparently it had an issue and the Internet recommended using 1.3.1
  4. I installed each of the .deb files by double-clicking on them
  5. I ran "sudo heimdall-frontend" in a terminal. I had to run it with sudo or I would get a "libusb error: -3" \[Update: On another system I got "heimdall-frontend: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory" when I installed the 32-bit Heimdall on a 64-bit Linux Mint.\]
  6. Somewhere around here you may want to back up your phone. I didn't, but I was quite confident that most of what I have on the phone is also in the cloud somewhere. I copied all my photos to my computer before starting the upgrade
  7. The phone has to be in "download mode" before connecting to it with heimdall. To put it in download mode, turn off the phone, disconnect the USB cable, and hold down Volume-Down, Power, and Home all at the same time for a few seconds. The phone shows a display that it's in download mode within a couple of seconds. To quit without downloading anything, just hold down the power button for five seconds or so ([http://forum.xda-developers.com/wiki/Samsung\_Galaxy\_S\_II\_Series#Download\_Mode][4])
  8. I prepared the firmware to flash according to the Heimdall instructions: [https://github.com/Benjamin-Dobell/Heimdall/tree/master/Linux][5], under the heading "Performing a Custom Flash with Heimdall Frontend". Note that the instructions say to get the PIT file from the phone first

It took a couple of minutes to download all the files. For the larger files the feedback would pause every once in a while. I was patient and waited and it continued after a brief pause.

Once it’s done the phone rebooted and set about doing a bunch of post-install updating. It took maybe ten minutes tops and the phone was ready to go. My memos were still there.  I lost all my playlists. As far as I can tell, that’s all I lost (but then I don’t have a lot of stuff on my phone that isn’t in the cloud).

Finally, an annoying irony: One of the first things I noticed when I started to use the new version is that it does indeed support a stand-alone upgrade, so now all I need to do is connect to WiFi and upgrade.

Getting to Xubuntu

I don’t want to start a flame war, but I’ve been unable to adjust to Unity. So I’ve been using Xubuntu for some months now. I just installed the Xubuntu packages over my Ubuntu 11.10 from the instructions here: http://www.psychocats.net/ubuntu/xfce.

After installing Xubuntu, some things still seemed to be weird. Much of it I could imagine might have to do with the fact that I had a lot of perhaps unnecessary Ubuntu stuff hanging around my system. So yesterday I finally followed the excellent instructions at: http://www.psychocats.net/ubuntu/purexfceoneiric to get rid of the unnecessary stuff.

I had to reinstall LibreOffice and a few other packages after following the instructions. It’s worthwhile to capture the output of the command given by the link above, so you can see what’s been removed.

I had one obscure problem that gave me many hours of angst. When I restarted my computer, it wouldn’t boot. By booting to a live CD and checking /var/log/syslog, and Googling, I discovered that /etc/lightdm/lightdm.conf was sending me to the unity-greeter. I had to change /etc/lightdm/lightdm.conf to look like this, and then I could happily boot again:

[SeatDefaults]
greeter-session=lightdm-gtk-greeter
user-session=

I knew that after switching to Xubuntu but before following the above instructions, my startup was still going to the Ubuntu login screen, rather than the Xubuntu login screen. Part of the reason I was trying to go to “pure” Xubuntu was to get rid of the Ubuntu login and get to a pure Xubuntu experience.

I can’t say enough good things about pyschocats. She has done an excellent job of documenting a number of tricky topics.

Installing Ruby on Rails on Ubuntu 11.10

[I’ve made an important change to this post – steps 3 and 4 below are new. Apologies to anyone I’ve lead astray.]

I’m back to playing with Rails a bit. NetBeans for Ruby is gone, so I’m going to do things the macho Rails way and just develop with an editor and a bunch of terminal windows. (One of my open source rules is “do whatever everyone else is doing.” Trying to use an IDE with Rails was always a violation of that rule.)

{: .Apple-interchange-newline}rvm
 is a great idea. I found it really helpful to read about named gemsets early on. I had to install rvm, then install rails and a few other packages.

  1. Install the Ruby Version Manager (rvm) from [these instructions][4]{: target="_blank"}
  2. Put this line at the end of your .bashrc: "\[\[ -s "$HOME/.rvm/scripts/rvm" \]\] && . "$HOME/.rvm/scripts/rvm" # Load RVM function"
  3. Run "rvm requirements" in a terminal window
  4. Install all the packages the output of "rvm requirements" tells you to install (apt-get install...). You must do this before you start installing any rubies with rvm. If you don't, you may have all sorts of problems crop up later, like weird messages from irb ("Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.")
  5. Do the following in a terminal window:

rvm 1.9.3 
rvm --default 1.9.3 
gem install rails 
sudo apt-get install sqlite 
sudo apt-get install libsqlite3-dev 
sudo apt-get install nodejs 

Now create an application to test:

rails new testapp 
cd testapp 
rails server 

Browse to localhost:3000 and you should see the Rails default page.

Manual Two-Sided Printing

In my home office, I have a multi-function printer that does pretty much everything I typically need, except printing two sides. Here’s how I get two-sided printing when I need it.

The printer is an HP CM1312nfi. It prints on the side of the paper facing up in the paper tray. The “far end” of the paper in the paper tray is the top of the page.

I print the even-numbered pages first. These are the “back side” or “left pages”.

<div class="separator" style="clear: both; text-align: center;"></div>
Print in reverse order.

<div class="separator" style="clear: both; text-align: center;"></div>
I take the paper from the output tray, and turn it so that the blank side is up, and the top goes into the far side of the paper tray.

Then I print the odd-numbered pages. These are the “right side pages”.

<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div>
Print in forward order.

<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div>
This only works for one copy at a time if I have an odd number of pages in the document. That’s because you need one extra page when you print the second time to get the odd number of pages.

The screen shots are LibreOffice 3.4.4.

Relocating Data Centres in Waves

I’ve never had to relocate a data centre in one big bang. You hear stories about organizations that shut down all the computers at 5:00 PM, unplug them, move them, and have them up by 8:00 AM the next morning, but I’ve never done that.

The big bang approach may still be necessary sometimes, but you can mitigate a lot of risk by taking a staged approach, moving a few systems at a time.

Conventional wisdom on the staged data centre relocation is to move simpler systems, and test and development systems, first. This lets you tune your relocation processes and, particularly if you’re moving into a brand new data centre, work the kinks out of the new data centre.

It sounds great in theory. In practice, we ran into a few wrinkles.

I’d say the root source of the wrinkles traces back to our environment: We had a lot of applications integrated through various tools, and a large J2EE platform running a lot of custom applications. Also, even though we had some months to do the relocation in waves, we didn’t have an infinite amount of time. On top of that, business cycles meant that some systems had to be moved at certain times within the overall relocation period.

The net result is that we ended up moving some of the most complicated systems first. At least we were only moving the development and test environments. Even so, it turned out to be quite a challenge. We were slammed with a large workload when people were just learning the processes for shipping and installing equipment in the new data centre. The team pulled it off quite well, but it certainly increased the stress level.

I don’t think there’s much you can do about this. If your time lines force you to move complicated systems first, so be it. The lesson I take away is to identify early in planning if I have to move any complicated environments. On this project, I heard people right from the start talking about certain environments, and they turned out to be the challenging ones. We focused on them early, and everything worked out well.