Thailand Trip (part 2)

Got a taxi from Stable Lodge to Bangkok airport early in the morning to fly to Surat Thani. Surat Thani airport reminds me a lot of Avalon Airport. Pretty small and smells funny. Once we grabbed our bags, there was a guy selling tickets to Ko Samui. Perfect.


Air Asia plane at Surat Thani

We jumped on the bus and it took us to the Sea Trans ferry at Don Sak. We got off the bus and onto the ferry for about and hour and a half. Once we arrived at Na Thon port at Ko Samui, we got our bags off the bus and got a mini bus to the bungalow, except the guy must have mistaken me, and dropped us off at the Beach House, not Beer’s House. Simple mistake. Once we worked out where we were, we jumped on a ute with a roof, which finally got us to Beer’s house.

Beer’s house was awesome. We had a bungalow right on the beach. For the few days we were staying in Ko Samui, the weather held out. Just before and just after, Ko Samui had rain and thunderstorms, so we were pretty lucky.

Beer's House Beach-front bungalow
Beer’s House Beach-front bungalow

Ko Samui is an interesting place. Like the rest of Thailand, the roads are full of motorbikes, doing crazy stuff. We did lots of walking around, but mainly around the Lamai beach area which is on the west side of the island. The way the trip worked out, we only stayed there a few days. I could have easily spent much more time there.

Sunday morning we left early to make our way up to Chiang Mai. We organised our trip to the Surat Thani airport with a travel agency, which might have cost us a little more, but it did make it easy. Although Bek and I had this feeling that something would go wrong and we’d miss our flight, it seemed to work out fine in the end.

A mini-bus picked us up at 6:30am from Beer’s House and took us to Na Thon port.
We were told to get on a bus at Na Thon port, which was crammed full. People were standing in the aisle. Nobody had any idea what was going on, we just were fed small bits of english which gave us an uncomfortable feeling.

We took the bus 15 minutes to the Raja Ferry pier. Bek had read lots of bad things about the Raja ferry, so when she saw the sign, she began to get really nervous. Not to mention she also gets sea sick. She’d heard stories about the ferries running aground and other dodgy acts.


Boarding the Raja ferry

We were told to get off the bus, and get onto the ferry. We were also told to leave our bags on there, which made us a little nervous. The ferry ride was fine, so that was a relief. We got back on the bus at Don Sak and travelled about an hour to the town of Surat Thani.

In the middle of nowhere, we had to get off the bus and get into a different one. We when traveled a bit further and had to get out again. This time it was a little shed, which was some sort of bus terminal. We got in a mini-van with a few other people from there on our way to Surat Thani airport.

Meanwhile, I had brought my Nokia Internet Tablet with me and my external GPS. I had pre-downloaded all the Google Maps tiles so I could track where we were going. It was really handy, because we got lost a couple of times. I was following where the guy was taking us for a while, and he was going in a totally different direction to the airport. I was getting a bit nervous, but he eventually turned the van around. He was taking a short-cut ūüôā

One interesting moment was when we were overtaking a truck. We weren’t going that fast and there was a car coming towards us in the other direction but it seems there was time for another car to overtake us at the same time. Thailand drivers are nuts.

We checked in to our Air Asia flight with plenty of time. We flew from Surat Thani to Bangkok airport but had to wait 5 and a half hours to then board another Air Asia flight to Chiang Mai.

Posted in Personal, Uncategorized at November 29th, 2008. No Comments.

Back from Thailand.. only a few dramas

As you may have heard, protests have been going on in Bangkok recently. It seems to be about the Thai people wanting their prime minister to resign.

We finally got a taxi from our hotel to the airport, after many taxi’s refused to take us. The guy who did end up taking us was a bit crazy, and he was going 130 km/h down the 80 km/h freeway and our seatbelts didn’t work.

Protesters were stopping traffic a few kilometers from the airport. Traffic was crawling from there towards the airport, with people wearing yellow shirts yelling a going crazy.

We managed to almost make it all the way to the airport, but we had to get our and walk the last bit, which wasn’t too bad. News says that the airport was closed shortly after, so we were probably lucky.

The Age has an article: Protesters storm Bangkok airport which might give some insight about what is going on in Bangkok right now.

I’ve got more to write about our holiday, but that might have to come tomorrow.

Posted in Personal at November 26th, 2008. 1 Comment.

Thailand trip (part one)

Bek and I managed to score some really cheap JetStar flights to Bangkok six months ago in a 2 for 1 deal. In the end we paid about $400 each for our return tickets, so we’ve had six months to look forward to this trip.

The flight was about normal. It started with JetStar being late to open bag check-in and delays before boarding the flight. During the flight we had the token screaming baby and annoying Americans behind us, not to mention, the in-flight entertainment system was broken. I think this is probably deliberate, to get more people to hire their Video-on-demand systems which cost extra. I came fully prepared with an iPod loaded with new movies which helped a little with the 9 hour flight.

The first thing you notice in Thailand is the humidity as soon as you get out of the airport. It wasn’t overpowering, probably because it was 8pm and a coolish day, by Bangkok’s standards. Bek had done her research, and knew exactly what we needed to do once we got off the plane. We had to find the proper airport taxi queue to avoid being taken for a ride (bad pun alert!). The freeways are pretty smooth and the tollways quick. Lanes and indicators are optional, as well as doing the speed limit. Makes for good fun.

We got the taxi to our hotel, just off Sukhumvit Rd, which was about 30 minutes in the taxi from the airport. The streets that run off Sukhumvit Rd are called Soi’s. We’re staying on Soi 8. It looks more like a laneway than a street, and there is plenty going on, all the time. We’ve actually got two 7-eleven’s on ours, which has been handy changing our large 1000 THB notes to something more manageable.


Sukhumvit Road, Soi 8

We’re staying at Stable Lodge. It has free wifi (which lots of places have here) which is nice. It’s meant that we could book our flights and do some research without having to leave the place. I also put in a call home to let the parentals know we’re still alive. The Eee PC is awesome btw.


Stable Lodge restaurant and pool area

We caught the Skytrain today into the city and exchanged some money and had a walk around the big shopping centers. MBK is the largest. It’s massive. It’s a shame that the prices are too similar to what we’re used to in Australian dollars, but that’s probably more just because I’ve been looking at the gadgets.

The tuk-tuk drivers are seriously pissing me off though. Everywhere you go, there they are waiting to harass you to make you go for a ride with them. They’d probably just take you to their mates jewelery shop. We also had a few incidents at the train station. The ‘official’ information people aren’t official. Even with their fake ID badges.


Busy Bangkok motorway

We bought a couple of long-necks of Chang beer from 7-eleven, which were a bargain at 35 THB and we’re having an early night. It’s up early tomorrow morning to catch our flight to Surat Thani. We go by ferry from there to our next destination.. Beer’s house at Ko Samui. It’s going to be rad.. as long as the weather stays ok.


Bangkok skyline, from our balcony

Posted in Personal at November 12th, 2008. 1 Comment.

How do you clone an LVM partition?

It’s actually more difficult than you might think. From the bit of googling that I did, it seems that you can’t just ‘clone’ and LVM logical volume, while it’s running.

One method I found was to use the ‘snapshot’ feature of LVM to create a ‘frozen image’ copy of the logical volume, which is then suitable for copying to a new logical volume, while leaving the original intact.

Here’s our original logical volume that we want to clone.

# lvdisplay
 
--- Logical volume ---
LV Name                /dev/vg/host-disk
VG Name                vg
LV UUID                UK1rjH-LS3l-f7aO-240S-EwGw-0Uws-5ldhlW
LV Write Access        read/write
LV Status              available
# open                 1
LV Size                9.30 GB
Current LE             2382
Segments               1
Allocation             inherit
Read ahead sectors     0
Block device           254:0

Let’s now create our snapshot logical volume. For the size, it should only need 10 – 20% of the original size, as we’re only mirroring the real volume.

# lvcreate --size 2G --snapshot --name host-disk-snap /dev/vg/host-disk

Let’s take a look at our new volume

# lvdisplay
 
--- Logical volume ---
LV Name                /dev/vg/host-disk
VG Name                vg
LV UUID                UK1rjH-LS3l-f7aO-240S-EwGw-0Uws-5ldhlW
LV Write Access        read/write
LV snapshot status     source of /dev/vg/host-disk-snap [active]
LV Status              available
# open                 1
LV Size                9.30 GB
Current LE             2382
Segments               1
Allocation             inherit
Read ahead sectors     0
Block device           254:0
 
--- Logical volume ---
LV Name                /dev/vg/host-disk-snap
VG Name                server1
LV UUID                9zR5X5-OhM5-xUI0-OolP-vLjG-pexO-nk36oz
LV Write Access        read/write
LV snapshot status     active destination for /dev/vg/host-disk
LV Status              available
# open                 1
LV Size                9.30 GB
Current LE             2382
COW-table size         10.00 GB
COW-table LE           2560
Allocated to snapshot  0.01%
Snapshot chunk size    8.00 KB
Segments               1
Allocation             inherit
Read ahead sectors     0
Block device           254:5

From the output, you should be able to see that we’ve now got some snapshot fields shown in our output. We’ll create another logical volume, which will be our final target for our new virtual machine.

# lvcreate --size 10G --name newhost-disk vg

With our source and target partitions ready to go, we need to begin copying the data. You have some choices here, depending on your setup.

If you’re using the same size partitions you could use dd, or even xfs_copy if you’re using XFS.

If you’re like me, I wanted the new target partition to be a smaller size than the original. Also, if you wanted to use a different filesystem, the only real way to do it is to copy the files.

We’ll need to make the new filesystem on our target partiton

# mkfs.xfs /dev/vg/newhost-disk

and mount our filesystems

# mkdir /mnt/host-disk-snap
# mount -o ro /dev/vg/host-disk-snap /mnt/host-disk-snap
 
# mkdir /mnt/newhost-disk
# mount /dev/vg/newhost-disk /mnt/newhost-disk

I wasn’t sure about how changes to the filesystem would affect the original, so I thought I’d stick to the safe side, and mount it as read-only.

Change into the source filesystem

# cd /mnt/host-disk-snap

Using a mix of find and cpio, copy the files

# find . -mount -print | cpio -pdm /mnt/newhost-disk

Wait a few minutes, depending on your filesystem size, and you’re done.

When you’re satisfied, you can just use lvremove to remove your snapshot volume.

# umount /mnt/host-disk-snap
# lvremove /dev/vg/host-disk-snap

After all that, you should finally have a cloned filesystem to use. I’m sure there’s an easier way, but this worked for me.

Posted in Linux at October 17th, 2008. 13 Comments.

OpenWRT on the D-Link DSL-502T (Gen 1)

NOTE: Much of this isn’t necessary now, because OpenWRT 8.09 now supports AR7. You can just grab the openwrt-ar7-squashfs.bin image to use from http://downloads.openwrt.org/kamikaze/8.09.1/ar7/


I’ve had this old D-Link DSL-502T sitting around, basically working. When I moved place just recently, I took the opportunity to look into getting OpenWRT installed on this thing, basically because I wanted something I could do DNS/DHCP serving on, while giving me some shell access. The D-Link firmware is kinda dodgy, and I always enjoy installing Linux onto something new.

Chris Pascoe’s page is quite dated now, but was a good place to start. Much development has gone into OpenWRT and the AR7 platform, so much of his information is now incorrect. The best place for info is the OpenWRT wiki page for the DSL-502T. It’s much more comprehensive and many of the patches and hacks that Chris Pascoe needed to do have be rolled into the OpenWRT trunk.

Much of this information has been copied and pasted from the above sites. Credits to both of them.

Start by grabbing the SVN trunk of OpenWRT.

$ svn co https://svn.openwrt.org/openwrt/trunk

Once this is done, you can grab any packages you’re interested in. Note that you can install these later using the opkg command once your firmware is running. I grabbed ntpclient, tcpdump, openvpn and the ddns-scripts.

cd openwrt/trunk/package
svn co https://svn.openwrt.org/openwrt/packages/net/ntpclient
svn co https://svn.openwrt.org/openwrt/packages/net/tcpdump
svn co https://svn.openwrt.org/openwrt/packages/libs/lzo
svn co https://svn.openwrt.org/openwrt/packages/net/openvpn
svn co https://svn.openwrt.org/openwrt/packages/net/ddns-scripts

Select firmware components
Enter into the folder and run make menuconfig. Select at least:

  • Target System -> TI AR7 [2.6]
  • Target Profile -> No Wifi
  • Target Images -> SquashFS
  • Image configuration -> LAN IP Address (not required, but makes it easier if you’re already running a network)
  • Base system -> br2684ctl (only needed by PPPoE)
  • Network -> ppp -> ppp-mod-pppoa and/or ppp-mod-pppoe, depending on your ADSL type
  • Kernel Modules -> Network Devices -> select Annex A (which is ADSL over POTS. B is for ADSL over ISDN)

Make sure that you enable your packages from above in the config. E.g. Network -> Time Synchronization -> ntpclient

Quit and save the config.

Get the build dependencies.

For Ubuntu, you’ll need:
sudo apt-get install flex bison autoconf zlib1g-dev libncurses5-dev automake g++ patch gawk

Build your image by doing
make -j3 (for a dual-core system)

The final firmware produced by the build is located in bin/openwrt-ar7-squashfs.bin.

Uploading the initial OpenWRT firmware.

To upload the initial OpenWRT image, there is a tool called adam2flash. It can be found in the OpenWRT trunk, under the scripts directory. To use it, you need to execute the script in the first second or so of the machine being turned on. It’s recommended that you don’t connect the modem directly to your computer, but use a switch in between. This is in case it takes too long for the ethernet cards to negotiate.

One thing I had trouble with was finding out what the initial IP address of the device was. Before you overwrite your firmware, you can find this out by using telnet. Enable the telnet remote management from the D-Link interface and then check out the ADAM2 environment variables. They should be stored in /proc/ticfg (from memory).

If you’re lucky, you might see an entry starting with my_ipaddress. Mine was 10.1.1.199, but many others have mentioned 192.168.1.1. On my DSL-502T (Gen II), it haven’t found it’s IP yet. It wasn’t set in the file.

Lots more info about the ADAM2 bootloader can be found at the Seattle Wireless site. http://www.seattlewireless.net/ADAM2

Here’s the steps:

  • Download a copy of the standard D-Link firmware so you can revert to it if things go wrong! You need the “web upgrade” .BIN version of the firmware, not the .EXE version. D-Link firmware can be downloaded from (for example) http://www.dlink.com.au/tech/
  • Configure your PC for a static IP address on the same subnet as your modem’s default IP address.
  • Choose an IP address for your modem. The OpenWrt firmware will use 192.168.1.1 after rebooting (unless you set it in the menuconfig), so that’s a sensible choice.
  • Turn off the modem.
  • Run adam2flash-502T.pl, providing the modem IP address you chose and the new firmware to upload. If you are changing between D-Link and OpenWrt firmware, you will also need to specify -setmtd1 (if you forget this, the script will tell you that you need it and exit)
  • Turn on the modem.
  • Wait for the upload to complete. Here’s a sample session:

$ scripts/adam2flash-502T.pl 192.168.1.1 -setmtd1 bin/openwrt-ar7-squashfs.bin
Looking for device: ..... found!
ADAM2 version 0.22.2 at 192.168.1.1 (192.168.1.1)
Firmware type: OpenWRT (little-endian)
logging into ADAM2 bootloader.. ok.
checking hardware.. AR7RD / DSL-502T.
checking MTD settings.. ok.
Firmware size: 0x00280004
Available flash space: 0x003e0000
Preparing to flash.. ok.
Erasing flash and establishing data connection (this may take a while): ok.
Writing firmware: ............. lots of dots ......... done.
Rebooting device.

If you have trouble with this (as I did) you might need to hack the adam2flash-502T script a little. I commented out the whole section about doing the UDP probe part, and just passed the IP address right into the $box variable.

Getting the LEDs to work
Grab a copy of the ledsetup script found in the scripts directory of your SVN checkout. Install it into /etc/init.d and it should run on start-up. This will give you the ethernet light, and also map the USB light to ppp0. Very handy.

DSL Sync
When I finally got my ADSL connected in the new place, I couldn’t get DSL sync. It seemed to be because I had the wrong modulation set.

When you boot the device, you should see something like this in your dmesg.

Registered device TI Avalanche SAR
Sangam detected
requesting firmware image "ar0700xx.bin"
avsar firmware released
tn7dsl_set_modulation : Setting mode to 0xffff
Creating new root folder avalanche in the proc for the driver stats
Texas Instruments ATM driver: version:[7.03.01.00]
DSL in Sync

The line about setting the mode to 0xffff is important. For me, my initial mode was being set to 0x7f (which wasn’t for ADSL2+). The 0xffff mode means to negotiate the best speed (ADSL 1 or 2, 2+). This is set in the ADAM2 environment so if this needs to be changed, you’ll have to reboot your modem and use the onboard FTP server’s commands SETENV, UNSETENV, GETENV (all caps matter), by doing telnet to your modem’s default IP address on port 21.

$ telnet 10.1.1.199 21
220 ADAM2 FTP Server ready.
530 Please login with USER and PASS.
USER adam2
331 Password required for adam2.
PASS adam2
230 User adam2 successfully logged in.
GETENV my_ipaddress
200 GETENV command successful
my_ipaddress 10.1.1.199
GETENV modulation
200 GETENV command successful
modulation 127
SETENV modulation,65535
200 SETENV command successful

You can also set/reset your modem’s default IP address here with the variable my_ipaddress.

Backing up and restoring your configuration changes
OpenWRT saves your filesystem (effectively, configuration) changes in a JFFS filesystem mounted at /jffs. As this filesystem is dynamically sized based upon the size of your kernel and SquashFS, uploading a new firmware image may cause your configuration to be lost.

You can back your changes up to a file on your local machine via ssh:
ssh root@172.18.0.1 tar cf - /etc/ > dsl502t-backup.tar

To restore a saved configuration, we reverse the direction of the transfer. The following command checks the configuration copied properly before deleting the old configuration:
ssh root@172.18.0.1 'cat > /tmp/.r.$$ && tar tf /tmp/.r.$$ && cd / && rm -rf etc/* && tar xf /tmp/.r.$$' < dsl502t-backup.tar

Updating your OpenWRT install
SCP over the new image
desktop# scp bin/openwrt-ar7-squashfs.bin root@172.18.0.1:/tmp/newimg

Log into the OpenWRT device, and use the mtd command to write the new image:
openwrt# mtd -r write /tmp/newimg linux

This should then go through a write/verify process, and once completed it will reboot into the new image.

Posted in Personal at October 10th, 2008. 19 Comments.

Mastering MythTV MPEG2 files to DVD

MythTV is a wonderful project, which I’ve been running for nearly 12 months. In the AFL season 2007, I was downloading the Geelong games from the internet. Unfortunately, you’re at the mercy of whomever was encoding the game, in terms of quality. By Geelong winning the premiership last season, most of the games were broadcasted on free-to-air TV and I was recoding them all using MythTV, with the intention of putting them on DVD later.

I tried using MythArchive, but it was clumsy and didn’t give me enough control of the DVD creation process. I wanted the video to fit exactly on a single sided DVD, with minimal loss of quality, so I had to the process manually.

The problem I found trying to encode MythTV’s mpeg2 files was that you would always get the the video and audio out of sync. The length of the broadcast was around 3 hours long, so by the end, the sound could be more than a second behind the video. I think this is due to missing little pieces of the data from the broadcast.

To fix the broadcasting issues, use ProjectX to split the video and audio
java -jar /usr/share/java/ProjectX.jar -demux -out <your tmp directory> -name <your output filename prefix> <input mythtv recording file>

You’ll see some output like this:


demuxing DVB MPEG-TS file 1010_20080802192500.mpg
!> PID 0x0 (PAT) (0 #1) -> ignored
!> PID 0x100 (PMT) (188 #2) -> ignored
ok> PID 0x200 has PES-ID 0xEA (MPEG Video) (376 #3)
ok> PID 0x240 has PES-ID 0xBD (private stream 1) (TTX)  (5264 #29)
ok> PID 0x28B has PES-ID 0xBD (private stream 1) (20680 #111)
ok> PID 0x28A has PES-ID 0xC0 (MPEG Audio) (84412 #450)
-> video basics: 720*576 @ 25fps @ 0.7031 (16:9) @ 9000000bps, vbvBuffer 95
-> starting export of video data @ GOP# 0
!> dropping useless B-Frames @ GOP# 0 / new Timecode 00:00:00.000
6 %!> PID 0x200 -> packet 2687051 @ pos. 505165400 out of sequence (15/11) (shifting..) (~00:12:34.480)
!> PID 0x200 -> packet 2687616 @ pos. 505271620 out of sequence (1/14) (shifting..) (~00:12:34.960)
12 %!> PID 0x200 -> packet 5943135 @ pos. 1117309192 out of sequence (12/6) (shifting..) (~00:27:44.080)
16 %!> PID 0x200 -> packet 7860852 @ pos. 1477839988 out of sequence (8/14) (shifting..) (~00:36:38.320)
17 %!> PID 0x200 -> packet 8427938 @ pos. 1584452156 out of sequence (6/10) (shifting..) (~00:39:16.720)

Once this is done, multiplex the Video and Audio files back together again
mplex -f 9 -o <your output filename> <video file>.m2v <audio file>.mp2

This should give us a nice clean MPEG2 file, which we can then cut all the ads out of. Rather than using something like nuvexport and making the ads in MythTV itself, I found it much easier to use Avidemux.

Load the video into Avidemux, then

  • Use the arrow keys and mousewheel to find cutting spots.
  • Use the A_> and <_B buttons to mark the start and finish of ads
  • Hit the delete key to cut the ads

Once you’re done, I always save a project file, in case Avidemux crashes.

You can then load the ‘DVD’ profile from the Auto -> DVD menu. Leave the ratios at 1:1.

Hit the calculator button, select Format: MPEG and Medium: DVD5. Hit apply, and then close.

Hit the configure button underneath the video part on the left. Configure the video output to Interlaced (I used TFF, but prob doesn’t matter) and 16:9 Aspect ratio.

Then, just save the new encoded video. On my AMD 3200+ machine, it takes somewhere around 5-6 hours to encode about 2.5 hours of video.

For me, I found that the Avidemux encoding sometimes failed in the 2nd pass at one of my defined cutpoints. To combat this, I opened the output video to the end of the file to find out which cutpoint the video failed encoding at. With this, I would open up my project file in Avidemux again, and remove a few extra frames either side of my original cut. This was usually enough to get it over the line.

Once this is done, use DeVeDe to create the DVD ISO file.

When adding the newly encoded MPEG PS file, make sure you open the properties of the file click ‘Advanced Options’, and in the Misc tab, select the checkbox ‘This file is already a DVD/xCD-suitable MPEG-PS file’. Don’t worry if DeVeDe tells you the file is 106%, it will fit on a 4.7 DVD.

Once this is done, you should have a nice ISO image which you can burn straight to disc.

Posted in Geek, Linux at August 31st, 2008. 2 Comments.

Latest spam, featuring Britney Spears

Sometimes, I enjoy receiving spam. Lately, I’ve noticed a bunch of Britney Spears related spam, which I’ve had a good laugh at.

The emails all seem to have a link in the body which says something like Watch Video or Click Here with some seedy looking photo. Obviously, you wouldn’t click them… but the subject of some of these I find amusing.

  • Britney’s Dad sends conservatorship lawyer to help Amy Winehouse
  • Britney Spears’ actions too Far Out for Newspaper
  • Britney Spears and Paris Hilton to Visit Burma
  • Britney Spears in training to become lesbian
  • Britney Spears Kidnap Plot Foiled
  • Britney Spears Out of Hospital and Fighting for Palestinian Cause
  • Britney Spears Picks Nose
  • Britney Spears Plans To Auctions Off Her Children On EBay
  • Britney Spears Recording New Album – Forgotten How To Sing
  • Britney Spears Stashed Guns in her Vagina – Papparazzi Duck for Cover
  • Britney Spears Threatens to Ditch Greenback
  • Britney Spears Vagina Taken To Hospital
  • California Storm is Britney Spears Fault
  • New Britney’s paparazzi video. She must be really crasy
  • Britney Spears Applies For Barack Obama Masseuse Job?
  • Britney Spears is dating Obama
  • Britney sues vagina for divorce
  • Britney shaves her head again. Also seen shopping naked
  • Britney in Gaza’s shocking rehab romance
  • Britney Spears Not Bipolar – New World Order Conspiracy Afoot

.. and my favourite:

  • Britney Spears Is Actually A Piece Of Broccoli

I’m seeing a trend of these for Paris Hilton also.

  • Paris Hilton Becomes Mormon — Marries Paparazzi
  • Paris Hilton Returned By Aliens
  • Paris Hilton: I will give my Body to the Winner of the French Open

Ah, spammers. When will you just get a life.

Posted in Funny at August 22nd, 2008. 5 Comments.

Nokia Sports Tracker

It’s been a while since I’ve posted on here, but I wanted to share something cool that I found.

It’s called the Nokia Sports Tracker and you can use it for tracking your workouts. As friends of mine will know, I do a bit of running. Sometimes it’s handy to know how far you’ve gone or how quickly you did it in.

Just put your recent Nokia phone with built-in GPS (or add a bluetooth GPS unit, if you don’t have it built in) in your pocket when you go running, cycling, walking to track your distance and speed. What’s really cool is that if you have mobile internet access, you can send your data in real-time so others can see your progress plotted on a google maps interface.

Last Saturday, I decided to try it out. You can check out my run details here:

http://sportstracker.nokia.com/nts/workoutdetail/index.do?id=305325

Posted in Personal, Running at July 21st, 2008. 14 Comments.

Finally getting everything to work on Gutsy

I had everything working quite well on my Macbook Pro (Core 2 Duo) with Ubuntu Feisty, but due to some badness from the shitty, shitty ATI fglrx driver, I couldn’t use Gutsy with everything working.

The new kernel in Gutsy moved from the SLAB allocator to the SLUB allocator. (Btw, I have no idea what that actually is..). So, this meant that I couldn’t put the machine into Suspend mode while using the ATI drivers. Although the RadeonHD driver works quite well, it means that I can’t actually play BZFlag.

To solve this, I ended up compiling my own custom kernel for Ubuntu, and switching it to use the SLAB allocator. I thought it would be appropriate to blog it here in case anyone else is interested.

I followed much of the instructions from the Macbook Pro page on the Ubuntu Wiki, but I built a deb package for my kernel. So have a look at the Unofficial ATI linux driver wiki page for installing on Ubuntu Gutsy.

Here we go:

Symlink the firmware directory. This is usually needed for the initrd.
sudo ln -sf /lib/firmware/2.6.22-14-generic /lib/firmware/2.6.22.9

Install all the required packages
sudo apt-get install linux-source libncurses5-dev build-essential kernel-package fakeroot module-assistant build-essential dh-make debhelper debconf libstdc++5 linux-headers-generic

Extract the kernel source, import the old config and start the make config
cd /usr/src/
sudo tar -xvjpf linux-source-2.6.22.tar.bz2
sudo ln -sf linux-source-2.6.22 linux
cd linux
sudo cp /boot/config-2.6.22-14-generic .config
sudo make menuconfig

In the menu, browse to ‘General setup‘, then select ‘Choose SLAB allocator‘ at the last entry. Change this from ‘SLUB’ to ‘SLAB‘, then exit ‘General setup’.

Select ‘Processor type …‘ and ‘Processor family‘ and change the CPU from ‘Generic-x86-64’ to ‘Intel Core2 / newer Xeon‘, exit ‘Proccessor type …’.

Go to ‘Device Drivers‘ > ‘Sound‘ > ‘Advanced Linux Sound Architecture‘ > ‘PCI devices‘ and Hit the M key to enable the ‘Intel HD Audio‘ module.

I think that Ubuntu packages this driver as part of an extra modules package, but the in-kernel one works fine

Save the new config and exit.

UPDATE: Edit the file /etc/kernel-pkg.conf, and add the line:
CONCURRENCY_LEVEL = 3

This should make sure of both cores when compiling your new kernel. This will take it down from about 1 hour to still timing it, please update

Build your new kernel package
time make-kpkg --rootcmd fakeroot --uc --us --initrd binary

I think it’s a good idea to boot into your new kernel here. Make sure everything’s working before you move on.

Download the ATI driver installer ati-driver-installer-7-11-x86.x86_64.run

Build Ubuntu fglrx packages from the ATI driver script
sudo bash ati-driver-installer-7-11-x86.x86_64.run --buildpkg Ubuntu/gutsy

Install the fglrx packages
sudo dpkg -i xorg-driver-fglrx_8.433-1*.deb fglrx-kernel-source_8.433-1*.deb fglrx-amdcccle_8.433-1*.deb

Build the fglrx kernel module package.
sudo module-assistant prepare,update
sudo module-assistant build,install fglrx -f
sudo depmod -a

Install the fglrx kernel module
sudo dpkg -i fglrx-kernel-2.6.22.9_8.433-1+2.6.22.9-10.00.Custom_i386.deb

Make sure you’ve got fglrx set in the device section of your xorg.conf.

That should do it.

Posted in Geek, Linux, Ubuntu at December 21st, 2007. 2 Comments.

Blogging from my Internet tablet

I am blogging from my Internet tablet. Nice.

Posted in Personal at November 22nd, 2007. 1 Comment.