Ubuntu 11.10 Oneiric Ocelot

I’ve been running Ubuntu as my home desktop for quite some time, and it’s been at least a couple of years since I did a clean install. I’ve moved motherboards and drives over that time and upgraded the distribution many times. Generally the upgrades resulted in improvements. Moving to 11.04 (Natty Narwhal) resulted in a change to the new Unity interface, I had seen and used it previously on a netbook so it wasn’t completely new to me. Having only recently upgraded to 11.10 a few things busted which I’ll write about here. I’ll focus on things that I noticed breaking between 11.04 and 11.10, but some of the tips will apply in general.

Some of these issues will be due to my avoidance of doing a fresh install, if you’re really stuck – make a backup and do a fresh install and work forwards. One day I’ll get organized enough to build a script that lets me restore my preferred state “fresh” from a clean install – a lot of that script could likely be built by introspecting the current install. More likely is that people will push most of their data into “the cloud” and the desktop will become pretty much throw-away. My Android phone is starting to work a lot like that it seems (but I rebuild it from a clean install more often than I want to admit).

Issue 1 – Automatic login. I rarely reboot my machine, but when I do I don’t want to be bothered with a login. For my personal desktop I’m ok with the less secure mode (work is a different story). This busted in 11.10, fortunately the fix was out there.

Search for "User Accounts" application. Select the account you want to autologin Toggle the Automatic Login switch to On

Issue 2 – Suspend stopped working in 11.10, well as I rarely reboot/power off – I need my machine to suspend. Attempts to suspend would appear to almost suspend, but immediately resume to the lock screen. Looking at the log file /var/log/pm-suspend.log helped me spot something odd:

Running hook /etc/pm/sleep.d/05_xhci resume suspend:
FATAL: Module xhci not found.

The log didn’t indicate this was causing a problem, but it seemed suspicious. I had added this file when I got the Core i3 as suspend wasn’t working. Well, it turns out removing this file fixes my suspend problem.

Issue 3 – I now needed to disable the lock screen on resume. This took a bit more digging to find the solution to, but again it was very simple once I found it. Simply run the following in a terminal.

gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true'

In 11.10 the default mail application is now Thunderbird, which I used to use back when I was on Windows XP but stuck it out with Evolution when I moved to Ubuntu. I haven’t switched so I’m still on Evolution, but it’s clear Evolution isn’t quite right in 11.10 or the settings migration due to change in db shape was busted. I’ll have to sort that out at one point.

When I moved over to Unity in 11.04, I was missing a couple of the nice task bar indicators. I found Caffeine 2.2 to give me support for disabling auto sleep, and System Load Indicator 0.2 for some stats on the task bar.

I’ll toss out one other link to tweaks by Steve Klondik, I didn’t use any but it was a good reference.

no-www

This blog is hosted on my own domain, ever since the start I’ve supported finding my site as lowtek.ca or www.lowtek.ca.

WordPress allows you to do some simple URL rewriting to push people to whatever you want, and I had configured things to push visitors to www.lowtek.ca/roo since the ‘www’ seemed like the right thing to do. I never really thought much about it until I came across no-www.org.

No-www.org strives to make the Internet and communications about it as fruitful as possible. To that end, we make the modest proposal that website makers configure their main sites to be accessible by domain.com as well as www.domain.com.

This makes a lot of sense, and any site that supports they consider a Class A site. They define a further level of no-www support as Class B, and consider this optimal no-www compliance level. There is also Class C, but is not recommended.

Thus lowtek.ca has been a Class A compliant no-www site all along. However just the other day I switched things around to be Class B – allowing both www.lowtek.ca and lowtek.ca to work, but redirecting people who visit www.lowtek.ca to simply lowtek.ca. I had two reasons that motivated me: 1) lowtek.ca is shorter 2) I’m working on getting a SSL certificate and having the short name allows me to reuse it for other things (like mail) if I want.

To make the change I needed to address a couple of things. First step was to go to all of the wordpress blogs I host and change the General Settings to make sure wordpress wasn’t going to try to rewrite the URL to have a www prefix. Failure to do this will result in a broken site as you get a rewrite/redirect loop.

Next I had to do battle with my apache configuration. This is something I’m sure would be easier if I was a better web server admin. I ended up adding the rewrite rules to the sites-available definition(s) I use, one for normal HTTP and the other for HTTPS. Many suggest using .htaccess but I would rather this was codified in my actual apache config files.

The no-www.org FAQ has a rewrite rule, but I ended up using

RewriteCond %{HTTP_HOST} ^www.lowtek.ca$ [NC]
RewriteRule ^(.*)$ http://lowtek.ca$1 [R=301,L]

The [NC] specifies ‘no case’, ie: case insensitive. The R=301 specifies that we’re redirecting, and the HTTP code is 301 ‘Moved Permanently‘. The L indicates this is the last rule, as you can have multiples.

Now my domain validates with no-www.org as a Class B implementation.

There is a downside to the no-www movement, but only for larger sites. This is likely why Google continues to have a www prefix. Cookies that are set from domain.com can be read by anything.domain.com. For small sites like mine, this has no impact, for larger sites it could be a problem.

Unlocking Samsung Galaxy S Vibrant (Bell)

I’ve been a big fan of unlocked GSM phones since my first one back in 2009. I’ve also been through a surprising number of different phone since then, but all of them have been 2nd (or 3rd) hand and have been a good price for a phone that still has lots of use left in it. My latest phone the Samsung Galaxy S Vibrant (i9000m) is no different, but it came to me locked to Bell.

I purchased the i9000m knowing it could be easily unlocked if you had the right magic. With the stock firmware, if you don’t have the phone unlocked you’ll see what’s pictured at the top of this post when you install a SIM card.

It turns out the forums have a great how to guide, with pointers to an app on the Android Market if you’re afraid of a little bit of hex editing. It should go without saying that I selected the hex editing route. I’ll describe the steps I used here, but  all credit to the folks in the forums for figuring this out.

I will assume that you’ve rooted your i9000m and you’re not incapable of using a hex editor.

Step 1: We’re going to copy some non-volatile memory off the phone that contains the ‘lock’. Perform the following commands on the phone (probably via ADB).

$ su
# cat /efs/nv_data.bin >> /sdcard/nv_data.bin

Now copy that file onto your PC for editing. Make a backup of the original before step 2.

Step 2: Edit that file, I used hexedit on Ubuntu. The lock bit is inside of the byte at 0x181469 in the file. See the green circle below, change that 01 into a 00 and save the file.

Starting at offset 0x181468 you should see the series of digits: ff 01 00 00 00 00 46 46

The XDA post describes it as follows:

There are 5 different types of locks in 5 different bytes

the FF byte should be left alone
the first byte after the FF is the network lock
the next byte is the network subset lock
the next byte is the sp lock
the next byte is the cp lock
the last byte appears to be a data lock.
the 46 46 should be left alone

Step 3: Use the modified file to update your phone. Let’s assume you copied the modified file to /sdcard/nv_data.bin on the phone, and again the commands below are executed on the phone.

$ su
# rm /efs/nv_data.bin
# rm /efs/nv_data.bin.md5
# cat /sdcard/nv_data.bin >> /efs/nv_data.bin
# chmod 755 /efs/nv_data.bin
# chown radio.radio /efs/nv_data.bin || chown 1001.1001 /efs/nv_data.bin
# reboot

That’s it, you’re unlocked. The unlock should persist across ROM (firmware) changes.

References: a great article with pointers to valuable information on the i9000 series.