20080622

Vuze-bin Overlay for the Gentoo Community


I thought I'd make my Vuze ebuild available to the rest of the world. Vuze (formerly Azureus before version 3.1.0.0) is the name of a pretty great Java BitTorrent client. This overlay contains ebuilds, launchers, and .desktop entries file for installing vuze-bin-3.1.0.0 and vuze-bin-3.1.1.0 .

Download the overlay here

Don't forget to check the md5sum with 'md5sum vuze_overlay.tar.bz2'. The md5 sum should be 9fc2955cb63a1404f1a35643b38d8085.

To install vuze-bin you have two options,

1) If you are not using layman

mkdir -p /usr/local/portage/vuze_overlay && \
wget -O - http://virtb.visibleassets.com:2080/vuze_overlay.tar.bz2 | \
tar xpvjf - -C /usr/local/portage/vuze_overlay
&& \
ACCEPT_KEYWORDS="~x86" \
PORTDIR_OVERLAY=/usr/local/portage/vuze_overlay \
emerge -av1 vuze-bin
2) If you're using layman (thanks to Donnie Berkholz)
layman -o http://virtb.visibleassets.com:2080/layman.conf -a vuze-bin

Enjoy!

20080611

How-To: The Full Portage Tree on the EEE PC




Gentoo is often considered to be 'bloated' because the Portage tree takes up at least 500 MB on disk. Depending on the filesystem, that could mean that the usage can be sometimes up to 750 MB!

On a UMPC such as the EEE, with only very limited hard-disk space, 750 MB is far over the limit of acceptibility.

My first solution was simply to use a binary Gentoo system. The portage tree was not necessary as long as an internet connection was available and a suitable binary package repository was configured. That has actually been working incredibly well and I have no complaints yet whatsoever. However, I do occasionally like to look into the portage tree for examples on creating ebuilds when I'm doing custom software packaging, so i thought it would be nice to have it wherever I can take my EEE.

Then someone on EEE-User mentioned using SquashFS for the Portage tree. This made absolute sense, because the Portage tree did not need to be updated frequently at all, and could easily be made read only. SquashFS enabled me to have the benefits of a source-based Gentoo distribution on my EEE but compressed the Portage tree from 700 MB to 42 MB !!!

The following 5 steps will demonstrate how easy it is to use Gentoo - even with it's "bloated" Portage tree - on the EEE PC.

Note: I performed these steps on a modified EEE PC with 2GB of physical RAM, which explains how I could mount 768MB of RAM as tmpfs. If you have less than 2GB of physical RAM, then I would suggest making the SquashFS Portage image on a regular desktop computer running Gentoo Linux.

Step 1: Find a portage mirror
You can find all of the Gentoo mirrors on the official Gentoo mirror list. I use


MIRROR="http://gentoo.mirrors.tera-byte.com"


Step 2: Install squashfs-tools


emerge -av1 squashfs-tools


Step 3: Download and Extract the Latest Portage Snapshot

mkdir -p /tmp/tmp2
mount -o size=768m -t tmpfs none /tmp/tmp2
wget -O - "${MIRROR}"/snapshots/portage-latest.tar.bz2 | tar xpvjf - -C /tmp/tmp2

Step 4: Create the SquashFS Image


mksquashfs /tmp/tmp2/portage /tmp/tmp2/portage.sqfs
mv /tmp/tmp2/portage.sqfs /usr

umount /tmp/tmp2
rmdir /tmp/tmp2

Step 5: Create init.d and conf.d entries to simplify or automate mounting

/etc/init.d/portage-squashfs:

#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
need localmount
}

checkopts() {
for var in "${MTPNT}"x "${PSQFS}"x; do
if [ "${var}" = "x" ]; then
eerror "one of the necessary variables was not defined"
return 1
fi
done

if [ "$(grep "squashfs" /proc/filesystems)" = "" ]; then
eerror "SquashFS is not supported by your kernel"
return 1
fi
if [ ! -e "${PSQFS}" ]; then
eerror "${PSQFS}: No such file or directory"
return 1
fi
if [ ! -d "${MTPNT}" ]; then
eerror "${MTPNT}: No such file or directory"
return 1
fi
}

start() {
local mtopts="-t squashfs -o loop,ro"

einfo "mounting ${PSQFS} at ${MTPNT}"
checkopts || ( eend 1; return 1 )
mount ${mtopts} ${PSQFS} ${MTPNT}
eend $?
}

stop() {
einfo "unmounting ${MTPNT}"
umount ${MTPNT}
}

# vim:ts=4


/etc/conf.d/portage-squashfs:

MTPNT=/usr/portage
PSQFS=/usr/portage.sqfs
Lastly, don't forget to make the init script runnable:

chmod +x /etc/init.d/portage-squashfs


Notes:

Extracting the portage tree and creating the SquashFS image in /tmp will work only if you have >= 1GB of RAM, approximately. I was using the EEE PC 8G, which comes with 1GB of RAM and there were no problems at all. Alternatively, if you have >= 800MB on your root device, then you could perform the operation there, but it would be much slower. If another desktop or laptop PC is available, a better alternative is to build the portage.sqfs file on the other machine and then copy it on to your EEE.

Also, it should go without saying that you will need to have root permissions to do this - use 'sudo -s'

You should also be aware, that this will make /usr/portage read-only. Therefore, in /etc/make.conf, set DISTDIR="/tmp/distdir" and PKGDIR="/tmp/binpkgs", or something similar.

20080603

Why Don't Manufacturers Build Mobile Phones to Last?

I bought a Motorola L2 14 months ago from a Fido store in Toronto - I was quite happy with it, considering that all I really ever want in a cellular phone is the ability to talk. The L2, although nothing special by today's standards, was a major step up for me because it had a colour LCD (Wow!!). Aside from that, it was my first major introduction to Google Mobile applications, such as Gmail and Google Maps. I was quite satisfied with the Motorola L2 - until the keys became completely unresponsive! Yes, only 2 months after the warranty had expired, the keys became fully unresponsive! I brought the device back to the nearest Fido outlet and they said it was most likely a short circuit they would not replace the handset, understandably, but also would not repair it. My L2 had not done much more than sit on a desk for the year that I owned it. Usually I used it for little more than a watch! It never got wet or experienced a single fall! Maybe dust was an issue, but it really shouldn't be.




In my opinion, if portable electronics are not built to last, then the manufacturers should be providing either recycling or repair facilities directly to the consumer. There are an estimated 130 million mobile phones disposed of annually in the U.S. alone!
In many cases, a large portion of the mobile phones depicted left were probably fully functional when they were disposed of. In many other cases, a replacement part is all that's necessary to restore the phone to its original fully working state.

I fell back to my previous mobile and it works marvellously!! That was a much more modest device - a DRASTICALLY more modest device than what is common by todays standards. It was a Siemen's A56, with a monochrome display ;-) These sort of devices were built to last !!

Oddly enough, you never see mobiles like this being sold in North America anymore, because the retailers have told us that we need colour LCDs, with games and cameras, and iTunes built-in. But if the phone doesn't work as a phone, what good is the rest?

The Siemen's should be fine for me until the OpenMoko / eo1973 GTA2 is being sold to the general public.

20080523

Improperly Credited Article on Slashdot

Slashdot is a funny place - don't get me wrong, I love to read it. The only problem I've ever had with it is that they edited the OpenMoko article I wrote on their site, and now someone else is claiming to have written it (kdawson).

Originally when I wrote the article, it was credited to 'Anonymous Coward'. I did that on purpose so that I wouldn't make anyone in the OpenMoko community offended, seeing as how they may have wanted to make a post themselves. I just wanted to beat them to it!

In my opinion, the article should have remained credited to 'Anonymous Coward' as opposed to kdawson, whoever the hell that is. Apparently kdawson believes that it is completely fine to assign credit of a work to someone who had nothing to do with the work at all.

What I find even funnier, is that I made a comment to the post I wrote only a week after noticing it was no longer attributed to 'Anonymous Coward'. Then the editors changed it back. Now, approximately 6 months later, someone else has again inappropriately taken credit for another's work.

What's the lesson in all of this? Always post under your real name if you intend to have something show up in the slashdot headlines. I guess I shouldn't feel bad then for copying the Slashdot logo to use with this post :)

A Baby New World


We have a new baby boy!
After a long night of bowling (hoping that would inspire Julien to pop out naturally) with my dad, Wendy, Nora and myself, Erin was called in to have labour induced at about 9:30 PM on Monday the 19th. Erin & I went for a little walk in the park (she was actually biking) to give each other pep-talks - are we ready for this? - and then Bo drove us all over to St. Mary's.

Erin was put on a hormone drip intravenously, which was increased by 6 μg every 1/2 hour. She wasn't feeling any contractions for about 5 hours and was only 1 cm dialated. We were up all night just keeping each other company (Bo, Nora, Erin & I) by playing games, telling stories, etc. Actually, we were only allowed to have 3 people in the room in total, but the nursing staff was very nice and let us all be there. Another nurse came in and boosted our hopes saying that she was 1 1/2 cm dilated. To tell you the truth, we were a little worried that Erin was going to need a caesarian section performed because she was at the maximum drip for a while and there were no signs of progress. Every time they examined Erin, they noticed that Julien's head was really far down, and that he was ready, but Erin had still not started to dilate. Actually 3 or 4 examinations had gone by with exactly the same results.

Then, Erin started getting contractions - she thought it was just indigestion at first, but then they became more and more intense. We all started helping Erin with Le Mas breathing patterns. A doctor came in to puncture Erin's membrane (i.e. water) and as she was lying down so that they could put an internal sensor on Julien to get his heart beat.

After that, contractions became more frequent and increasingly painful. Erin was lying down for them and she was in so much pain. We were all massaging her and practicing the breating. The nurses kept asking her to stop pushing, but she wasn't pushing at all -
I think it must have been the hormones that were causing the contractions to be so intense that they were just pushing the baby along all by themselves. Erin started to lose coherence because the pain was so intense, and then I said - "Erin, breath like your mom - just watch how your mom is breathing, and do it like mom does ok?" Bo jumped right in and was like the breathing coach. She sat Erin up, and told her when to hold it, when to inhale, and when to exhale. They had such a strong connection. After sitting up, and holding her breath for a second or two like Bo, Erin said that the contractions started coming under control after about 20 minutes.

Between about 5:30 AM and 9:00 AM she went about 2cm every hour, which is twice as fast as normal! She went from 2 cm dilated to 10 within about 2 hours - it was unbelievable! Bo was helping Erin keep the contractions under control while Nora and I were massaging Erin's back and legs. Nora & I waited outside while Erin received her epidural. The anesthesiologist had to really tell me to get out of the room because I wasn't fully prepared to leave Erin there, but she saw that Bo was helping Erin's breathing, and Erin asked if it was ok for her mom to stay there. So Bo got a mask on and helped Erin while she had the epidural.

After that, it literally took 5 pushes and about 20 minutes - things moved so quickly! Nora graciously stayed in the waiting room because they would only let Bo & I be there for the delivery. We were standing right there helping Erin along as she pushed, and then... well ... I don't think there are any words to describe the euphoria that we were all experiencing and even if there were I doubt that I could do it justice. I will never forget as long as I live.

Julien Michael Jacob Friedt was born on Tuesday, May 20th at 10:48 AM. He
weighed 8 lbs and 5 ounces at birth. He's totally healthy and scored a solid 9.9 on whatever test it is that they use. Labour lasted about 8 hours.

We got to hold him and talk to him immediately. I cut the cord. He was so real - it was so hard to believe what I just experienced happened - but at the same time, it was like we knew eachother all along. He recognized immediately when I started playing with his feet, just like when he was in his mom.

My dad came to visit right afterwards and they got to say hello to little Julien. Then we were moved to a bed in another wing for the next 48 hours. I was a little detached from the world because we weren't allowed to use cellular phones in the hospital, and they don't have public internet access anywhere inside. I only really left the hospital once or twice to get some food and necessities.

Bo & Nora were really helpful for those 48 hours while Erin & the baby were under supervision. Me? I was having the time of my life playing with my new little boy. He's so alert and inquisitive and incredibly well behaved... oh and he's just CRAZY cute!! hahaha...

When we were finally dischared to go home, stepping out of the hospital with my son was like stepping into a wholly different world.

It's been really nice being back home. We've had a few visitors already and lots of support from family and friends with phone calls, SMS, or even e-mails.

Soon we'll have lots of pics posted on facebook or picassa.

20080513

Julien Updates

Yesterday, Erin, Bo, Julien & myself had a nice long day at various doctor's offices. First thing in the morning we went to Dr. Shine's office and he said that Erin still isn't dilating, so we booked an appointment to have Julien induced next Monday. Then we went to the women's pavilion at St. Mary's and waited around for a while to get a stress test done on Julien & Erin. The test checks the baby's heart rate, movement and Erin's contractions. The baby showed textbook-perfect patterns for his heart rate, so we know that he's doing well and he's healthy and comfortable. On the other hand, Erin still hasn't had any contractions that she's noticed. So since Julien is already 4 days late, and it's bad if the baby is any more than 2 weeks late, and we can only book induction mondays or wednesdays, we thought it was probably safer than not to book it for next monday. I'll have more updates later on.

Today for lunch Erin & I are going to pick up some peppermint & tarragon for the planters on our balcony. So far, we have basil, greek oregano, spearmint, savory, and rosemary. On the weekend we also picked up a set of chairs and table for the front balcony and a couple of reclining / folding chairs for the back balcony (or for taking into the park).
I'll put up some photos eventually of the front balcony with a view of the park & our little hanging garden at some point.

Cheers!

20080511

Some Thoughts About Becoming a Dad


Well, I thought I should probably write a post about the new life that Erin & I are about to introduce into the universe. We're now about 3 days past Julien's original estimated debut of May 8th and it feels a little weird that we're no longer counting down the days.

It's a bit of a thrill to tell you the truth - I almost feel nervous about meeting this new little guy who will soon have an endless stream of wonders projected onto his senses. I almost feel nervous, but I think we've already started to get to know each other over the last few months by means of morse-code belly communications at times when Erin is not yet worken up. He would stretch out his legs when he felt the morning sun warming everything up and then I would send him an impulse in reply through Erin and on the bottom of his foot.

I'm looking forward to the stories I'll tell him - all about the people, places, and things around us and the stuff that we all have inside. All of the forces, real, invisible, and imaginary that exist in this place we all live and how the world changes in response to those forces. I hope he will love to hear about the things that we have yet to understand.

Sometimes I'm anxious, but right now I'm pretty relaxed about the whole thing almost as if I had all of the patience in the world. I'll keep posting when labor starts and give updates periodically.

20080510

TS7260 Powered via USB

A TS7260 being powerd via USB - much more portable isn't it? Above, the board is pictured next to my fairly new Asus EEE ultra-mobile PC. Currently for work, I'm 'dogfooding' the package management system we're using for the boards, meaning that I'm using the same package management system on the 7260 as I am on the EEE.

The USB power cable was really simple to create. I first dismembered the mouse part from a Logitech optical USB mouse that I never use anymore, and then found the ground wire (bare copper in my case) and the 5 V wire (4.8V actually, and red). The rest of the wires I trimmed off. A bit of insulating electrical tape and a piece of heat-shrink tubing later, and I had the new USB power cable for the TS72xx.

I recently picked up a USB serial-converter and a DB9 F-F gender changer from The Source (the store formerly known as Radio Shack) but to my dismay, this combination was ineffective. As I suspected, the wires in the gender bender were straight through and not crossed - which is very typical of DB9 F-F converters. Crossed send / receive wires are necessary for NULL modem cables. That is, the pin input -> output mapping should resemble
  • 5 -> 5
  • 2 -> 3
  • 3 -> 2
  • 4 -> 6
  • 6 -> 4
Some sources also suggest that 7 and 8 should be crossed, but that's only ever broken things for me. As long as hardware or software flow control is not necessary, the other 4 pairs of wires can be left floating and disconnected. If this is starting to sound slightly greek to you, the best idea is to just buy a NULL modem cable from the local computer store. If it sounds interesting, you can create a tiny 2" NULL modem adapter with a bit of solder, some 24 AWG wire or IDE cable, two DB9 headers, some hot glue, and (of course) some heat-shrink tubing.

Ta-Da!

Configuration 1 shows power input for the 7260 taken from the lower-right USB port of the EEE, as well as the serial input of the 7260 taken from the top-right USB port of the EEE. Ethernet is also connected between the top of the 7260 and the left side of the EEE. Configuration 1 is very useful for having to interact with RedBoot, since RedBoot is only accessible via the serial port of the 7260. Configuration 1 allows for the developer to either log in via minicom on the serial port or telnet on the ethernet port of the 7260 during regular operations. Another option is to log in to the 7260 via telnet and use the serial connection for emulating a piece of hardware (one could write a program on the EEE to pretend to be a serially connected SNES gamepad, for example).

Configuration 2 shows both the power and ethernet for the 7260 taken from the left side of the EEE. This configuration is slightly more compact and would be used for normal development, where interaction with the bootloader is not necessary.

In both cases, the atheros 802.11 b/g wireless ethernet device can easily be configured to masquerade IP traffic for both the EEE as well as the 7260, forwarding requests between eth0 and ath0 as necessary. It might be useful to run a dhcp server on the ethernet port of the EEE so that the 7260 receives its IP address, hostname, and DNS information automatically. An example script for iptables is below:
#!/bin/sh

EXTIF=ath0
INTIF=eth0

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

My personal favorite configuration is shown to the left with my old, monochrome 4th generation iPod and headphones jacked in :) In all photos, the USB memory stick is actually my root filesystem, which contains a home-rolled Gentoo binary distribution. Contrary to popular belief, Gentoo is also suitable for binary-only and embedded applications - and it's tiny :)

20080506

New x86_64 Toolchain for TS72xx

I just finished putting together an x86_64 'compatibility' toolchain for the TS72xx boards. This is an addition to what I've already done, fully documented on the Gentoo Wiki. See my toolchains directory under x86_64-pc-linux-gnu/arm-unknown-linux-gnu.

The binaries can be installed following these instructions.

Njoy!

20080502

Sidereel Firefox Search Plugin

Following the really easy template at Digital Alchemy, I've written a small Firefox search plugin for Sidereel, a probably not so legal site where you can watch lots of cool movies and TV shows for free. Download the plugin (really just an xml file) by right-clicking here and selecting 'Save Target As...' or 'Save Link As...' and save it in your searchplugins folder.

The searchplugins folder can be found on Linux systems simply with

find ~/.mozilla/firefox -name 'searchplugins'
For example, running the above command on my Linux system gives:

/home/[username]/.mozilla/firefox/[userprofile]/searchplugins

For Mac users, it's probably something like

/Users/[username]/.mozilla/firefox/[userprofile]/searchplugins

I'm guessing that on windows its something like

C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\[userprofile]\searchplugins

Note (at least for linux): the searchplugins folder is not created automatically. You must either create it manually, or download an existing search plugin (e.g. Wikipedia).

You will need to restart Firefox for the plugin to be detected.