eggfriedrice.com

Making Ubuntu Hardy Heron work with a Radeon 9600

May 9th, 2008

This is one of those “blog it so I can find it again” posts (much like that entirely unfascinating post on disabling Magic Quotes which I still search for when I have that irritation. See, blogging is useful after all!). This might also be useful for someone else so I’ll list the steps I took.

This post is about making an ATI Mobility Radeon 9600 in my old Toshiba M30X laptop work with Ubuntu 8.04. I just freshly installed Hardy Heron on the Tosh and found that the graphics driver is many times more screwy than it ever used to be. It worked fine with Gutsy Gibbon (which loaded a reasonable driver and correctly autodetected the panel resolution) but with Hardy I was instantly boned.

When booting the Hardy live CD to the live desktop the picture became a scrambled mess as soon as it hit GDM, which makes it fairly safe to assume the graphics driver is wonky. It installed fine using the “Safe Graphics Mode” option (hit F4 from the boot prompt for more options) and xorg defaulted to the vesa driver (which worked but at the wrong resolution).

After much faffing I’ve discovered that the open source Radeon driver doesn’t seem to work particularly well at the moment (launchpad has a few bug reports about it). The solution: go closed source (hmm, yes, that sucks).

I installed the ATI binary driver using the following steps (adapted from here):

  • Make sure the ATI driver package is installed (it was already for me): At a terminal run sudo apt-get install xorg-driver-fglrx
  • If the package wasn’t already installed, run this to load the module: sudo depmod -a
  • Edit /etc/X11/xorg.conf and replace Driver “vesa” with Driver “fglrx”
  • Run sudo aticonfig --inital -f to set up xorg.conf
  • Restart xorg (log out then kill X with [Ctrl]-[Alt]-[Backspace] (brutal but effective))
  • Hope everything works out nicely

It seems to have worked here but we’ll see just how stable it is…

Chuckle of the day

April 6th, 2008

Ahh, blogging. I never really got the hang of it. Anyway, here’s my chuckle of the day taken from the Freecycle Edinburgh mailing list, here’s an excerpt from an offer advert for a Samsung CRT monitor:

I have a really good quality Samsung 19″ CRT monitor going spare - I just don’t have room for it in my new flat.

The monitor works perfectly and has excellent colour reproduction, so really good for anyone that does digital photghraphy or design work etc.

The only problem with it is that a couple of years ago, during a fit of angst when installing Windows on a new PC, I wrote ‘F### Bill Gates in the ass” on the front of the monitor. In permanent marker. Oops. I’ve tried to get it off, but it won’t budge (it’s faded a bit, but still clearly visible).

Snigger.

A complete tosser’s guide to pancakes

February 5th, 2008

It’s very simple:

  1. Print this recipe out
  2. Stick it to somewhere handy in your kitchen
  3. Follow it to the letter
  4. Enjoy fabulous pancakes and excuse to use that new Jamie Oliver frying pan you got in the sales

Thanks Delia!

Note: Be careful using non-milk type spreads instead of butter, oil based ones float on the top of the batter. It doesn’t taste bad but it does make the pancakes a bit slippy to hold.

Tomorrow night: How to enjoy pancakes the year round and on days other than Tuesday.

(Man, this is so seamless nobody will notice I haven’t blogged for about seven years!)

Tasty Links

August 14th, 2007

eggfriedrice, now with del.icio.us!

My three (count em!) links should be appearing over in the sidebar on the right. I tried using a caching plugin for Wordpress but that needs CURL support compiled into Apache, which means recompiling Apacahe. Which I can’t be arsed to do right this minute so the caching will have to wait a bit and you’ll have to put up with the javascript.

Never let it be said I’m not right on the ball with new internet fads!

“Power is wasted and danger is made”

August 12th, 2007

According to Sarah this is what happens when you leave the iron switched on. She’s right, and it points out a common failing with many appliances: they stay on when you don’t need them to be on.

In the case of an iron there’s a very simple fix for this, insert a little widget that detects movement (you picking up the iron) and if there isn’t any movement for five minutes switch the iron off. It would be simple to implement, an accelerometer, a microcontroller and a relay. Couldn’t really be simpler, could it? So why don’t irons have a “not in use” timeout? Probably because it makes the device slightly more complicated (not by much though), it adds another point of failure (though modern irons last about six months anyway) and, most importantly, it would add about 25 pence to the retail price.

I guess the only way to get this sort of iron safety device built into new irons would be for the Government to mandate it. Maybe I should start an e-petition for this… I might get three signees, that’s sure to get an act through Parliament!

PHP Number Validation

August 10th, 2007

I have nothing of any use or consequence to blog about today, I did some work, we went to Sainsbury’s, that’s about it really. Instead I’ll post a little PHP trick I’ve discovered.

It’s a very simple one-liner to test if a number is actually a number, it validates this without needing a special class, it just uses built in PHP functions. This is kind of validation is very important if you’re about to poke that number into a database query to, for example, pull out a page based on it’s ID.

This is it:
if($id != strval(intval($id))){
echo("Invalid ID");
die();
}

Variables in PHP are loosely typed so they can hold anything without the programmer specifying what they should be allowed to hold. This means that $id could hold an integer number or a floating point number or a string or an object or any number of other things. What we do here is use intval() and strval() to firstly get the integer value of $id and then turn it back into a string then compare it to itself. The net effect is that if $id holds a 2 intval() will return 2, strval() will then return the string “2″ and that’s the original value (the value in $id was actually a string to start with).

If you put in, say “cheese” then intval() would return a 0. It won’t work without strval() as it is needed to handle the weird values intval() returns (that I don’t fully understand).

All the code does is check that the number is an integer and if not print a message and exit. It won’t catch non-existent database records for example but as a simple, first pass, test it’s quite handy.

Ecogeek: Al’s Very Small Solar Experiment

August 8th, 2007

I’ve always been fascinated by solar power. It’s leccy from the sun! That’s cool! I’ve also always been fascinated by LEDs. Stuff that lights up is ALWAYS cool to at least some minor degree. With this in mind you can see why a £2.99 solar powered garden light in Poundstretcher was purchased fairly quickly.

Here’s my plan: glorious sunshine in, cool LED light out. I could hack it to suck light from outside and put it indoors. The problem is that this gizmo is just too small, I need to scale up a bit (but not to ‘big’, more from ‘pico’ to ‘nano’).

With a bit of prodding from Sarah, and after some eBay searching I settled on a 12 Volt, 5 Watt solar panel which wasn’t too expensive. It looks a bit (well, a lot) like this:
Solar Panel

That’s it sat on one of the front window sills. The solar panel will get hooked up to a big arse battery (arriving soon) to charge up during the day and power (initially) some lights at night.

There are are a couple of minor issues here:

  • I live in Edinburgh, and Scotland isn’t famed for it’s glorious sunshine. But it has been very sunny for at least two days this year and until rain power is cracked it’s probably the most reliable environmentally friendly power source around.
  • I’m on the second floor so this is going to have to sit on a window sill and only get sunlight for half of the day.

Neither of these issues are going to stop me, I’ve done stupider things that have worked!

And, just to prove you can get something out of a solar panel in Edinburgh…
Let there be light!
That’s an RGB LED lit by solar power, bask in it’s brightness! There were resistors involved, I’m actually quite hopeful about getting some useful juice out of the panel, I measured 23 V open circuit and the short circuit current was 130 mA.

We’ll see what happens when the battery arrives. I’ve got a book out of the library that might help a touch: Solar Electricity: A Practical Guide to Designing and Installing Small Photovoltaic Systems. It’s actually got some handy stuff in it, it’s a book aimed at the practicalities of installing a low cost system using simple parts and tools. This appeals to me.

I’ll let you know how it goes when more bits arrive!

Putting the Hop into Hopen Source

August 7th, 2007

If you’ll excuse the quite appalling title to this post (though you really shouldn’t, it’s an offence to any person’s sensibilities), beer makes the code go round. Open source software is driven by it, to the point where free software conferences are timed to line up with beer festivals.

This intro is really just a poor excuse to set the scene for the rest of this post, a review of Black Isle Brewery’s Red Kite Ale. It’s not so much a review as telling you that I’ve just drunk a bottle of this and it’s nice. You might have got a more in depth review if I’d done the wine tasting gargle and spit type sampling but that would have been wasteful.

Instead I’ll tell you that Red Kite is a very pleasant real ale made with organic hops, giving the catchy strap line “Save The Planet - Drink Organic”. Save the planet, drink beer! Who knew it would be that easy! Plus I’ve just written some PHP code that works, thus vindicating my appalling introduction to this post.

I bought my Red Kite from Real Foods but I bought my first Black Isle beers from their stall at the Edinburgh Farmer’s Market (which we haven’t been to for ages) up at Castle Terrace.

I think that counts as a review. Night!

Browsing like it’s 1999

August 6th, 2007

Finally! I’ve got Internet Explorer to run nicely under Puppy Linux under QEMU!

I call it Al’s Antique Browsing Appliance (virtual machine appliances are all the rage you know). And here’s my abbreviated howto in case anyone should want to replicate what I’ve done (though I’m sure there are easier ways, like not running 64 bit Debian in the first place).

  1. Install QEMU on the host box. The QEMU packages in the Debian repositories work fine.
  2. Download QEMU Launcher (not essential but it does make QEMU nice and easy to use).
  3. Download a Puppy Linux ISO image (I used 2.17).
  4. Using QEMU Launcher (or the relevant command line voodoo if you’re really bored) create a new configuration, put the Puppy ISO in the CD-ROM box, add a new image as Hard Disk 0 (I made my a gig and that’s plenty of room)
  5. Select CD-ROM as the boot device. Boot the new virtual machine and follow the locale choosing stuff
  6. Say hello to Puppy (and let your girlfriend give it a name, like ‘Pinkerton’)
  7. (I needed this step to make the install work properly, you might not) Use fdisk from a shell to create a partition table and one big partition of type 83 on /dev/hda. I didn’t do this at first and the Puppy installer did a “superfloppy” install which then didn’t have a bootloader
  8. Run the Puppy universal installer (from Menu -> Setup).
  9. Follow the installer prompts (I think I just used the default all the way through)
  10. Marvel when nothing gets confused as a virtual CD is installed to a virtual hard disk in a virtual computer
  11. When it’s done, shutdown the virtual computer, change the boot device to the first disk and boot again
  12. Now we’ve got an OS it’s time to install the stuff needed for IE, start with the Puppy Wine packages (download the files and click on them from the file manager)
  13. Next, download Cabextract (used to, well, extract CAB files). I used the Slackware package and it worked fine.
  14. Lastly, download IEs4Linux and extract and run (as per the instructions). This cool thing downloads various versions of IE straight from Microsoft and installs them.
  15. Run IE! Running /root/bin/ie6 from a terminal should give you IE6 in all it’s wonderful crappiness.

And there you go, you have a virtual machine that can run IE5, 5.5 and 6 (and 7 with a beta of IEs4Linux) at the same time! Now go and test your websites!

Here’s the proof:
puppyie.png
IE on Puppy Linux on Debian Etch

In other news, I got my Highers results today, I got an A for Computing and a B for Maths. I’m quite chuffed with Maths, it’s not my strong point and the last year has been a bit of a struggle but it worked out in the end. I’ve got what I needed to get into university and it’s nice to have actually completed this and done it fairly well. It’s a nice sense of accomplishment to have worked for something and got it. Oddly the B means more than the A just because it took much more work to get (honestly, if you’re bored next year sign yourself up for Higher Computing and turn up for the exam. If you managed to use a web browser to get to this blog then you should get a C, minimum!).

So now I’ve got four years of uni. Four years! Well, at least I don’t have to sit on a bus for 45 minutes to get there…

Feel the groove

August 5th, 2007

Today we went to see the Edinburgh Cavalcade which pretty much is the start of the festival(s). It’s not every day you see the Lady Boys of Bangkok rubbing shoulders with the Scouts, and the Tay Valley Twirlers following Dr Who (and the Tardis, a Dalek and K9)! We also collected a metric butt load of leaflets and whistles and crap which I think will get a photo for prosperity.

The fine Scottish drizzle was out in force, as you’d expect, so much of the fun was spotting the split in the paraders between those feeling the groove and the ones that were just wet and pissed off. I particularly liked the guy holding the sign for The Edinburgh Samba School and friends who clearly was an ex-raver and was just itching for a glow stick.

In other news I’m still faffing about with emulated Linux. I’m getting somewhere with Puppy Linux now but I ran out of (virtual) disk space because I made the disk image too small. So I’m now growing that with Gparted. In case you hadn’t figured, I’m still not taking the easy way out!