Tuesday, May 19, 2009

Free browsing on PC through Airtel LIVE!

After the RIPping death of all free GPRS tricks, finally I discovered a trick to browse free through Airtel LIVE! This one works in any circle in which browsing through TeaShark over Airtel LIVE! is free. I tested it in Punjab circle, and it works like a charm. Ok, so here we go.

Requirements:

1. A PC with any popular OS(Win, Lin)
2. Mozilla Firefox browser
3. Following extensions for Firefox: Modify Headers, XHTML-MP, Wmlbrowser, OpenInBrowser, Mason

Procedure:

1. Connect to net on your PC through your phone over the APN airtelfun.com
If you don't know how to do that, you're perfect example of a n00b so stay away from this post unless you learn that. Use google, learn that and then come back again.
2. Now install the above said extensions in FireFox, if you haven't installed them already.
3. In FireFox, in Tools menu click Modify Headers. Click the Configuration button, in the bottom right of the Modify Headers dialog.
4. Now, check the box that says Always On: Enable Modify Headers when this window/tab is closed
5. Now create a new entry in the Modify Headers dialog with following details:

Action: Modify
Name: user-agent
Value: Mozilla/5.0 (X11; U; Linux i686; EN-US) AppleWebKit/523+ (KHTML, like Gecko)

6. Save the entry and make sure a Green lit circle ahead of it. If not, then double click the entry to turn the red signal into green.
7. Now, in Firefox in Tools menu(in Windoze) or Edit menu(in Linux), click Options or Preferences. There in Advanced tab, in Network tab configure FireFox to use the proxy 100.1.1200.99 and port 8080 for all requests.
8. Now start browsing. Viola!!! You won't be charged anything for opening any site!!!!

Ok, so now, what were the other extensions for?
1. XHTML-MP: Since Airtel Live! has Nokia WAP Gateway installed at the backend, so sometimes for some sites it serves the content-type as application/vnd.wap.xhtml+xml or simply application/xhtml+xml. If you don't have XHTML-MP extension installed, instead of viewing the page, you'll get the dialog to save the page.
2. Wmlbrowser: For browsing the WAP sites.
3. OpenInBrowser: Sometimes, some sites which haven't been programmed keeping XHTML compliance in mind, will show an XML Parsing Failed error and you won't be able to view the site. OpenInBrowser extension lets you Reparse the document as html and make the page viewable. You already might be knowing XHTML is too strict about errors, and html is lenient.
On encountering any such page, in View menu, hover to View As, there select Other and in the content-type box type text/html and hit ok.
4. Mason: This is an alternative to OpenInBrowser. Through Mason, you can create a rule for any site that gives you problems. Just create a rule for the site, such that it always is parsed with text/html as the content-type.

Limitations of the trick:
1. The proxy doesn't support secure connnections, so no orkut, no gmail, no blogger! Any site with the URL starting with https won't open. Only http ones will open.
2. Sometimes the response times are too slow.
3. You'll encounter one of these too irritating errors several times:
a)Gateway received and invalid resposne from an upstream gateway.
b)Your request for a service couldn't be fulfilled.
In each case, just reload the page.

Ok, so how did I discover this trick? Where is the magic? How does it work for free?

My free Mobile Office working from past 7 months got shutdown recently. So, I thought of using an alternative for browsing. I used the TeaShark browser on my P1i, but TeaShark has display/rendering issues with sites on my phone. So, I was thinking to figure out why does teashark work for free. I setup an experiment, just changed the user-agent of FireFox to the one used by TeaShark. And bingo!!! To my amazement, I wasn't charged a single paise for opening any site.

Enjoy the free trick, share with your friends.

Saturday, May 9, 2009

LOLCODE

LOLCODE is a funny programming language understandable to 1337 or leet people only. It uses various Internet acronyms that flourished and were heavily used in early days of the Internet, among the newsgroup members and IRC addicts. Here's a simple LOLCODE "Hello World!" program.


HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE


HAI in the first line declares the start of our LOLCODE program. HAI means Hello in Internet slang.
CAN HAS STDIO? is C equivalent of #include
VISIBLE "HAI WORLD!" is for printf("HAI WORLD!")
KTHXBYE or Ok Thanks Bye declares the end of a program.


LOLCODE uses several funny constructs. For example for looping it has:
IM IN YR LOOP to start the loop and IM OUTTA YR LOOP to end it.
Variable declaration by:
HAS A VAR eg: I HAS A VAR which in plain english means I is a variable.
To open a file:
PLZ OPEN FILE "FILENAME.TXT"?
For a true value of the above statement:
AWSUM THX
For a false value:
O NOES which in plain english is Oh No!!!

For more details visit the official site http://lolcode.com or WikiPedia page

There are more trivial things like this. Check out INTERCAL and Brain****

There are people filled in this world to carve fun inside boring things like programming. LOL enjoy the world!
KTHXBYE

Friday, May 8, 2009

PHPMyAdmin Large SQL File Dumping Problem

As I'm a web/WAP developer with PHP as the base scripting language and MySQL as the DBMS, I've to take backups of the DB at rather regular intervals to counter any catatrophic events. I noticed that dumping a large SQL file (say 8-10 MB or more) takes lots of time(around 10-12 mins. or more) through PHPMyAdmin. I used to attribute this to MySQL thinking, it to be slow at parsing the file. One sunny day, I opened task manager before starting the dump process. As I hit the submit button, I saw the processor usage shooting up to 100%. I changed to the "Processes" tab and was surprised to see that mysql process wasn't consuming any CPU power. It was Apache which was clogging up 99% of the CPU power. I tried to End the process but it refused to, and my PC finally crashed.
Taking a lesson from this, I tried an alterntaive way. I used the MySQL command line interpreter to dump the file and voila!!! The dump finished smoothly in less than 15 seconds!!!! So, that was an Apache bug. Right???
Ok, by the way here is the step by step process to carry out the same.
1. Copy your sql file to a convenient location(say root of C:\) and name it something simple (say 1.sql)
2. Now launch command prompt and change to the directory where MySQL is installed. Mine is in F:\xampplite\mysql\bin
3. Type
mysql -u root

and enter your root password if asked. You may use any other username instead of root, depending on your needs.
4. Create the database if you want to dump into a new DB
CREATE DATABASE my_db;

5. Instruct MySQL to use this new DB.
USE my_db;

6. Now use the SOURCE statement to dump the file
SOURCE C:\1.sql;


Watch out the process munching a couple of lays chips! By the time you finish two chips, mysql will finish the file :)
I'm uploading the screenshot for a 22MB SQL file dump.


This one's upto the time I pressed enter after SOURCE statement


This one is after execution

Sunday, May 3, 2009

Higher Computer Education Online

Who says higher technical education is costly in India??? lol Many say!! And it is true to a large extent. Most of the talented students never get a chance to get themselves enrolled in IITs or NITs for a reason or another. But still the talented ones have passion to study and get what they deserve, through a bypass route. Admission to private engg. institutions is pretty easy but they charge loads of money. And, barring a few, most of them have pretty low grade quality of education.
SOciety apart, let me come to the point. Ambitious and passionate create their own paths to success! I'm writing this post to help such students find appropriate targetted study stuff online. Most of the stuff pertaining to the syllabi of B.E./B.Tech is available online but scattered quite badly. On performing a few searches, I found lots of stuff online that I'm enumerating here.

0. NPTEL Online Stuff
NPTEL stands for National Programme on Technology Enhanced Learning and is an initiative from various IITs to provide IIT lecture notes and videos to non-IITians online. So, far the best congregation of online study material for engineering students.
http://nptel.iitm.ac.in/


1. Rai Foundation Open Courseware
Rai university has its lecture notes online as per its open courseware program. Here's the link to the stuff for B.E./B.Tech in CS/IT and BCA/MCA:
http://www.rocw.raifoundation.org/course-computing.htm
Almost all the subjects of most of the university syllabi are covered. AICTE already has recommended a uniform syllabus for all technical universities.

2. Springer Link
Springer link has a congreagation of high level papers related to all the fields of engineering. Here's the link to computer science section. Use the search box in the right pane to find your desired syllabus.
http://www.springerlink.com/computer-science/

3. FreeTechBooks
FreeTechBooks.Com has open source public domain books for computer science and IT branches. A really good one:
http://www.freetechbooks.com/

4. IIT Lectures on YouTube
Recently IIT launched a program according to which all the classroom lecture videos will be made online on YouTube. Follow the link and search for ur subject. Now, you don't need to be in IIT to study in IIT
http://www.youtube.com/results?search_type=&search_query=iit+lectures&aq=f

5. WikiPedia
Leaving WikiPedia in the list will be a big blunder! WikiPedia has the largest congreagation of human knowledge on the Internet. To search for a particular topic on WikiPedia, type the following query in Google Search box and hit the I'm Feeling Lucky button:
site:"en.wikipedia.org" <topic name>

Example:
site:"en.wikipedia.org" Dynamic Programming


Thats enough dose for now! Study well, and bring up a bright future for yourself and for India. Jai Hind!!!