July 08, 2012

ICS Power Management

Moving to ICS on the Samsung SII has been underwhelming for the most part - partly driven by the fact that the UI has been kept relatively stale by Samsung, and made worse by the fact that ICS while powerful, has more than a few hiccups during operation.

But there is one aspect that ICS is really good with - memory management. ICS comes with a Honeycomb inspired task switcher that also doubles as a task killer. Flicking an application in the task switcher kills it, releasing the memory and plausibly making battery usage better.

Well at least that was the theory, till I tried to put it in practice and presto - it worked! Check out the screenshot showing a run time of a day and eight hours with more than 40% of the juice still to go. Yes, the usage was not as heavy as I normally do with the phone, but still a 32 hour run time was not something I had frankly expected.

June 27, 2012

Some Carat Juice

Finally, looks like there is a potential solution for the battery drain problems within the Android eco system. Carat is a research project that aims to detect energy bugs - app behavior that is consuming energy unnecessarily - using data collected from a community of mobile devices. It is an active research project, run out of Berkeley.

For the first week, the tool merely sits around, waiting for you to run it so it can report usage data back to the mother ship. And once you have enough samples sent back, the tool begins to give you personalized recommendations. My biggest recommendation was to kill the “Accuweather” weather widget. I did that and - presto - my battery use graphs seem to have gone flatter than usual.

The most interesting part is the approach taken by the team - not with an analysis of the API calls an application makes or their abuse of wakelocks etc. Instead it is statistical, based on a massive data mining effort of similar devices. Innovative and for the moment, seems effective.

June 25, 2012

Finally - ICS for Galaxy S2

AT&T had been hinting at the Ice Cream Sandwich upgrade to the Samsung galaxy SII for a while now. Last week it even went so far as releasing the update and then rolling it back after some customers were able to get it.

Looks like whatever kinks Samsung had in producing a custom version for the US market seems to have been taken care of and my phone is now running ICS. Here is a screenshot.

The upgrade process itself was smooth - took all of about five minutes once the backups and such were completed. The only nit-pick, was that you had to install Samsung Kies to actual do the update instead of doing it over the air (OTA). But considering this was a major version upgrade, I did appreciate the backup opportunity Kies presented.

First impressions - not that many actually. Because the version of ICS is a Samsung customized, AT&T pre-loaded version, it is not that different from the Gingerbread copy. But, just beneath the surface there are differences. The biggest being the smoothness with which the interface seems to be working. And of course the subtle UI elements, like in the settings menu. It seems like someone actually spent time thinking about the end user while putting these together.

More details later, but for now, screenshots of the upgrade itself.

May 27, 2012

Rooting Thrive ... Done!

Thanks to dalepl and his unbelievably awesome Universal Easy Flash Tool - I now have root on my Thrive.

The best part is the process to get there, it was as easy as

  • Install the correct ADB drivers on your laptop (available within the same zip file from dalepl)
  • Connect the Thrive to the laptop via USB mini and ensure it is connected to the charger at the same time.
  • Run the batch file Universal_Easy_Flash_Tool.bat

Confirm the fact that you want to root the device...

And pick the correct ROM that you are currently on...

And after about 4 reboots of the device - you are done!

Thank you @dalepl and @TurnYourBackAndRun - honestly Toshiba should be paying you for keeping their devices relevant. Now to kick some pre-installed crud off the device.

May 07, 2012

Abstract interfaces

Gimp 2.8 - an important milestone in the road to Gimp 3 - is out. But this post is not about the new single window UI, or about the fact that saving an image is easy for the first time. This post is about the path to get to version 2.8.

Gimp is powerful - not entirely Photoshop powerful - but more than sufficient to handle anything an amateur photography enthusiast might want to throw at it. But overshadowing it's power is a user interface that feels piecemeal and awkward. If I had to summarize it's problems - it would be this: the interface lacks abstraction.

When a programmer builds user interfaces, it is a bit like an engineer trying to sell a product. A programmer knows exactly how piece of functionality works - what the variables are, what the functions do. The user interface reflects that - a list of inputs for the variables, organized into groups of functions. This would be perfect, if the goal of a user was to run the various functions - but when the user comes in to perform a task, the interface begins to get in the way.

A great abstraction bridges the gap between the user task and tool functionality.

And Gimp is taking it's first steps in that direction. Starting with a brutal evaluation of the current state of the interface, the Gimp team is doing what any good built-by-consensus project would. Reach out to the community for ideas.

But there is many a step before Gimp begins to resemble a polished UI. While that in no way means copying the Photoshop interface, but it involves coming up with a way to interact with the user in such a way as to provide capability and not functions. Of taking all available ideas and distill them into a coherent experience. But again, just like consensus might not be the best way to build a program, it might not be the best way to polish an interface. Maybe it just takes singular vision.

April 28, 2012

The Cyanogen Mod

It has been about two years since we bought the Nexus One. Which is great timing for the two-year itch - that starts something like “Now that the phone is not under warranty, do you think we should ...”.

To add to the itch was a real problem - Nexus One's fatal flaw so to speak. The phone has a minuscule amount of memory on board - a paltry 512MB which not only included the entire Android installation, but other pre-installed crud disguised as system applications. This meant even after moving some of the applications to the SD card, we were forever playing a game of whack-a-mole trying to free up just enough disk space for the phone.

That is when I decided to replace the original firmware with CyanogenMod 7(CM7). And since this was a phone that was not going to be customized heavily - the reasons to modify were fairly light.

  • Because I could
  • So that I could uninstall the various system applications like the Amazon MP3 for instance
  • So that I could get App2SD capability inbuilt
  • Because I could

The process I followed was the official process prescribed in the wiki over at the CM site. Here are some notes to go with the instructions in the wiki, that I am not planning to leech over.

Backup

Always important to backup. Especially since the process of unlocking the bootloader will reset your device to factory settings.

I used GO SMS Pro to backup SMS. Which by the way, is a great replacement for the custom SMS app. Astro File Manager to backup all applications. Then connect the phone to a computer and copy over the entire SD card as well.

Unlocking the Bootloader

A couple of things to keep in mind while unlocking the bootloader - firstly the phone is going to reset to factory settings. Don't ever think that you will be able to keep it like-for-like. Secondly a by-product of the reset is that if you have had to enable the developer mode to access the SD card via USB, you will need to re-enable that.

Custom Recovery Image

While the wiki mentions this in passing, once you reboot this step is essentially undone. So moving from this step to the next must occur without a reboot. Which brings us to the second question - how does one then “boot into recovery”? The process varies by phone, but in the case of the Nexus One - briefly click the power button after installing the recovery image. This will refresh the options on screen giving you a recovery mode to boot into.

Flashing CyanogenMod

If you were following along, here is where you need a lot more preparation than the wiki lets you in on. In reality you are already in step 4 of this section by the time you are done with the previous section. So if you were planning on downloading the zip files at this point - tough luck. Maybe that is something you do when you backup? Or at least when you get the recovery images in, make sure you copy the CyanogenMod version you want to install onto the root of the SD card. Otherwise, you might have to re-boot into the factory fresh device to do that.

Restore from backups

Final bit of a heads-up. When you restore from backups using Astro File Manager, it has a tendency to restore all applications to the phone internal memory. So after the first few, the rest of them are going to fail. So you might have to restore them one-by-one, moving the big apps to SD along the way.

That is it, more than a week into the installation, and the phone is still going strong. A detailed view of CM is probably going to follow - but so far really good.

March 03, 2012

Configuring PPTP VPN

This post is the last in the series of upgrades I completed on my router running the new TomatoUSB router firmware. Most data for this post is thanks to this tutorial

Requirements:

  • A router running TomatoUSB
  • Install and configure Optware on the router
  • A way to address the router from outside the home network - like setting up a dynamic DNS maybe
  • A VPN client to connect to the router

Installation

Log onto your TomatoUSB via SSH and run the following on the shell

ipkg install poptop

That is it. Wait for ipkg to do it's thing and you are done installing.

Configuration

Edit the file /opt/etc/pptpd.conf

I installed what is called a Single-Net configuration, after logging in, the entire network is available to the VPN. This was a home network, and I wasn't going to implement any sort of zoning on it.

Ensure the following line is commented

logwtmp

Establish the list of available IP addresses. Here is what I have

localip 192.168.1.1 #This is the local IP address of the router remoteip 192.168.1.245-254 #These are the available remote IPs to be used when a remote VPN connection is made

Edit the file /opt/etc/ppp/options.pptpd

Here is what I have as the final configuration. I have removed the prompts & help text to keep it clean(er).

name pptpd #chapms-strip-domain # BSD licensed ppp-2.4.2 upstream with MPPE only, kernel module ppp_mppe.o # {{{ refuse-pap refuse-chap refuse-mschap # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft # Challenge Handshake Authentication Protocol, Version 2] authentication. require-mschap-v2 # Require MPPE 128-bit encryption # (note that MPPE requires the use of MSCHAP-V2 during authentication) require-mppe-128 # }}} # OpenSSL licensed ppp-2.4.1 fork with MPPE only, kernel module mppe.o # {{{ #-chap #-chapms # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft # Challenge Handshake Authentication Protocol, Version 2] authentication. #+chapms-v2 # Require MPPE encryption # (note that MPPE requires the use of MSCHAP-V2 during authentication) #mppe-40 # enable either 40-bit or 128-bit, not both #mppe-128 #mppe-stateless nomppe-stateful # }}} # Network and Routing ms-dns 192.168.1.1 #ms-dns 10.0.0.2 #ms-wins 10.0.0.3 #ms-wins 10.0.0.4 proxyarp # Logging #debug #dump # Miscellaneous lock nobsdcomp

Authentication & Credentials

Create the file /opt/etc/ppp/chap-secrets with the VPN setup credentials. My file looks like below, of course with a valid username & password.

# Username Server Password AllowedIPs myusername * myawesomepassword *

As with any password file, ensure it is only readable by root by running the following as root.

chmod 600 /opt/etc/ppp/chap-secrets

Configure Firewall

Create the file /opt/etc/config/vpn.fire and put the following in it

#!/bin/sh iptables -A INPUT -p gre -j ACCEPT iptables -A INPUT -p tcp --dport 1723 -j ACCEPT iptables -A INPUT -i ppp+ -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT

Make the script executable by running the following

chmod +x /opt/etc/config/vpn.fire

Restart the firewall service

service firewall restart

Start VPN server

This is the last step. Create the file /opt/etc/config/vpn.wanup and add the following

#!/bin/sh if [ ! -f /tmp/ppp/chap-secrets ]; then mkdir -p /tmp/ppp ln -s /opt/etc/ppp/chap-secrets /tmp/ppp fi /opt/etc/init.d/S20poptop restart

Make this script executable

chmod +x /opt/etc/config/vpn.wanup

That is it, this will ensure the vpn always runs whenever the WAN comes back up. The VPN is up and running.

Testing it may end up being a bit tricky. You cannot log into the network while you are on it. I used my phone, disabled WiFi, and configured it to log in via the mobile network to ensure that the VPN was indeed accessible and working. Presto, I could log into my home network from anywhere in the world.

Check out the original post about ways to configure a VPN client on an iOS or Android device.

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.