Google/Youtube's ISP specific cache/tieups ?

2012-05-15 21:42:57 +0000


Today we are going to discuss possible google tieups with local ISP's to create caching layers in order to deliver better experience to high bandwidth customers.

I stumbled upon the same while browsing one of google's pages which had an embedded youtube video. Initially it was very slow and I was quite surprised since I am on a 10mbps bandwidth connection and am usually able to stream even HD videos on youtube without any buffering delays. Then I realised that most probably I was going over the ipv6 network (and hence tunneling all the way to US and not getting local content) and hence the delay. I fired my wireshark and indeed I was going over the ipv6 network. I mulled over disabling the ipv6 in router and keeping it only in my dev box when I realised that I can simply disable ipv6 browsing in my firefox :).

about:config -> network.dns.disableIPv6;true

And am done :)

After doing the above, I reloaded the earlier page with firebug enabled. The embedded video was now playing smoothly without any buffering delays. And then all of a sudden I saw this in the firebug network panel:

wait what?!
So google has a cache specifically for my ISP?! (I use ACT broadband).
Now that my curiosity was pipped, I decided to do a lil more digging.

[anshup@mouthwa ~]$ host has address has IPv6 address 2404:6800:4007:2::e

Oh, so they ve also ipv6 enabled it, nice.


descr: BroadBand Internet Service Provider, India
address: ACT Television
address: # 29/4, 4th Floor, Trade Center,
address: Race Course Road, Bangalore - 560 001

[anshup@mouthwa ~]$ whois 2404:6800:4007:2::e

inet6num: 2404:6800::/32
netname: GOOGLE_IPV6_AP-20080930
descr: Google IPv6 address block in AP
country: AU

Ah, so while the ipv4 cache was coming from my local ISP, the ipv6 cache was coming all the way from australia? So even though google might ve teamed up and linked a deal with local broadband providers, it still is some miles away in getting ipv6 cache to India? Or possibly because am on an ipv6 tunnel rather, it ended up using my tunnel endpoint as the preferred location rather than my original location.

The more interesting part is that Google has apparently created up local caches at ISP ends to help give better speed to the end user. I need to check it up on some other ISP s here in bangalore and then will update the results here.


Read More

Lifetime Roadtax in Karnataka - rates - 2012

2012-01-07 15:41:07 +0000

So I recentlty bought (or rather booked) my most expensive acquisition so far. A Volkswagen Polo 1.6L. Every dealer in bangalore was quoting a road tax of 15.4%. But no one was able to substantiate it on paper or from the official RTO site. In addition, there was a team-BHP thread where people talked about it being 13% + 10% cess on tax = 14.3% tax total. I also read the same initially, but then found out that the tax is rather 14% (as mentioned in the addendum) and cess 11% (not updated on site but checked with RTO official on phone).

So, if you are here to find out the road tax in karnataka, hit here:

I would ve updated the team BHP thread rather than putting a blog post here but team BHP wont accept my "registration". Your loss team BHP-ians.

Read More

Team Winner, Superstar 2011 @ Yahoo!

2011-11-23 17:03:46 +0000

The wall of fame poster!
Yodel for the Algorithmic Search Bing Transition Team
The Algorithmic Search Bing Transition team maniacally focused on desktop and mobile migration of web, image and video search in 40+ global markets from Yahoo’s YST infrastructure to Microsoft’s Bing platform. The Bing Transition Team in Bangalore specifically took complete responsibility for transitioning image and video search to the Bing platform. The Bing transition represents a first-of-its kind partnership for Yahoo!. It is an inherently complex relationship, extremely difficult technical transition and horizontal cross company project unlike any Yahoo! has undertaken in the past. But this team was up to the challenge, delivering with speed and quality. Successful completion of the Algorithmic Search transition in multiple global markets will save $150M+ annually in capital expenditure costs, allowing Yahoo! to focus on global search experience innovation and beyond, both in our core desktop search business, but also importantly across mobile and tablet devices.

Team Winner, Superstar 2011

Read More

How to restore all apps from backup on android

2011-11-04 14:08:23 +0000

I ve been changing my roms often on my nexus S, the latest being Icecream. One thing thats always been painful was all application restore across roms. Market downloads it all over again but you ve to wait for it. In my case, my apps size about 300 MB in all, abut 130 apps. So I ve to wait for all of them to download all over again.

There are means and ways of taking backup and restores. But being a command line guy, I always was too lazy for them. That's when I decided to create my own way of backing up the apps and restoring them.

I am assuming you'll know what it means by adb and mount when you read them. If not, please head over to xda forums or other similar android forums. Another assumption am making is you are already rooted.

How to take backup of apps before flashing:

1) Go to recovery -> mounts and storage
2) mount /data and /sdcard.
3) mount USB storage
4) go to adb shell
5) Copy your app .apk files to the USB storage
mkdir /sdcard/app_backup
cp -rv /data/app/* /sdcard/app_backup

Once you are done, you can make another copy out of the USB storage on your computer as well.

When you are done with your flash, repeat the above (1-4) steps, and copy the files from /sdcard/app_backup to /data/app/
cp -rv /sdcard/app_backup /data/app/

(there is adb push and pull as well, I ven't tried that. See adb -h for more info and maybe you can try that as well).

6) clear the cache (wipe cache partition)
7) Advanced -> wipe dalvik cache

8) reboot :)

The reboot might take time after the steps above for restore as it will create the dalvik cache out of the apps.
It might look like its stuck on the bootloader screen (CM round circle or whatever is your rom). Give it sometime, go for a coffee. Time will depend upon your number of apps. I did went for a cup of coffee and it was ready by the time I came back.

This is a very rudimentary post on how to restore apps. You can create nandroid backups as well. In that case your /data will be saved as data.ext.tar or something similar. Just untar it and get the files for restoring.

Let me know if you need more help.

Anshu Prateek

PS: In case you want to unroot your nexus s to a stock image, here is a good compilation of stock images:

Read More

how to get ipv6 connection in India

2011-09-27 00:02:38 +0000

It is possible to get ipv6 connection in India using tunneling (ipv6 over ipv4). There are multiple providers, but is one of the simplest ones to use and setup. And its for free! You can set upto 5 tunnels with every free account. You'll mostly need one or two maximum as each tunnel needs a valid ipv4 ip on your end.

To set a free tunnel, head over to the tunnel broker site of

Register a new account. After successful registration (and confirmation), login, click on "create a regular tunnel" under user functions, provide your ipv4 address and voila (usually its the same as "You are vieweing from" that is shown under the text box for "IPv4 endpoint (your side)" and you are ready to go!

If you want to use google services over ipv6, I suggest you use one of the US endpoints of the tunnel, as it looks like google has whitelisted the US endpoints. The Asian endpoints dont ve access to google and facebook over ipv6.

Once you ve created your tunnel, you need to setup your system. I ve tried it on linux, mac and airport extreme. The example configuration showed in the tunnel page (once created) works pretty well for all that I tried. Most of them need you to copy paste the commands given in a command line terminal.

Once you are done with all the above, comes the most important part. Adding the DNS! Even if you ve a fully functional tunnel, you wont be able to browse or use it unless you ve the DNS configured for ipv6.

In your version of OS, configure the DNS for


Check it up online how to configure a nameserver/dns for your OS.

If you ve a airtel connection, or other ISPs which result in you ving different ips, no worries. You can update your tunnel endpoint (i.e, your ip) in the tunnel configuration easily. Either using the web UI by logging into the site, or using APIs available at

-or-: (auto-detect IP)

Let me know if you need more help with setting up your ipv6 tunnel!

My home network and my blog both are now on ipv6, thanks to the tunnels provided by!

Read More

how to add AAAA record (or ipv6 record) to your rackspace dns

2011-09-25 03:28:55 +0000

UPDATE: Don't bother setting it up if you are only using the rackspace cloud server. Their DNS doesn't support ipv6 yet and apparently won't propagate the AAAA records yet :! Thats kinda funny since they do have load balancer services on ipv6 now. Waiting on some response/confirmation from Waz mentioned in the post. I ve moved my DNS back to my domain registrator, GoDaddy.

I was earlier hosting with slicehost and their dns was a smooth drive when it came to adding any DNS entries.

I then moved to their parent company rackspace as they had cheaper plans. Slicehost was slated to move to same plans but some time down the year.

Anyways, after I moved to rackspace, I decided to add the IPv6 domain back to my server. In slicehost it was pretty simple, but in rackspace, oh no!

The rackspace DNS is still in primitive era. Recently they have announced overhaul of their entire DNS but its yet stuck in the last mile deliverable, i.e, a working GUI.

Add to that, their "beta" API docs (I didn't know for a while what's in beta, the API or the docs :P ).

Anyways, my first attempt to use the GUI was faced with continuous failure :!


After a quick chat with their customer care, I was pointed to their DNS API. Apparently AAAA support is not in GUI yet.

Ok, now lets give it a try.

Documentation is always a pain, but I guess when your moolah depends upon that, it should be better. Now I am usually pretty good at RTFM, but this time it was simply not happening. Rackspace needs to spruce up that documentation a lot!

Anyways, now that we are done with a rather length prelude to the actual subject, lets get on the real topic. How to add a AAAA
record to your rackspace in case the GUI is failing.

First, you'll need a firefox plugin called restclient. That's cause the return error messages from rackspace are quite uninformative and it becomes difficult to change your curl command or php script based on a vague 403 or a 500.

First step:

Get your rackspace API Key.
For this, you first need to login to your rackspace account and get the API key. Its located under "Your account" section

Click on Show Key to show your key. Or you can generate a new API key on that page using Generate new key.

Second step:
Get an authetication token.
Now getting the API key is half the part of getting your authentication token. Your API key is not your authentication token.
You use the API key to generate your Authentication token using the rackspace REST webservices.

The Rackspace authentication webservices accepts the parameters using headers only. And sends the output also in headers.

Before we get the token, you need to findout if you are a US user or a UK user :!

quoting the API doc

To access the Authentication Service, you must know whether your account is US-based or UK-based:

US-based accounts authenticate through

UK-based accounts authenticate through

Your account may be based in either the US or the UK; this is not determined by your physical location but by the location of the Rackspace retail site which was used to create your account:

If your account was created via, it is a US-based account.

If your account was created via http:/, it is a UK-based account.

Once you ve found your endpoint, (mine is US), you can start to get your Auth token.

A simple way for those familiar with command line is to use curl:

curl -I -H 'X-Auth-User:yourRackspaceLogin' -H 'X-Auth-Key:YOUR-API-KEY-HERE' ''

If you are a UK customer, the respective DNS API endpoint for UK is:

Or for those not aware of it, you can use the firefox plugin we installed earlier.

Open the plugin from the tools menu under firefox. I am on mac. So choose the respective menu for your platform.

Select the RestClient.

Select GET method. Put the url as your endpoint that you found above. Click on Add Header

Name - X-Auth-User
Value - yourRackspaceLogin

Add another header
Name - X-Auth-Key

After adding these two header, hit send, and if all goes fine, you should get a green (204) response.

A http 204 response means that the server successfully processed the request, but is not returning any content. Like I said earlier, this part of transaction, i.e, getting the auth token is done entirely using headers only.

The output for curl method would be something like this:

HTTP/1.1 204 No Content
Server: Apache/2.2.13 (Red Hat)
vary: X-Auth-Token,X-Auth-Key,X-Storage-User,X-Storage-Pass
Cache-Control: s-maxage=17404
Content-Type: text/xml
Date: Sun, 25 Sep 2011 04:14:17 GMT
Connection: Keep-Alive

The value for both X-Auth-Token and X-Storage-Token are same, so nothing to worry about about duplicates.

Notice the "588177" in the X-Server-Managerment-Url above. Make a note of your corresponding value. This is your server id that you'll need in further DNS API calls as well. We will call it YOUR_SERVER_ID for the purpose of rest of this blog.

Third Step:
Get the Domain ID

Now we need to get the Domain ID of your domain tied to your server. I had two domains listed with my server. You can have one or multiple such domains listed with your server.

The curl command would be:

curl -H 'X-Auth-Token:YOUR-AUTH-TOKEN' ''

Output is something like:


You can do the same using the RestClient. Find the url in the curl command above , and change the header to that under -H.

The "id" part in the output is the one that we need. We will call it YOUR_DOMAIN_ID for the purpose of rest of this blog.

Once you ve the id, you are ready to create the records. This is the place where I used RestClient the most. As the curl errors were random and so not descriptive. Ranging from

Warning: You can only select one HTTP request!

which I think was some issue with the curl format of payload or combination of options to the usual 500 :!

Fourth and Final step:

Lets create the AAAA DNS record!

Ok, so to create the records, the required info can be put using XML or JSON. I used JSON.

The url is

change the format to POST.

And to add a AAAA record, create a JSON payload like this:

"records" : [ { "name" : "", "type" : "AAAA", "data" : "2001:470:1f06:b8c::2"
}, { "name" : "", "type" : "NS", "data" : "", "ttl" : 3600
}, { "name" : "", "type" : "NS", "data" : "", "ttl" : 3600

Change the with your domain/subdomain requirements and the data to your required ipv6. Let the NS data as it is. (I assume you want to add it to your rackspace dns.)

Put the above JSON payload in the Request Body of the RestClient. I had removed the newlines in the actual JSON. Please put your entire JSON in a single line if you face any issues.

And click Send.

Hopefully you should get a GREEN 204 response. This is a asynchronous request to the DNS API. So you can check the status of your this request using the url:

Remember, every call to the rackspace DNS API need to include the X-Auth-Token header.

Default output/input format is JSON. XML is also available. Please read up the Doc on how to get XML, I didn't try it.

I hope this works for most of you who need it. Leave a comment if you face any issues. Would be great if someone can provide curl requests for delivering the JSON/XML payload in the POST request!

Before I end the post, I should mention my other attempts of getting the help from the rackspace guys.

I posted a pic to my twitpic account while I contacted the rackspace live chat for the first time. I had put this pic up there as a quick way of sharing it with the customer care person.

Couple of hours later, when I went back to twitter to complain about my failure to create the AAAA record, I found that @rackspace had replied with a support email address. twitter at rackspace dot com.

I immediately sent a mail to the aforesaid mail, to which I got a reply. I had already found the RestClient API and managed to get the records added. Had a pleasant conversation with "Waz", a rackspace engineer or a racker! Raised a ticket about GUI visibility about visibility of the records added through API. Got the response that the AAAA and TXT records dont show up in the GUI yet. These will be visible when the new DNS GUI is generally available.

So overall, a pleasant experience. Looking forward to native ipv6 support soon!

Read More

The Scam that helped the people.

2011-09-01 13:57:09 +0000

All the hullabaloo around the India's 2G scam is something that I deeply detest. Am I the only one who sees the public benefit that happened due to spectrums being handed out for little to no license fees? Look at where India's cellular penetration is. Look at the cellular tariff's in India and compare it to the rest of the world. India now has the lowest tariff in the world. Could this ve happened had the spectrum's being instead sold at exorbitant prices? Look where the 3G network infrastructure, penetration and the availability is today in India. Of course the government "earned" a lot of money from these 3G licenses (and in fact it were these 3G spectrum bids and final prices which brought the "apparent" 2G spectrum scam to forelight), but who is the ultimate loser in this game? Telco's brought 3G licenses at the obscene prices only coz they were buoyant by the existing 2G environment. What they forgot was that the 2G era happened because of cheap licenses which left the telcos with enough money to spend on the infrastructure.

In my opinion, the guy who decided to sell the 3G license is the bigger culprit. Typical Indian style, milk the cow as much as you can. Infact this was worse than slaying the golden goose.

Just imagine the internet penetration that 3G would have brought to masses if these were easliy available. I remember the days when I was on dialup. I used to get 12-13kBps average, 40kBps peak. Today I ve a 5MBps connection and am in 99.1 percentile of the Indian population having high speed internet. The definition of broadband in India is pathetic. 256kBps is defined as Broadband by TRAI.

IMO, one of the best decisions that was made in the last decade was the free giveaway of the 2G spectrum. Money might have changed hands, and whats wrong is wrong, but not selling the 2G spectrum was definitely the best decision the silent PM agreed to.

Read More

find to exclude hidden files

2011-08-31 04:47:30 +0000

I needed to clean up my home account, to remove all the usual files, except for the hidden files (the various gnome/app confs/settings etc) into one directory. This is what I used:

find . -type f -maxdepth 1 ( ! -regex '.*/..*' ) -exec mv -vf {} all ;

I got the regex part from here:

Also, later I found another one that I vent tried yet, maybe later:

find /home -type f -mtime +15 -not -name ".*" -exec rm {} ;

Read More

A beginners guide to git how to!

2011-08-28 05:52:43 +0000


Let me first tell you what all I am going to tell you.

If you are coming from the world of svn/cvs (like me), I am going to tell you how to do git equivalent of

svn checkout ( git clone)

svn commit = (git add + git commit + git push)

What I am not going to tell you is how to setup your git account, create a new git repo etc, as the existing documentation on git is pretty good for these.

Ok, so lets begin now. I am assuming that your git account is ready, new files/folders are setup and you want to checkout your project in a new workspace.

In SVN, its a simple

svn checkout {location}

however when we try similar thing in git, we get an error!

git checkout
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

You see, git checkout is not like svn checkout. What git checkout does is checkout a branch or paths to the working tree.

So to do a fresh git "checkout", you basically have to do a git clone.

git clone
Cloning into myFiles...
Enter passphrase for key '/home/anshup/.ssh/id_rsa':
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 3 (delta 0)
Receiving objects: 100% (6/6), done.

Voila! Am done.

Now how to do a git equivalent of svn commit ?

In git, this is broken down into 3 parts:

git add
git commit
git push

In svn, svn add is only for adding a new file to under revision control.
In git, git add, is useful for adding any changes to the index that would be finally merged or committed to the git repo online.

git commit : by this you are confirming that the changed files that you ve added by git add are ready to be committed.

git push: This is the command that finally pushes your changes back to the git repository!

So now you know how to do a "svn checkout and svn commit" using git :P

Look out for more as I delve more into git :)

Read More

How to enable WOL on Dell Inspiron 1420 with Fedora/Linux

2011-08-21 16:15:24 +0000

I use my laptop (dell Inspiron 1420) as a server for remote access from office. Even at home, my primary laptop is my mac. I just let my dell run all the time as I don't know when I would need/want to access that from office.

I wanted to enable WOL or Wake Up on Lan so that I could start my laptop from office if required. Even though it says "Wake Up on Lan", it can be started from internet as well.

First place to start was to enable the WOL option in BIOS. And lo.. it wasn't there.. ! So, does my NIC card doesn't support WOL ?

But a quick probe using ethtool showed WOL was indeed supported on my card.

[root@mouthwa init.d]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes

Now the next line, Wake-on: d means that WOl was disabled. To enable WOL, use:

ethtool -s eth0 wol g

Now this change is not persistent, i.e, it will be gone in the next reboot.
So to make it persisten, I put a file in /etc/init.d/

cat /etc/init.d/wol
#wake on lan
ethtool -s eth0 wol g

Do a chmod +x on the file.

Now check which all devices are allowed to wake up your system in the OS:

[root@mouthwa init.d]# cat /proc/acpi/wakeup
Device S-state Status Sysfs node
PCI0 S5 *disabled no-bus:pci0000:00
PCIE S4 *disabled pci:0000:00:1e.0
USB1 S0 *disabled pci:0000:00:1d.0
USB2 S0 *disabled pci:0000:00:1d.1
USB3 S0 *disabled pci:0000:00:1d.2
USB4 S0 *disabled pci:0000:00:1a.0
USB5 S0 *disabled pci:0000:00:1a.1
EHC2 S0 *disabled pci:0000:00:1a.7
EHCI S0 *disabled pci:0000:00:1d.7
AZAL S3 *disabled pci:0000:00:1b.0
RP01 S3 *disabled pci:0000:00:1c.0
RP02 S3 *disabled pci:0000:00:1c.1
RP03 S3 *disabled
RP04 S3 *disabled pci:0000:00:1c.3
RP05 S3 *disabled
RP06 S5 *disabled pci:0000:00:1c.5
LID S3 *enabled
PBTN S4 *enabled
MBTN S5 *disabled

I need to find out which of the above is my NIC card and enable wake up for that.

[root@mouthwa init.d]# lspci -tv
-[0000:00]-+-00.0 Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub
+-01.0-[01]----00.0 nVidia Corporation G86 [GeForce 8400M GS]
+-1a.0 Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4
+-1a.1 Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5
+-1a.7 Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2
+-1b.0 Intel Corporation 82801H (ICH8 Family) HD Audio Controller
+-1c.1-[0c]----00.0 Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection
+-1c.5-[09]----00.0 Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express
+-1d.0 Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1
+-1d.1 Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2
+-1d.2 Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3
+-1d.7 Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1
+-1e.0-[03]--+-01.0 Ricoh Co Ltd R5C832 IEEE 1394 Controller
| +-01.1 Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter
| +-01.2 Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter
| -01.3 Ricoh Co Ltd xD-Picture Card Controller
+-1f.0 Intel Corporation 82801HEM (ICH8M) LPC Interface Controller
+-1f.1 Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller
+-1f.2 Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller
-1f.3 Intel Corporation 82801H (ICH8 Family) SMBus Controller

Notice the 1c.5 in front of my LAN card in the lspci output above. Look for the same number in the /proc/acpi/wakeup and I find that my card is RPC06!

Now to enable the wakeup for my card, a simple echo will do:

[root@mouthwa init.d]# echo RP06>/proc/acpi/wakeup
[root@mouthwa init.d]# cat /proc/acpi/wakeup |grep RP06
RP06 S5 *enabled pci:0000:00:1c.5

So there you are, WOL is enabled!
However, it can wake up only from certain states, not all at the moment.

So, the best way to switch off the laptop so that it can be woken from LAN is

[root@mouthwa init.d]# pm-suspend-hybrid

What it does is that the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can wake up quicker than for
normal hibernation if you do not run out of power, and you can resume even if you run out of power.
Most of the above was sourced from here.

Now, the script to wake up from internet.

I got it from here:

Also, If you dont want to or dont have a place to run scripts, you can use online services like:

Ofcourse, you need to know your MAC address, your router address and the subnet.
Keep subnet as in the depicus page if you have one public ip and the router allots private ips using DHCP. (This is true for most of the routers).

And now, I can happily power down my laptop and wake it up when required! #FTW

Read More