Skip to content

{ Category Archives } Uncategorized

WTF power scripts went in Intrepid….

On previous versions of Ubuntu, the scripts which are called after a resume from suspend have been found in /etc/acpi/resume.d directory. I used this functionality to turn off some of the hardware in my Vaio which I don’t use (such as the bluetooth and the cdrom drive).

This stopped working when I upgraded to Ubuntu Intrepid. Even more strangely while the scripts are still installed, even they are never called.

It appears that thanks to moving towards HAL (which is probably a “Good Thing”) these scripts are no longer used. The scripts which are used can be found in /etc/pm/. Not only has the location changed, but the script format has too.

Previously, my script was found in /etc/acpi/resume.d/99-custom.sh looked like the following,

#! /bin/sh
# Turn off the CD drive and the bluetooth device
echo 1 > /sys/devices/platform/sony-laptop/cdpower
echo 0 > /sys/devices/platform/sony-laptop/cdpower
 
echo 1 > /sys/devices/platform/sony-laptop/bluetoothpower
echo 0 > /sys/devices/platform/sony-laptop/bluetoothpower

Now my script script must be found in /etc/pm/sleep.d/10-custom and looks like the following,

#!/bin/sh -e
case "$1" in
	resume)
		# Turn off the CD drive and the bluetooth device
		echo 1 > /sys/devices/platform/sony-laptop/cdpower
		echo 0 > /sys/devices/platform/sony-laptop/cdpower
 
		echo 1 > /sys/devices/platform/sony-laptop/bluetoothpower
		echo 0 > /sys/devices/platform/sony-laptop/bluetoothpower
	;;
esac

The main reason I’m posting this on my blog is that this change does not seem to be documented anywhere. Searching on Google for things like “resume script intrepid” or “/etc/acpi/resume.d intrepid” does not come up with anything useful. Hopefully some people will find this helpful.

Tagged , , , , , , ,

But…

they can fall to bits from too much love!

Tagged ,

Babylon 5, the adventure with DVD copy protection

I still have not found an apartment so as I have no internet to entertain me on the weekend I got a copy of the first season of Babylon 5 (it was only $20.00 AUD for the whole season). I had been working my way through Andromeda but no where seems to have the third season.

Anyway when I put the DVD video in the drive in my Sony Vaio Laptop running Ubuntu Hardy all I got where I/O errors, some examples are below;

[ 2283.614887] end_request: I/O error, dev sr0, sector 418256
[ 2283.620351] end_request: I/O error, dev sr0, sector 418264
[ 2283.626273] end_request: I/O error, dev sr0, sector 418264
[ 2283.631766] end_request: I/O error, dev sr0, sector 418272
[ 2283.637013] end_request: I/O error, dev sr0, sector 418272
[ 2283.642384] end_request: I/O error, dev sr0, sector 418280

The Vaio’s DVD drive is connected via the USB bus. This is done so that drive can be completely powered down. The device turned out to be a MATSHITA DVD-RAM drive as shown via the dmesg output below;

[ 2909.596251] scsi11 : SCSI emulation for USB Mass Storage devices
[ 2909.596944] usb-storage: device found at 24
[ 2909.596952] usb-storage: waiting for device to settle before scanning
[ 2911.901103] usb-storage: device scan complete
[ 2911.903506] scsi 11:0:0:0: CD-ROM            MATSHITA DVD-RAM UJ-852S  1.31 PQ: 0 ANSI: 0
[ 2911.948247] sr1: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[ 2911.948372] sr 11:0:0:0: Attached scsi CD-ROM sr1
[ 2911.948460] sr 11:0:0:0: Attached scsi generic sg1 type 5

It took me forever to figure out what was going on. I had seen similar problems on my desktop before when the disk was scratched but these where brand new disks. So I took the disks into work and tested it out on a friends Mac, it played perfectly. There happened to be a Steve Irwin DVD video disk lying around, so I popped it in the Vaio, it also played perfectly! What was going on?

After much searching I came across some reference to problems with region coding. It turns out that  MATSHITA drives won’t let you read a dvd unless they they have a region set. As I had never played a DVD video before the region on the drive had never been set.

There is a tool in Linux which can be used to do the region setting, it is helpfully called regionset. After setting the region to “Region 4” I am now able to play my new DVDs! I wonder if I will be able to read my discs from the US and the UK. The libdvdcss2 should be able to decode the data if it can be read, hopefully the drive will still let that occurring. I will report back in comments here when I find out for sure.

It has been repetitively found that region encoding is anticompetitive and hence un-unenforceable in Australia. I have included a quote from the Stevens v Kabushiki Kaisha Sony Computer Entertainment case from 2005.

Ordinary principles of statutory construction, observed by this Court since its earliest days, have construed legislation, where there is doubt, to protect the fundamental rights of the individual. The right of the individual to enjoy lawfully acquired private property (a CD ROM game or a PlayStation console purchased in another region of the world or possibly to make a backup copy of the CD ROM) would ordinarily be a right inherent in Australian law upon the acquisition of such a chattel. This is a further reason why s 116A of the Copyright Act and the definition of TPM in s 10(1) of that Act should be read strictly. Doing so avoids an interpretation that would deprive the property owner of an incident of that person’s ordinary legal rights.

I thought I would just log my info here as there was very little information in Google about this problem. Hopefully I help some poor fool which brought a Sony Vaio like me.

Tagged , , , , , ,

“rock” verses “rocks”

A guy on the Summer of Code asked about the following.

Linux rocks, FreeBSD rocks – but Linux and FreeBSD rock.

Which is correct use of rock verse rocks but I have no idea why. Suck also works like this,

Windows sucks, MacOS X sucks – but Windows and MacOS X suck.

This just proves that I know nothing about this language I use every day. Could a linguist please explain this?

Quotidian!

I’m sure most people are wondering what he hell “quotidian” is, I myself did not know this word existed. The word actually means mundane or everyday, a work colleague suggested it when I asked is anyone knew what the opposite to epiphany was. So you probably wondering why I’m going on about some stupid word, well the reason is that I have finally converted from the gnome Epiphany web browser to Firefox.

For thoses who don’t know, Epiphany is generally described as “the closest thing to Gnome’s official web browser”. It has lots of nifty features and use to have much better intergration with the Gnome desktop (things like actually using the Gnome print dialog). I use to advocate that Gnome should push Epiphany instead of Firefox.

So why have I given up? I’m tired of my browser being broken.

The developers of Epiphany decided to make some huge changes in the latest version, they started adding support for the WebKit (the render behind Safari) instead of just being dependent on Gecko (the same render Firefox uses). This is actually a very good goal, being able to have a choice of renders in my browser would be great. However, in the process of doing this change they broke everything! Things like the vitally important Adblock extension no longer work and the password manager is totally broken in a number of ways – for a long time they didn’t even show up in the dialog.

I’m okay with a few bugs here and there (even these quite serious ones) to get something better in the long run. I have diligently reported bugs as I found them (even firing up a different browser when the gnome bug browser was crashing Epiphany). I even started porting Google Gears to Epiphany because I had faith that Epiphany was going to remain a killer browser.

Now I find out that it has all been for nothing, the developers have decided they are going to totally ditch Gecko and move only to WebKit (with all the compatibility problems it will bring). There are so many reasons why this is a bad idea, none of which I’m going to repeat here.

So I’m now writing this in Firefox instead of Epiphany and I’m pretty happy. Having access to all the extensions that Firefox has is really nice for once. There a number of features which I miss from Epiphany and extensions have filled most of that void, so what did I install?

  • Tab History, this means that new tabs have the same history as the parent tab. This is something Epiphany does by default and I find absolutely vital.
  • Compact Menu 2, a little extension which gives you the ability to have all your menus in a single button saving you precious vertical screen space.
  • Ad Block Plus, got to keep away those evil ads. It’s amazing how annoying the web is with ads, I had gotten so use to not seeing them that I didn’t know how bad it actually was.
  • NoScript, get rid of all that annoying flash and evil javascript. In epiphany I generally ended up just apt-get removing flash, now I can still watch stupid Youtube videos without being violated by monkies.

I also installed two extensions that have no equivalent under Epiphany, they are

  • Greasemonkey, the extension for making websites the way you like them.
  • Firebug, a really cool tool for figuring out how a website is made up and various problems with them.

I’m still looking for an extension which makes the Firefox 3.0 URL bar sane. I really like how the Epiphany one behaves and will probably end up writing my own extension if I don’t find anything. The important features that I require are,

  • Single line per URL with the title on the right.
  • Support for “smart bookmarks” as the last option. These let you search for the current term at Google or Wikipedia without prefixing it with a stupid keyword or something.

Here is what my Firefox looks like currently. As you can see I have significantly customized the toolbar to remove all that excesses.

Screenshot of my Firefox

Tagged , , , ,

Summer comes to an end, but it’s not over.

Well, not really – I’m in the Southern Hemisphere and Summer is yet to arrive. What I am ranting about is the “Google Summer of Code”. This year, much to our suprise Thousand Parsec the space strategy empire building game I founded “oh so many years ago”, was selected to become a mentor organisation.

We had 3 students accepted into the program and then Google also agreed to fund an extra student outside the program! Sadly only 3 out of these 4 students passed the mid-term evaluation, but the work they have been doing is really, really cool!

This last 6 months have been really rewarding personally. I started the project in 2001 and it has been a long slog to grow the project past just the other founder and me. With all these new people who are actively excited about the project (and not just the SoCers!) it has been a huge relief that time over the last 6 years has not been wasted. With myself recently graduating, the nature of my contributions to the project is going to change and it’s nice to know that others will be helping to keep the project alive.

It use to be the case that if I stop working on the project, no progress would be made. Now almost everytime I turn on the computer I see new commits. When I go to our gitweb there is always a lot of green. It’s an absolutely wonderful feeling!

The next 6 months are also going to be really exciting, with TP04 reaching the final stages of specification, a new website reorg, a bunch of new games and an almost complete rewrite of the primary client. We might actually start attracting users :).

Resume

Here is a copy of my Resume. You can find it in PDF form or plain TXT form.

Doh! Pictures gone…

The server I run my blog on got hacked. In a hurry to make a backup of everything before taking the site down I forgot to copy across all the pictures in my blog. I’m now hosting my blog on wordpress.com so I don’t have to deal with all the maintenance problems of running WordPress myself.

Reading News in the future!

Today the RSS feed reader I use called Liferea displayed something very strange. I’ve included a screenshot for you all to see.Yay for numbers wrapping around!


Liferea Bug

Resume