Monday, March 11, 2013

Google Similar Image Search Firefox Addon

I found it annoying that I could not search for similar images directly from the browser.

I figured this should not be a hard thing to do, so I decided to write a firefox addon which will allow you to right click on an image and search for similar image (the technical term is "reverse image search").

So, here it is : Google Image Search.

PS: Later many such addons came out. Most of them better than mine :)

Sunday, January 6, 2013

Airtel broadband DNS sucks and how to fix it

I have been using for Airtel broadband sometime now, I find their DNS annoying if not unusable. Every now and then DNS server goes unresponsive which slows down internet for me.  After a while, well, I decided to take things into my own hands.

The solution is simple - use a better DNS server.  One way of doing this is to change the network settings in your computer to use a static DNS.  In linux, you edit /etc/resolv.conf. In windows this is done by editing Interface properties.

But this method did not suit me because there are multiple devices connected in my home network and I will have to change all of them. Also, devices come and go in our network (We have BYOD!).  The way out is to change your modem settings so that your modem relays a different DNS than what Airtel gives you.

I have always liked Google public DNS -- I think because they have super simple IP addresses ;).  I used it as my DNS Server.

I have a Binatone DT845W modem. So the steps below are for that modem.
Connect your modem in your browser. Usually modem IP is 192.168.1.1, so just point your browser to that address, provide your admin username and password.

Go to "Interface Setup" -> "LAN", there you can find a section called "DNS".  Change DNS relay to "Use user discovered DNS". Fill in your favorite DNS server IPs, save the settings and your done.


Welcome to a better Internet :)

Tuesday, April 27, 2010

Swanalekha JQuery plugin

Swanalekha is now available as jQuery plugin. Check it out.
This plugin makes it simple to use Swanalekha in your website/webpage.

Just include the jquery-swanalekha.js in your page and use it.

Some examples :

$("#t_input").swanalekha(); //will enable swanalekha on the element with id 't_input'

$("textarea").swanalekha(); //will enable swanalekha on all textareas

$("input").swanaleka(); //will enable swanaleka on all inputs, but only text inputs will actually be enabled


Friday, January 15, 2010

The Solar eclipse



We bunked office today and went to Kanakakunnu Palace. It was like a festival there. School kids from all over Kerala had come to witness the Solar eclipse.

This snap was taken through an aluminium foil.

Monday, November 16, 2009

Registered നിഷാന്‍.com

I registered നിഷാന്‍.com[redirected to this site now] recently from domainsite.com. These guys support unicode domain names by converting it to a cryptic string starting with 'xn-'.

May be you would want to register yours before someone else snatches it! :)

Sunday, March 22, 2009

Swanalekha firefox add-on

Swanalekha malayalam transliteration tool has been packaged into a Firefox add-on.

You can install the add-on and type Ctrl-M on any textbox to malayalam-enable it.  Right now, this does not work in rich text editors (eg: gmail compose box).  I am still scratching my head on how to do that :)

The addon basically wraps the javascript used in swanalekha online.  The script was orignally written by Santhosh, thanks to him.


Wednesday, September 17, 2008

"Mr Darwin, we're sorry", The Church !

"People, and institutions, make mistakes and Christian people and Churches are no exception. When a big new idea emerges that changes the way people look at the world, it's easy to feel that every old idea, every certainty, is under attack and then to do battle against the new insights.

The Church made that mistake with Galileo's astronomy and has since realised its error. Some Church people did it again in the 1860s with Charles Darwin's theory of natural selection."

Read more


Sunday, September 14, 2008

fix-ml downloads cross 100.

fix-ml is a firefox extension which I wrote to convert atomic encoding of 'chillu' letters of malayalam unicode font in web pages, making it readable.

Few days before the downloads crosses 100.

Little things like this can make your day :)

Tuesday, September 2, 2008

Run a movie as your desktop background

Here's a cool trick for you.

Replace the boring wallpaper on your desktop with a movie.

$gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop false
$mplayer -rootwin -fs movie_file.avi


Wednesday, August 20, 2008

You weren't meant to have a Boss

"The average MIT graduate wants to work at Google or Microsoft, because it's a recognized brand, it's safe, and they'll get paid a good salary right away. It's the job equivalent of the pizza they had for lunch. The drawbacks will only become apprent later, and then only in a vague sense of malaise.

And founders and early employees of startups, meanwhile, are like the Birkenstock-wearing weirdos of Berkeley: though a tiny minority of the population, they're the ones living as humans are meant to. In an artificial world, only extremists live naturally."

http://www.paulgraham.com/boss.html

Monday, August 11, 2008

XStream : The simple XML Parser

XStream is an xml parsing API implemented in Java. Key things about XStream is that it is very simple, lightweight, easy-to-use and open-source.

Let me show you how to start off with XStream.

Download XStream jar file, and have it in your classpath.

Let's see how to serialize an object into xml using XStream.

We have a class 'Person'
public class Person {
private String name = "";
private String address = "";

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

}
Here's how we serialize an Object of Class 'Person'


public void writeAsXml() {

Person person = new Person();
person.setName("Bob");
person.setAddress("Georgia");

XStream xStream = new XStream();
try {
FileOutputStream fs = new FileOutputStream("/tmp/person.xml");
xStream.toXML(person, fs);
} catch (FileNotFoundException fe) {
fe.printStackTrace();
}

}


The xml output we get looks like this:
<Person>
<name>Bob</name>
<address>Georgia</address>
</Person>

Easy, huh?

Now going on to deserialze Objects from XML,

public void readFromXml() {

XStream xStream = new XStream(new DomDriver());

try {
FileInputStream fin = new FileInputStream("/tmp/person.xml");
Person person = (Person) xStream.fromXML(fin, new Person());
System.out.println("Hello "+person.name+", from "+person.address);
} catch (FileNotFoundException fe) {
fe.printStackTrace();
}

}

We can accomplish more complicated stuff using XStream. But for a start I guess this is enough :)

Sunday, June 29, 2008

Running Selenium inside JUnit

Selenium is a framework which makes testing a web application possible, in an automated fashion. It helps us record test scripts in various formats and run it on the web application.
Selenium brings you three components. One of those, Selenium-ide is available as a firefox extension which can record your actions on a web page and then re-run it. Another component called selenium-core helps you copy the test-scripts over to the server and run it from there. This is helpful when you need more control over the way tests are run. Third one, which we are particularly interested in, is the selenium-remote. Selenium-remote has a server and client architecture.

JUnit is a unit testing framework (okay, I know you know that!). It is possible to
combine jUnit and Selelnium to write powerful client side test scripts. One advantage is that selenium testscripts can be made part of your build process.


Now, lets get into action. Download the selenium-remote.

First step would be to run the selenium-server. The server acts as a intercepting server
for the client (the client is mostly the browser).

$java -jar selenium-server.jar
19:18:09.156 INFO - Java: Sun Microsystems Inc. 10.0-b22
19:18:09.156 INFO - OS: Windows XP 5.1 x86
19:18:09.156 INFO - v0.9.2 [2006], with Core v0.8.3 [1879]
19:18:09.500 INFO - Version Jetty/5.1.x
19:18:09.500 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
19:18:09.500 INFO - Started HttpContext[/selenium-server,/selenium-server]
19:18:09.500 INFO - Started HttpContext[/,/]
19:18:09.828 INFO - Started SocketListener on 0.0.0.0:4444
19:18:09.828 INFO - Started org.mortbay.jetty.Server@6d084b


Server is up and running on port 4444 (of course you can change the port, take a look at the command line options)

You are now ready for the jUnit test case. A simple one :

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

import junit.framework.TestCase;


public class DummyTest extends TestCase {

Selenium selenium = null; // selenium object represents the browser

public void setUp() {
// Open the browser, connect to selenium server on localhost:4444. the basedomain is www.inapp.com
// *firefox is the browser command for Firefox, *iexplore for IE.
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.inapp.com" );
}

public void testDummyFunction() throws Exception {
selenium.open("http://www.inapp.com"); // open the url in browser
assertTrue(selenium.getTitle().startsWith("InApp")); // the test!
selenium.close();
}
}


Note that you have to specify a base-domain while instantiating DefaultBrowser. A url from another domain cannot be opened from the browser for security reasons.
Dont forget to include selenium-java-client.jar in your classpath.


Lets look at another example :

import com.thoughtworks.selenium.SeleneseTestCase;

public class DummyTest extends SeleneseTestCase { //Notice that we extend 'SeleneseTestCase' instead of 'TestCase'

public void testDummyFunction() throws Exception {
setUp("http://www.inapp.com", "*firefox"); // initialize the DefaultBrowser
selenium.open("http://www.inapp.com"); // open the url in browser
assertTrue(selenium.getTitle().startsWith("InApp")); // the test!
selenium.close();
}
}


We make use of SeleneseTestCase provided by selenium remote. It makes the code concise.

The DefaultBrowser class have lot of methods which we can use in order to validate the content in the browser and fire events. You event have a 'captureScreenshot' method to get a screenshot of your browser. So next time you have a test fail, get the screenshot mailed to you :)

Tuesday, June 24, 2008

Why GNU/Linux must be used in Schools

Most people think its the cost benefit of Gnu/Linux or free(as in freedom) software
which is the main advantage it gives. Well, in fact cost is just one among many reasons for using Free (as in freedom) Software.
Read this.

Thursday, June 19, 2008

The catholics ridicule themselves !

"It's a dangerous trend. Our community is shrinking day by day," Archbishop Thazhath told UCA News Sept 10. Other communities are "growing steadily" and the "trend should open our eyes," he added.


News here.

RIDICULOUS !!!!

Saturday, June 14, 2008

ദസ്തയോവ്സ്കിയും ദൈവവും.

"ദൈവം എന്നേപ്പോലെ
തിരസ്കൃതനും ദരിദ്രനും
രോഗിയും ഏകാകിയുമായിരുന്നെങ്കില്‍
ഞാന്‍ പറയുന്നത്‌ കുറേക്കൂടി
നന്നായി അദ്ദേഹത്തിന്‌ മനസ്സിലാകുമായിരുന്നു"

-ദസ്തയോവ്സ്കി

എവിടെയാണ് വായിച്ചെതെന്നു ഓര്‍ക്കുന്നില്ല....

Thursday, June 12, 2008

The story of stuff

From its extraction through sale, use and disposal, all the stuff in our lives affects communities at home and abroad, yet most of this is hidden from view. The Story of Stuff is a 20-minute, fast-paced, fact-filled look at the underside of our production and consumption patterns. The Story of Stuff exposes the connections between a huge number of environmental and social issues, and calls us together to create a more sustainable and just world. It'll teach you something, it'll make you laugh, and it just may change the way you look at all the stuff in your life forever.

The Story of Stuff

Tuesday, May 13, 2008

Replace the 'aanava's

Unicode standard has been updated to 5.1

May malayalees are not happy with this version because they have something called
aanava chillu in place now. You can read more about it here.

You can see why people dislikes aanava chilus here.

Meanwhile, I wrote a greasemonkey script to replace aanava chillus with the good old
chillus.. get it here.

Thursday, May 8, 2008

Free the University !

Did you have to study M$ access in your Database course?
Or did your syllabus specify Borland Compiler to learn C ?

Report it here : fci.wikia.com/wiki/Syllabus_Review

The initiative is to collect all instances of proprietary softwares in curriculums
and try to clean them up.

Friday, April 18, 2008

Mammootty and Microsoft ??

Mammootty going to be brand ambassador for Microsoft !!

"Mammootty said he wants to launch the project to help make all sections of the society IT literate."

Mr Mammootty, do you want to take away our freedom for that? That too when there are better ways for doing this.

An Open Letter to Mammootty by freedom lovers

Wednesday, April 16, 2008

GNU/Linux Install fest

ilug-tvm organized GNU/Linux Install festival at trivandrum on April 12th.

The event was a huge success, we installed GNU systems into more than 50 machines!

More news...

Bookmark

AddThis Social Bookmark Button