Category Archives: Linux

Kobo Mini Haxxing

Last weekend a buddy of mine picked up a Kobo Mini on sale for $40 while we were out and about. Smoking deal for the baby brother of the ereader I use (Kobo Glo). After sharing the sale info with friends it was pointed out to me that the kobo is readily hackable. At $40 it was really hard to turn down the opportunity. So I bought two of them.

Foolishly I went through the setup/registration/autoupdate on them before doing much reading into it. After finding out that the first app (Kobo Weather App) I wanted to try out required a python library that didn’t like the latest firmwares (2.6.x) project number one became revert back to an older firmware.

After some trial and error the process worked out as such:

  1. Reset the device to factory defaults. Settings -> Device Information -> Factory Reset
  2. The device will reboot after it restores to the factory image. Select Computer Setup.
  3. Plug the Kobo in and copy the desired firmware (from here) to the .Kobo folder on the SD card
  4. Umount the kobo and unplug it, it will reboot again.
  5. Select Computer Setup a second time, plug in via USB.
  6. Using sqlite open .kobo/KoboReader.sqlite I found instructions for this here, however when I attempted the sql insert it failed saying that the user table now has 7 columns and I was only giving it 5 columns of data.  I ran:
    PRAGMA table_info(user);
    to display the current table schema. It seems like at some point they added a column for Facebook Login and whether or not you’ve purchased anything from the store. I added the extra two columns of data to the insert statement:
    INSERT INTO "user" VALUES('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa','aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa','xxxx@xxxx.xx','xxxx@xxxx.xx','2aaaa aaaaaaaaaaaaa==','','0');
  7. Exited sqlite, ejected the mounted volume, unplugged the Kobo Mini, and it jumped from the setup screen to the main screen of the Kobo software. My mini was now running 2.5.2

After that I copied over the update package to enable telnet, shut down the device, disassembled it, took out the sd card and used ddrescue to create an image of the card. Now I can install apps and muck around and have a good point to revert back to should I break the install too horribly in my playing.

It’s an ENTS Miracle

The second worst thing about this time of year is the static charges that build up due to the complete lack of humidity. The worst thing about this time of year for a geek is the hardware you kill because of those static charges.

I almost killed my netbook today. I’d just finished burning a CD with a USB attached external and when to close the burning app and *ZAP*. Hurt like all hell and the netbook immediately powered off. I unplugged the USB drive and fired up the netbook, all seemed OK. I’d zapped the thing in the past and it’d been just fine so I wasn’t too worried at first.

And then the back-light cut out just after I remarked that “I’m surprised I haven’t killed this thing yet”. 2 minutes later, the back-light comes on again. It cycles back and forth time and time again, each time the on period becoming shorter and the off period becoming longer.

Out of an amazing stroke of luck one of the other guys in the hackspace today not only had an Acer Aspire One 110 with him, but he also knew his way around an oscilloscope too. I pulled my netbook apart and we attached my LCD module to his Aspire One and let it ride for a while. It behaved perfectly. So we started thinking the issue wasn’t with the back-light but either the power provided by the motherboard or with the dimming signal sent to the display module. With Matt’s netbook still powering my display we spent some time noodling around with the oscilloscope and with the help of possibly the correct data-sheet for the LCD module we verified that the LED back-light was powered by +5V and the brightness is controlled by a +3.3V PWM signal. Once we determined what the cause of the problem was, either the +5V line cutting out or the +3.3V signal getting mangled we could route around the problem. If it was an LED power problem then I could borrow some +5V from the USB lines to the webcam. If the +3.3V PWM signal was borked I could just wire the +3.3V line that fed the LCD module to the brightness control line and deal with a permanently-100%-bright LCD. With all that determined we shut down Matt’s netbook and connected my LCD module to the internals of my netbook.

I fired it up and waited for it to fail. And waited…. and waited… and it hasn’t happened since. I put everything back together and it’s been behaving. All that planning and geekery and I don’t even get to claim to be responsible for the resurrection of this netbook. Apparently I have a self-healing netbook. It’s an ENTS miracle.

A fix!

Disabling a udev rule that calls part of libata and does some other magic seems to prevent the HSM Violation. This is a temporary workaround until the kernel bug is resolved. Infohere.

For the record, this is on an Acer Aspire One ZG5 with a SuperTalent FEM32GF13M 32GB SSD running Debian/Squeeze and 2.6.30-2-686.

Good way to start the day


[ 121.816110] ata2: lost interrupt (Status 0x58)
[ 121.820044] ata2: drained 2048 bytes to clear DRQ.
[ 121.823588] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 121.823697] ata2.00: BMDMA stat 0x4
[ 121.823821] ata2.00: cmd c8/00:08:d5:2c:ce/00:00:00:00:00/e1 tag 0 dma 4096 in
[ 121.823829] res 58/00:08:d5:2c:ce/00:00:00:00:00/e1 Emask 0x2 (HSM violation)
[ 121.824093] ata2.00: status: { DRDY DRQ }
[ 121.824240] ata2: soft resetting link
[ 121.996468] ata2.00: configured for UDMA/100
[ 121.996507] ata2: EH complete

To be fair, I noticed it last night but I didn’t bother looking into it. When time allows today, I guess.

Netbook Upgrades

A few months ago I was having issues with the keyboard on my Netbook. I found some keys just simply took more pressure than others to register a hit and I found that results of my typing looked like I was from myspace.

Ebayed a new keyboard with a standard layout instead of the international layout and that problem was solved.

Shortly after that, the power adapter bit it. Ordered a new brick in through a local shop and all is well. Bonus is this one uses a double barrel cord instead of a triple barrel cord and is physically smaller so it’s easier to pack around.

And last but not least, I picked up an 9-cell extended battery from DealExtreme. I found that the 3-cell that came with my AA1 just wasn’t enough to be willing to leave the house without the power adapter. Now instead of 2ish hours of battery life I can run around with 6+. Not bad for $55.

With the above issues resolved I’m finding I like the netbook more and more. I spend less time on my workstation at home, and I leave the work-laptop at work unless I’m going on the road for more than a few days. I’d tried out Ubuntu Netbook Remix 9.04 and it’s stuck. I like the netbook launcher over default gnome. This has definitely been one of my more successful toy purchases to date.

On TMPFS on the Acer Aspire One

I’ve found FireFox3 to be rather slow on mouse and a bit of reading shows that it’s primarily due to how disk i/o heavy FF3 is. SQLite backed this and that, it’s more than the poor little SSD can take. However with 1.5gb of ram there is a solution. TMPFS!

I’ve mounted a ram-backed TMPFS and run Firefox, Thunderbird, Liferea and Pidgin out of there. It’s made a huge difference. I started with the instructions from here, and have since modified the setup over the last week.

Step by step, this is what it would take to recreate what I’ve done. As your regular, browsing user:
$ mkdir ~/.tmpfs

Then as root add the following to /etc/fstab, modifying it for your username, uid, and gid:
my-tmpfs /home/$USERNAME/.tmpfs tmpfs size=200M,noauto,user,exec,uid=1000,gid=100 0 0

With that done I modified the shell script to read as follows:
#!/bin/bash
# Change this to match your correct profile

cd "${HOME}/.tmpfs_backup"
if test -z "$(mount | grep -F "${HOME}/.tmpfs" )"
then
mount "${HOME}/.tmpfs"
fi

if test -f "${HOME}/.tmpfs/.unpacked"
then
rsync --exclude='Cache' --exclude='.unpacked' --exclude='lock' -r "${HOME}/.tmpfs/" .
else
cd "${HOME}/.tmpfs"
cp -r ${HOME}/.tmpfs_backup/* . && touch .unpacked
fi

I named it tmpfs_rsync and put it in ~/bin. That’s right, no more tar for this guy. I found that after adding Thunderbird, Liferea and Pidgin into the mix, I was creating a sufficiently large enough tarball that performance would drop through the floor every 5 minutes as it backed up the tmpfs. Speaking of every 5 minutes, the respective crontab line for my user:
*/5 * * * * ~/bin/tmpfs_rsync

Make the script executable, and execute it once to mount the tmpfs and create the .unpacked lock-file of sorts:
$ chmod u+x ~/bin/tmpfs_rsync
$ ~/bin/tmpfs_rsync

With that done, all that’s left is to copy what you want to the tmpfs, then symlink it back in place. In the case of Liferea:
$ mv .liferea_1.4 ~/.tmpfs/liferea
$ ln -s ~/.tmpfs/liferea_1.4 .liferea_1.4

I repeated the above for Firefox, Thunderbird, and Pidgin and bob was my uncle. Make sure tmpfs_rsync executes once before shutdown and everything is backed up.

Apparently I don’t fuck around

Yesterday I ended up migrating what was left of my colocated machines onto a single VM. Had about 5 minutes notice before I decided to pull the trigger and with that in mind I have to say it went fairly well. I’d already updated DNS settings for my domains in anticipation of a change as well as dist-upgrading my main hosting VM and updated the hosting panel to the latest stable release.

With all that done, starting with a fresh install of Debian Lenny it took a couple hours after work to migrate most things over. I bollocksed up the first installation of ISPConfig, not entirely sure how and ran into a database issue. Being that this was a migration though I figured the easiest thing to do was to nuke it and reinstall the hosting panel. Did that, re-imported the databases and away we went. Had a bit of a mail issue for a few hours, nothing major though.

I spent a bit of time this morning modifying the hosting system to put mail tagged as spam in a Junk folder under each users’ IMAP root and we’re back up and running as we were yesterday with relatively little downtime. Exceedingly little considering it wasn’t a planned move. So for anyone I host that was wondering what the story was yesterday, that’s it. We migrated and upgraded. Now to arrange a time to go collect my hardware and sell it off.

There are a dozen aborted posts under drafts

All of which I want to finish, none of which probably will be. I think Ze is right, if you have a neat idea just throw it out there now. To hell with trying to release it when it’s ready just punt it out the door and see what happens.

There’s stuff in there I would liked to have written about at the time, and I could do some small posts about them but I don’t know that it’s all that engaging to do so. So fuck that noise.

I saw Richard Fucking Stallman, a few weeks back, give a talk on how Copyright harms society. Nothing unexpected, I got to ask a question and he interrupted me as I pretty much expected he would.

A few days later I bought an Acer Aspire One. Upgraded it to 1.5gb of ram and soldered in a bluetooth adapter. Wiped whatever the hell distro they put on there and installed Debian Sid. Happy times.

The Soekris is coming along, it’s doing all routing at home quite handily and I’m working on asterisk. Once that’s done I think it’s time to ditch the personal cellphone. I’m tired of giving rogers money. The number will be ported to the VOIP account and people who don’t get the new mobile contact number immediately will have to accept voicemail and email as contact options for me.

Further to that, I think it’s time to ditch the equipment at the colo. Nothing I do right now justifies a half-rack of equipment, I could do everything I do currently in a rented VM, so that’s the plan.

It certainly does sound like I’m trying to cut expenses, and that’s because that’s exactly what I’m trying to do. I had a plan for this year, I think it’s about time I made it happen.

Other news, the Golf was broken into this week. They got away with a flashlight and a couple of car chargers. Fuck them and everyone who questions my carrying the tactimurse.

Time to stay angry.

Oracle is reborn!

Years and years ago, when I first started playing with linux and teaching myself networking I built up a PC to use as a router at home. It was based on the family’s old desktop, a Pentium 2 233 w/64 mb of ram. I hacked up an old AT case to mount the ATX board in and used the only spare hard drive I had, a 100mb drive. I squeezed an install of Debian Potato (2.2) on there in just over 50mb and I had myself a router running ipchains. Over the years oracle grew up, was upgraded to a Athlon 2200+ and 512mb of ram, I added a bunch of hard drives one by one and she became the home fileserver.

A drive failure one saturday morning in September 04 led me to the job working at the mom&pop computer shop. I was looking for another harddrive with the same disc geometry so I could swap the logic board, apparently that was enough to peak the interest of the owners.

It was with that failure in mind that led me to decomissioning oracle. I consolidated my data, and my drives, and built up my RAID array in neo. Oracle was replaced by sati, a WRT54GS running OpenWRT.

Oracle is reborn though. I’ve recently picked up a Soekris Net5501-70 to use as my router at home and it seems that sati just isn’t the appropriate name, as this embedded PC is more powerful than sati ever has been, and will do more than sati ever could. It is only appropriate that the 5501 take on the name oracle, and a few very similar roles as well as some new ones.

The new oracle is 500mhz AMD Geode LX with 512mb of ram running on a 4gb Transcend compact flash card. I’ve installed Debian Etch (4.0) and she’ll be running as the gateway/firewall for the home network, with sati handling only WAP duties from now on. Oracle will be responsible for traffic shaping and DNS (both caching the external net and running the .thematrix.dagr.net domain internally). I intend for oracle to also run Asterisk for my local network, feeding my Linksys PAP2T-NA as well as my Cisco 7960. I’ve been considering bringing in a DSL line to suppliment my cable connect. Not so much  for the extra bandwidth but for the better conenctivity for work.  Currently traffic from home goes to Vancouver to get to the office 7km away from my flat. I think oracle would serve well to run an IPSec link to the office via the DSL line and keep my personal traffic routed over the cable line. I’m not sure what else the new oracle will get up to, but I’m certainly looking forward to playing. This is the first new toy that’s not just a mere upgrade I’ve gotten for the home network in a good long while and I can feel the hacker juices flowing again.

I’m rather excited.

Quick Xen Note on PAE

I’ve got lots to blog about, but I’ve been too busy playing with new toys to get around to it. This is just a quick note for the internets.

Running Xen on Debian Etch on a machine with 4gb of ram, if you get

"PAE mode mismatch error (xen=yes dom0=no)"

you need to install:

apt-get install xen-hypervisor-3.0.3-1-i386-pae

as the default xen kernel now enables pae by itself when necessary, and the default hypervisor doesn’t support it.