/* Ajith - Syntax Higlighter - End ----------------------------------------------- */

6.16.2008

Calculate Time in Linux

Calculating time in LINUX in milliseconds and Seconds. We should include sys/time.h header file and the remaining sample code is

struct timeval start;

we wil be using gettimeofday system call whose syntax is
int gettimeofday(struct timeval *tv, struct timezone *tz); where

struct timeval
{
time_t tv_sec;···············/* seconds */
suseconds_t tv_usec;······/* microseconds */
};


/* To calculate time in seconds*/

gettimeofday(&start, NULL);
starttime = start.tv_sec + start.tv_usec/1000000;


/* To calculate time in milliseconds*/

gettimeofday(&start, NULL);
starttime = start.tv_sec*1000 + start.tv_usec/1000;

6.14.2008

Using GOOGLE as proxy to hide IP-Adress

NOTE (UPDATED on FEBRUARY 30th 2009): This trick seems to be no more fool proof as sites like tracemyip tracks down your exact IP-Adress even by using the Google Translation Service.

We know that GOOGLE has changed the way we access the web. It has simply became the stepping stone for any body who want to know information about anything in this world .. offcourse of universe too. It had wide variety of web based applications namely search, maps, gmail, gears, adsense, adwords, analyzers, language translators and many in its arsenal.

Now we can use one of the services of GOOGLE as proxy so that we can access the web anonymously without revealing our ipadress, location of our ISP. You might be wondering how our location is revealed out? Let us try out a simple experiment. Just visit the site

http://www.ip-adress.com/
We can see that the site reveals my ISP ipadress as 59.164.98.133 and my ISP location in a google map as Bangalore. If we further check out the site we can find out that the site has ecen information about our browser version, plugins installed, our screen resolution and many other things got revealed.
So how does GOOGLE service can be used a proxy? Let us check out the language translation service provided by the GOOGLE. You can get the link to this service if you type www.google.com and we can see a link to language tools or just click this link.

http://www.google.co.in/language_tools?hl=en

Once you click you are into that page we can see a option named "Translate a Webpage" with options to translate from one language to other. Note we cant translate same language to the same one i.e. for example from English to English. If we try to do it we get a GOOGLE ERROR.
Not let us try to access the site http://www.ip-adress.com/ asking GOOGLE translation service to convert the site from from French to English. Since nothing French is there in that site is simply displayed in English.
Strange it displays my ISP ip-adress as 209.85.170.136 and its location as United States. If I check out the site further I found out that I am getting redirected via google server present at Mountain View, US which is acting as proxy to access the site http://www.ip-adress.com/.
So we can access the any site in this way without revealing our information much. Thats really cool trick to stay anonymous. But there is a problem by doing so as the images cannot seen properly by using this technique. But even if a site is bocked we can access its content in this way. I tried out this trick on one of the torrent sites that are blocked but I can still access its contents.