Category Archives: Uncategorized

Selectively hide posts on Facebook using Greasemonkey

Unlike a lot of people, I don’t happen to be a fan of Soccer. I know thats a bit difficult to believe, especially with this World cup season going on. Since the last few days, I’ve been waking up in the morning to a facebook full of soccer posts. I tried to tolerate it for a while, but then I realized that I couldn’t take it anymore, so I wrote this simple Greasemonkey script to hide all the posts on facebook containing the term soccer.

Named “I hate Soccer”, this script hides all the facebook posts that contain the word soccer.

In order to see it working, you need to install Greasemonkey addon for mozilla. from here. Once installed, just navigate to the URL:

You’ll see a dialog box come up, select install and that’s all. You won’t see any posts that contain the term soccer from now onwards on facebook.

The source code for the script:

// ==UserScript==
// @name           I Hate Soccer
// @namespace      none
// @description    removes all posts containing the keyword soccer
// @date           2010-06-13
// @author         texens
// @include*
// @require
// ==/UserScript==

$(document).ready(function() {


Modem Configurations for BSNL Broadband

I just got a BSNL Broadband connection (UL 750 Plan) and spent all day trying to setup the connection on my laptop and desktop. The setup on Windows 7 via wired connection was a cake walk, but the wireless on the Windows gave me hell.

After a lot of googling and some hit & trial, I was finally able to get the wireless as well as wired connection on both my machines – laptop and the desktop, in both Windows and Ubuntu.

System Information

I’m using Type 2 ADSL modem Teracom T2-B-Gawv1.4U10Y-BI. The machines I’ve connected run Windows 7 Professional and Ubuntu 10.04.


I’m assuming that you have been able to connect to the modem using the wired or wireless connection and we’re going to concentrate on connecting to Internet part.

  1. Fire up your browser and navigate to This is your modem’s IP address. You’ll be prompted to give username and pasword. By default, BSNL uses admin and admin as the username and password. respectively.You’ll be directed to the Home >> Overview Page.
  2. Before we start playing around with the settings and configuration, lets create a backup of our current modem settings. Go to Admin >> Backup & Restore, and create a backup file and save it on your local hard drive.
  3. If you’re using Teracom T2-B-Gawv1.4U10Y-BI, then you just got lucky, because I have the configuration file that you can use straight away and save yourself the effort to manually change all the settings. You may download the configuration file off this link:
  4. In order to save this configuration file to your modem, go to Admin >> Backup & Restore.Backup & Restore
  5. You still need to set your username and password in the new internet connection that has been created. Go to Configuration >> Internet Connection and edit the pppoe_0_35 connection. Keep on pressing the Next button until you arrive “Configure Broadband Username and Password” page. > Internet Connection Configuration” src=”” alt=”” width=”640″ height=”515″ />Use the username and password provided to you by your provider and click on Next. Finally on the last page, click on Apply to set everything up.
  6. The last step is to reboot the modem. Go to Admin >> Reboot and reboot the router therefrom. Wait for a minute and you’re all set with the modem.

Now that we have our modem properly configured, we can move to setting up the PC. For Windows, its pretty straight forward, but for Linux, it may not be all that easy. I had a hard time trying to configure linux to get the internet connection. And then I came across this totally awesome tool wicd. wicd worked like a charm and it was all very easily setup without any problem.

the bitch is here !

Ever since I replaced my CPU and 17 inch monstrous CRT monitor with a 14 inch HP laptop, I’ve been missing the large screen badly. Getting a new monitor to connect with my laptop was on my cards since quite some time, but I was unable to materialize it due to one or the other reasons. But, finally I bought a new big black beautiful bitch from Kolkata. It was pretty difficult to find a 22 inch monitor with HDMI port. I checked in 4 shops – including the (in)famous E-Mall in Chandani Chowk, Kolkata and got a negative. 22 inches are very common in CC but HDMI port was the problem. Finally, I was able to lay my hands on one with HDMI port at good old Arihant’s. Thanks to his bias for kgpians, he not only arranged the monitor with HDMI support, but also gave it to me at the old (cheaper) price. Here’s a snap of the laptop with the monitor connected with the HDMI cable.

Big Black Beautiful Bitch
the Big Black Beautiful Bitch

Coming to the specifications:

It has a maximum resolution of 1920×1080 and a dynamic contrast ratio of 10000:1. It has a D-sub, DVI-D as well as HDMI input connector. I have tried the DVI-D input connector once, but most of the time I’ve been running with the HDMI connector. Note that, the HDMI connector doesn’t come along with the Monitor and you’ll have to buy it separately. The picture quality has been great ! It took me quite some time to grasp all the functionalities of its vast menu. It has a number of preconfigured settings which can be changed from the monitor’s panel manually. It also has inbuilt speakers and supports HDMI audio. The response time is 5 ms (gray to gray is 2 ms). Its user manual also boasts of a senseye+photo technology which gives 5 preset modes to support everyday needs. I haven’t been able to discover these modes fully yet. But, for sure this bitch is on for some real adventure for the coming few days.

There seems to be some problem with ubuntu 10.04 as it has failed to support the HD audio on my system. It works absolutely fine on windows 7 but ubuntu is creating quite some trouble. But I’m not surprized, 10.04 was launched jst a week back and its pretty much expected to have some bugs in the system for the next few days. I’m hoping that the problem will be fixed asap. I’ve been using the monitor for mostly 2 purposes – viz coding and watching movies in full HD. The experience is simply awesome ! Combined with a Creative 2.1 speakers, it acts pretty much like a Home Theatre system. Very soon I’ll be getting myself a 5.1 speakers and it’ll add some more fun to the experience.

Protecting files and directories on webserver using .htaccess and .htpasswd files

You can protect specific files and directories on your webserver using .htaccess and .htpasswd files.
The following is an example to get you started.

Create a simple text file using your favourite text editor and name it .htpasswd
Now you need to write the following into your file in a line:


But it is not put as it is, rather it is encrypted and then entered into the file.
For example this is what it looks like on my system


You can use this link to encrypt your file:

Here, we are done with the .htpasswd file.

Lets move to the .htaccess file. One can use the .htaccess file to prevent the access to certain files and/or directories on the webserver.
Create a new text file named .htaccess and put the following lines to the .htaccess file.

AuthUserFile /absolute/path/to/.htpasswd
AuthGroupFile /dev/null
AuthName ‘Protected Area’
AuthType Basic

Now depending on you requirement, you may add the following lines to the file.

  • If you want to prevent access to a directory, then put the .htaccess file into the directory which needs to be protected and add the following lines to it. Note that these lines are in addition to the 4 lines aforementioned.

<limit GET PUT POST>
require valid-user

the whole .htaccess file will look something like this:

AuthUserFile /opt/lampp/htdocs/gk/.htpasswd
AuthGroupFile /dev/lampp/htdocs/gk/.htpasswd
AuthType Basic
Allow From All

<limit GET PUT POST>
require valid-user

  • If you want to prevent access to a file, then put the .htaccess file into the directory which contains the file to be protected and add the following lines.

<Files file-to-be-protected.extension>
Deny From All

The usage of .htaccess and .htpasswdd given here are very basic. For a detailed tutorial, take a look at this.

Adding a startup script that always runs at boot time

You have a script that you need to run everytime your system boots? say, for example you need to dial up to connect to internet. Its very simple and straight forward:-

Write a script and add it to your /etc/init.d/ directory, say your script’s name is

$ mv /etc/init.d/
$ update-rc.d defaults

that’s all… now boot your system and tada… no more typing in commands on the terminal after boot to do those daily bootup tasks!

My first svn commit

Here comes the day I had been waiting for since the very first day i started my internship…I made my first svn commit today. svn stands for SubVersion. Its a studd way of keeping ur code under strict version control. We write code and we write a lot of that. Many a times we need to revert back to the old code when things don’t work as expected. This version control system comes handy in such situations. All you need to do is shoot a command on the terminal and you’ll have the old code base back on your system. I worked on my first story, it was a short one, in fact a zero pointer, and had to do with the view of the form of the app we’re working on. The feeling that you have when you make the transition from a learner to a developer is just great, it can’t be expressed, you need to experience it to know it. Its like coming out of the egg shell, facing the world. It takes away all the securities that you have. But then it also brings with itself a lot of responsibilities.