Sunday, November 17, 2013

AOSP Android-x86 build pre-requiste extras

For those building AOSP from (JB 4.3) project on Ubuntu 12.04 will need to install these additional requirements on top of those documented on

sudo apt-get install squashfs-tools bc gettext python-libxml2 genisoimage syslinux yasm 

Thursday, May 30, 2013

To ubuntu: Respect my disk space!

So using a SSD means I get blazing performance for things like huge compiles I need to do for AOSP or grep'ing through that huge codebase.

But it also means I don't exactly have huge amounts of disk space to spare so I was not too surprised when I started get low disk space wanring recently for my root partition - props to Ubuntu for doing this in such a nice way and giving direct access to the GUI tool to show disk usage.

What Ubuntu get less props for is for installing and then keeping on disk EVERY kernel update headers which were using over 2GB on my root partition!

A quick clean up was just a matter of:
sudo apt-get remove linux-headers-3.2.0-20*
sudo apt-get remove linux-headers-3.2.0-30*
sudo apt-get remove linux-headers-3.2.0-4[0-4]

I did those seperately because using sudo apt-get remove linux-headers-3.2.0-* seemed to also want to remove the linux-generic package which I wasn't sure would be a good idea.

PS. getting rid of the older kernel packages:
sudo apt-get remove linux-image-3.2.0-2[0-9]
freed up another 2GB!

Tuesday, April 30, 2013

Intel N-6502 not sending data while connected to AP with WPA

Its been bugging me for a while now that I would intermittently have problems with my laptops intel N-6205 wifi card stop sending any data, even though it was correctly associated with an AP.

Then a few weeks ago I just accidentally noticed that it only actually happened when the laptop was running on battery power.

Finally today I remembered to have google around and first found this which lead me to here and so hey its an issue with the power management, even in intels windows drivers!

Finally I found:
with the magic command:
sudo iwconfig wlan0 power off

(yes the command on the page misses including the network device name which of course is needed) and hey presto! no more failing to connect while on battery.

Now just need to add this to my init scripts and live with the slightly extra power draw on my 9cell!! extended battery.

Wednesday, April 3, 2013

Logitech Linux Unification

Logitech has a great tech called "unifying" where a single usb wireless reciever can work with upto 6 compatible keyboards/mice. Of course the config utility is windows only but a quick google search gives the top result of a blog post with a simple handy c file and dead easy instructions on how to use it (in my case to pair a new K750 wireless keyboard).

And big thanks to the author of the utility Benjamin Tissoire, who posted it to the linux kernel mailing list.

Finally looks like the C util has a home along with a python frontend for it here.

Thursday, March 7, 2013

Sunday, September 30, 2012

Http stuff

the wikipedia article points out that the RFC952 forbids trailing hypens in domain names. Androids browser/webview enforce this, most other browsers (and heck DNS servers do not seem to bother)

The source code for the Apache HttpCore lib is not in the Androd SDK source package, so you need to get it direct from the AOSP git repo.

Tuesday, August 28, 2012

Java Network Timeout handling

So this blog post (via stackoverflow as usual) points out that you need to manually handle timing out reads when using URLConnection and hence also HttpURLConnection.

The post also helpfully provides example code for such a manual timer:

try {
    URLConnection con = urlObj.openConnection();
    new Thread(new InterruptThread(Thread.currentThread(), con)).start();
    retVal = new Source(con);
} catch (IOException e) {
    System.err.println("aborted parsing due to I/O: " + e.getMessage());
    throw new IndexingException("aborted parsing due to timeout - " + aUrl);

public class InterruptThread implements Runnable {
    Thread parent;
    URLConnection con;
    public InterruptThread(Thread parent, URLConnection con) {
        this.parent = parent;
        this.con = con;

    public void run() {
        try {
        } catch (InterruptedException e) {

        System.out.println("Timer thread forcing parent to quit connection");
        System.out.println("Timer thread closed connection held by parent, exiting");