January 19, 2012

Extending Tomato with Optware

I had waxed eloquent about the flexibility, freedom and capabilities extended by open source tools in general, and the Tomato USB in particular. Little did I know, that this was just the tip of the iceberg of capabilities offered by the third party firmware on my Netgear router.

The big extension to the core capabilities offered by the firmware is available via the installation of Optware. At its core, Optware is an advanced package manager, built for distribution of software packages across a number of platforms, including the TomatoUSB router firmware.

Optware comes with a variety of packages compiled and available in it's repository. This repository extends the capabilities of the router firmware, from their stripped down, small-footprint cousins to the full featured Linux box tools.

Tomato has inbuilt support for Optware. But it needed a bunch of work, to prepare the setup for Optware. In particular there were two things that had to be done:

  • Format the connected storage in EXT3. My terabyte RAID had been originally formatted in NTFS. While TomatoUSB has support for NTFS, but it is slow and painful, and fundamentally missing capabilities. Not something that lends itself for Optware.
  • Figure out where /opt is going to mounted.

There is no easy way to convert NTFS to EXT3 - other that the slow and methodical approach. Take files off the NTFS file system, format the disk as EXT3, and copy the files back. There are several tutorials out there, like this one - the only tweak was that I ended up using the mkfs.ext3 script available on the router to format the disk.

An aside, the cheap Terabyte RAID survived and is thriving through this all - including the EXT3 formatted drive.

Now mounting storage on /opt where Optware will be installed, seemed tricky at first, but ended up being pretty simple. The reason it seemed tricky was that I created only one partition on the storage when I formatted it as EXT3. My worry was that I'd have to re-size the partition and add a new one, which could then be mounted on /opt.

Turns out, you can mount the same device on multiple mount points. And given that I am already automounting the USB device, I figured all I had to do was to mount a sub-folder on /opt. Adding the following in the “Run after mounting” script-box, did the trick.

if [ -d /mnt/Teranarchy/optware ]; then mount -o bind /mnt/Teranarchy/optware /opt fi

Once I had space available on /opt - installing Optware is simple. As simple as running the following on a shell after logging in via Telnet or SSH.

wget http://tomatousb.org/local--files/tut:optware-installation/optware-install.sh -O - | tr -d '\r' > /tmp/optware-install.sh chmod +x /tmp/optware-install.sh sh /tmp/optware-install.sh

That is it. Optware does a great job of obtaining and installing all the packages. And because Tomato already has the correct folders in $PATH variables, all the tools and capabilities are available instantly from any shell.

Now that I have Optware, it is time to start doing something more interesting. Like installing a VPN on the router. Coming up next.

January 16, 2012

The Human Factory

Ira Glass has the most absorbing tales. This one is no different, and it is about a topic that I am familiar with. The whole show is embedded below, and if that does not work - the link to the original story on This American Life is here.

Favorite quote from the show: Shenzen looks like Bladerunner threw up on itself.

Over a period of 35 minutes, the narrative evolves slowly, from a funny self-effacing confession to a pondering, visceral narrative designed, not as much to shock, as to prod new life into a story that has almost nothing new to give. To round it all up, Act II of the show is typical NPR - the other side of the story - including this opinion arguing the benefits of sweatshops.

Finally, it is easy to see this as something specific to Apple, while it is not. Having Apple on the headline does bring in the eye-balls, but the story is no different for Samsung, or any of the other makers of electronics. Once again, it is the Apple side of the camp, that put it together in an easy to use package.

The whole story is an hour long - but well worth it.

January 13, 2012

Android design standards - Finally!

Google just announced design standards for applications on Android. Having three different Android devices at home, I have first hand experience of the UI fragmentation on the platform. However, Google needs to go beyond Android for design unification. Google is broader than mobile, and having design consistency is going to be crucial for a standard user experience across all Google properties.

Consider the Gmail app, and in particular the menu item to “Report Spam”, for example. I use three different flavors of GMail, and the design across the three avenues is not only non-intuitive, but inconsistent. Even with an abundance of access, I have yet to develop the sort of muscle memory that I would associate with the typical Google user interface.

On the desktop, it is part of a grouped threesome, and looks like a happy stop sign. And it's relative position remains the same whether I am in the inbox view or the message view. That feels like a UI that I could get used to.

On my Galaxy SII, the SPAM icon looks like an alien, with a varying location on the menu. When I select a thread from my inbox, it shows up as an option in first menu page. When I am within an email, however, it takes two menu clicks to get to the option.

Finally on my Thrive, it is an option available only on the overflow menu. While that might say a lot about how good Google thinks it's filters are, it still makes for a very annoying user experience.

Three form factors, and three different ways of thinking about Spam. It is time Google thought about design standards for across it's solutions, and not just for a platform.

January 12, 2012

Dynamic DNS on my Tomato Router

Here is the problem statement - now that I had my router running a custom TomatoUSB build, I wanted to open it up to the Internet so that I could access my music and data from anywhere.

The first step though, was to establish a way to address my router via the Internet. Now, I get a dynamic IP address from my ISP; so I had to find a way to keep track of the latest address. The answer, of course, was to use a dynamic DNS (DDNS) solution, of which there are dozens available. But as it turned out, my case was more complicated than that.

I chose the FreeDNS service offered by afraid.org. Tomato firmware has native support for their dynamic DNS service built in. But more importantly the tagline on their website read “Why is it free? It's quite simple. We wanted a challenge... that's it.”.

To set my site up, I had to delegate the nameserver function for my domain to my hosting provider. My initial idea was to delegate a subdomain to the FreeDNS service, and then update the IP address directly from my router. Unfortunately my hosting provider did not allow delegation of sub-domains to a different DNS provider. In other words, they did not allow NS records to be created for their inconsequential customers like me. They only allowed A, TXT or CNAME records. CNAME records - that gave me a way out.

I created a sub-domain on one of the free domains provided by the FreeDNS service - in my case it was mooo.com. The name of the sub-domain did not really matter, any available one worked just fine. Then I set up my Tomato router to update the IP address of this sub-domain automatically.

Finally, I set-up a CNAME pointing a sub-domain from anarchius.org to the newly created sub-domain on mooo.com. Presto - sub-domain.anarchius.org now resolved to my WAN IP address. Here is how my DNS records look now:

There you are, Dynamic DNS on my Tomato router up and running, linked directly to my own domain. Bring on the possibilities.