Sunday, January 25, 2015

Google Chrome Update to Version 40 Breaks the Power User Shortcuts on Google Search Results Page To Open in Background Tab

Like any developer I also do "Google Driven Development", where I quickly search for the problem I am stuck on using Google, browse the result, zero down on causes and find a solution. To quicken the process, shortcuts on Google Search results are very handy and heavily used.

I will describe you these shortcuts if you are not aware of them. On Google Search Results page you can press TAB once to jump on the result. The first result is going to show a small blue triangle next to the search result title, you can browse the results using UP/DOWN arrow keys. To open a result in Background tab, just press Command + Enter. The process is demonstrate using a YouTube video down here.


Then suddenly one morning I was not able to do the search using these shortcuts. As it happened, Google Chrome updated itself to new version 40 last night. So the culprit looks like the new version which was not tested for this hidden/unaware but extremely useful and popular feature. I just can't live without this since it is like part of my behavior now, and if it doesn't work it leaves me very very irritated. I raised a ticket for this particular bug, but if any of you had an experience with Google product service, you are not going to bet much on them. Rather I thought of going back to version 39 which was working fine for me.

But this downgrade, or reverse upgrade is not possible through Chrome, you have to install it separately. And Google official website is not going to give you an older version of Chrome but the latest version of it. I was going to head over to archive.org but thought of doing a search first. As it happens a few good people at http://google-chrome.en.uptodown.com/ have the archived versions for Google Chrome. I went ahead and reverse upgraded myself with version 39.

But then again next day, Chrome smartly upgraded itself to version 40. So this time I tried to find ways to disable the smart ass automatic update at least till the bug is fixed in v40. The official documentation details a few steps to disable automatic upgrades but those didn't work for me. I checked the process that were used to do the upgrade and that took me to the file /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin . For now I have renamed ksadmin to ksadmin.bak and the automatic upgrades have been disabled. Hope Google fixes these serious issues on Chrome and don't have to use these roundabout ways of doing things.


Wednesday, January 7, 2015

Downloading a File in an Unreliable/Flaky Connection

Many of us find ourselves stuck in a place where we have a very unreliable/flaky connection and need to download a file urgently. Most likely you don't have an external download manager (those were popular in age of IE 6), and using a browser to download restarts the download from beginning every time. With a lot of luck you hope the download is successful this time. I went through the same when I spent my New Year holidays with family in a not so connected to internet part of India.

Obviously, one such solution that props to mind is using curl with "-C" continue the download flag. So using curl your command is going to look like

curl -L -O http://xyz.url

and when the download has failed, switch over to command

curl -L -O -C - http://xyz.url

But this have another problem. You have to constantly monitor the download and launch the command as soon as it craps. Curl helps you by returning an error exit value if the download was not successful and otherwise. Wish there was a command to relaunch it based on the exit flag. Since there is none, ruby can come to your rescue. We can write a small ruby script to do just that. The ruby script looks like

ruby -e "while(\!system(\"curl -L -O -C - http://xyz.url\")); end"

Hope this helps. Happy New Year !