Month: December 2011

Bash script to find mutual friends in Identica

I guess this is my first technical post involving script in it.

Starting this week, due to a recent change in my job role, I planned to spare my knowledge more on coding, along with technical aspects.

As a start, I came across my junior’s blog post yesterday about finding mutual friends in twitter. I thought to try one for Identica as well. As a result, I found the equivalent api’s for Identica. Here comes the code with a slight modification. Hope the below script is self explanatory.


curl ‘’$1 > .fol.tmp

curl ‘’$2 > .fol2.tmp

cat .fol.tmp | sed ‘s/.*[([0-9,]*)].*/1/’ | sed ‘s/,/n/g’ | sort > .ids.tmp

cat .fol2.tmp | sed ‘s/.*[([0-9,]*)].*/1/’ | sed ‘s/,/n/g’ | sort > .ids2.tmp

#comm -12 is same as grep -xFf 🙂

grep -xFf .ids.tmp .ids2.tmp | tr ‘n’ ‘,’ | sed ‘s/,$//’ > .comids.tmp

comids=`cat .comids.tmp`

curl ‘’$comids > .lookup.tmp

cat .lookup.tmp | tr ‘,’ ‘n’ | grep ‘”name”‘ | sed ‘s/.*:”([^”]*)”/1/g’ > .show.tmp

#If loop to find if the file is empty. Read the man pages of test to understand the below logic.

if [[ -s .show.tmp ]] ; then

cat .show.tmp


echo “No mutual friends in Identica, Try with a different pair”

fi ;

rm .fol.tmp .fol2.tmp .ids.tmp .ids2.tmp .comids.tmp .lookup.tmp .show.tmp

The Output is as follows :

$ ./ ijeyanthan vigneshwaranr

No Identica followers, Try with a different pair

Unfortunately, not many people are using Identica and thus a very few followers.

This is applicable for any other StatusNet installs. The API root will be determined by whatever you set in your  in config file.

Eg :

and for Twitter, replace identica with,

Please add your suggestions & tips for better coding.

How to stop Ctrl+Shift+Q from closing in Chrome abruptly?

I am an ardent fan of Google Chrome browser. I always work with multiple tabs ranging 25 to 40+ kept open. I also use multiple laptops for my work (Thank to Google Sync, as it helps me manage preferences, extensions across computers). As the keyboard layout differs among PC’s, I sometimes hit Ctrl+Shift+Q  by mistake instead of Ctrl+Shift+tab and it annoys the hell out of me. Yes, it closes the entire set of opened tabs without any warning popup message. Though there is a way to restore all those closed tabs by clicking “Recently closed tabs”, I badly need to get rid of this shortcut.

The browser has to save the exact state of the closed tabs contents if you plan to restore later, this might mess with web applications that work asynchronously and try to keep track of the client’s connection and session. Salesforce annoys me not just by logging out, but also gets the page redirected to it’s home page when I expect it to restore it’s session as such before closing.  The pathetic thing is, it deletes the entire history when we click back. Firefox does a pretty good job of maintaining this perfectly.

There can be only two options. Either to disable ctrl+shift+Q shortcut or to have a popup cautioning me about the closure, so that I can cancel it. Firefox, Internet Explorer 7+, and Safari all do this nicely now (either warning, or both warning and offering to re-open all tabs when next run).

I have been missing this feature for so long and so does many other impatient users. Looks like it has not yet been fixed yet.

To overcome this, I was trying out some extensions to overcome this issue and found the following app to be promising. – Window Close Protector.

Though there are few other extensions available in Chrome Webstore for altering the shortcut and was not so useful, I stick to this simple extension. This saved my day 🙂

Please be informed about it’s known bug..

If you’ve just installed the extension, it will not retroactively protect pages that are already open. Only new windows get protected. So, don’t try right away if it works. I was already victimized the first time 🙂

List of free courses offered from Stanford, Yale, Harvard and MIT !


Encouraged by the response for the three online classes currently running

Stanford is now launching the following classes in 2012:

Immediately below, you’ll find the latest additions. All of these courses feature interactive video clips; short quizzes that provide instant feedback; the ability to pose high value questions to Stanford instructors; and feedback on your overall performance in the class.

Courses start in January and February. Enroll today for free. And, if something doesn’t pique your interest below, don’t miss our big list of 400 Free Online Courses.

Newly added:

Technology Entrepreneurship
Making Green Buildings
Information Theory
Design and Analysis of Algorithms I
The Lean Launchpad

Originally mentioned:

Computer Science 101
Software Engineering for SaaS
Human Computer Intereaction
Natural Language Processing
Game Theory
Probabilistic Graphical Models
Machine Learning

More Free Courses from Top Universities

You can download lectures (usually in audio and video) from iTunes, or directly from the Yale web site. And then, of course, YouTube is a good third option…

MIT Introduces Complete Courses to OpenCourseWare Project

Harvard Presents Free Courses with the Open Learning Initiative


Source :