Latest Entries »

Type in the below mentioned command in the terminal and follow the prompts :

sudo dpkg-reconfigure keyboard-configuration

The list of verified keyboard can be found here

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: http://texens.5gigs.net/webpage/iHateSoccer.user.js

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        http://www.facebook.com/*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==

$(document).ready(function() {
$("h6:contains('soccer')").parent().parent().parent().hide();
});

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.

Procedure

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 192.168.1.1. 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: http://texens.in/downloads/Conexant.icf.zip
  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=”http://texens.files.wordpress.com/2010/05/2-edit-pppoe1.png” 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.

I had an interesting experience today. We needed to translate a news article posted on limesurvey website into hindi. I had never done any translations before and had absolutely no idea how to do it. In the absence of a Hindi keyboard, it bacame all the more difficult.

My first thought was to try Google translations. After a couple attempts, I realized that the google translations wasn’t good enough. Fortunately, while googling for translations I stumbled upon 2 very useful resources – Google Transliterations and shabdkosh.

Using Google Transliterations, one can type hindi words using english alphabets and the transliteration engine automatically convrerts the words from english alphabets to hindi alphabets. On the other hand, shabdkosh is an excellent English to Hindi dictionary. On querying english words, it returns the translated words in hindi alphabets and makes life easier :)

It would have been a herculian task to do all the translations in the absence of these two amazing resources. I’ll be getting myself a HIndi keyboard in a couple days to make it easier to type in the hindi alphabets physically.

The Google Summer of Code results are out and I luckily made it to the final list :D.

For those who aren’t aware of GSOC, The Google Summer of Code (GSoC) is an annual program, first held from May to August 2005, in which Google selects hundreds of students from across the world who successfully complete a requested free software/open-source coding project during the summer.

The event draws its name from the 1967 Summer of Love (of the Sixties counterculture), and the idea for the SoC came directly from Google’s founders, Sergey Brin and Larry Page. This year Google has awarded 1025 projects to about 125 organizations.

I’m working on the project “Limesurvey 1 – File Upload Question Type”

LimeSurvey (formerly PHPSurveyor) is an open source online survey application written in PHP based on a MySQL, PostgreSQL or MSSQL database. It enables users without coding knowledge to develop, publish and collect responses to surveys.

In all there are 3 GSoC students in Limesurvey. While I’m working on the File Upload Question Type project, the other two are working on the Database Storage Engine project.

My proposal is available here, feel free to take a look at it and drop back any feedback.

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:

username:password

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

amit:8ZtgChaul6rcM

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
</limit>

the whole .htaccess file will look something like this:

AuthUserFile /opt/lampp/htdocs/gk/.htpasswd
AuthGroupFile /dev/lampp/htdocs/gk/.htpasswd
AuthName ‘NO TRESPASSING’
AuthType Basic
Allow From All

<limit GET PUT POST>
require valid-user
</limit>

  • 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
</Files>

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

Locating files on linux using find

A very powerful tool on linux systems is the find command. It is used to locate file in the system across directories.

example:

amit@texens:~$ find

It takes in the location to be searched, and the criteria. It can search using criteria such as file name, owner, group, file permission, last edit time etc. It is recursive in nature, that is it looks into the folders recursively.

example:

amit@texens:~$ find . -name foobar

will list all the files with the name foobar.

See manpage for find for more information.

Note: grep is different from find in the way that grep looks for content inside the files wheras find locates files itself and not the content inside them.

SVN recursively populates .svn folders in all the children folders of a project under version control. There are a number of techniques to copy the parent folder without copying the .svn folders and files, but I find the following to be easiest and quickest.

amit@texens:~$ rsync -aC /path/to/srcdir/ /path/to/destdir

The trailing “/” on srcdir is to make sure that the contents of srcdir are copied to destdir. Without the trailing “/”, the destdir will contain the srcdir and everything will be one more level down.

One other option is to copy the directory without paying any heed to the .svn directories and then find and delete all the .svn folders using the following command.

amit@texens:~$ cp -r /path/to/srcdir/folder /path/to/destdir
amit@texens:~$ find /path/to/destdir -name '.svn' -exec rm -r {} \;

Bitwise 2010 Winners

Bitwise, the Annual Algorithm Intensive Online Coding Contest organised by the Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur was held on 14th February, 2010. It saw the largest participation, in the terms of both – the number of participants as well as the number of countries.

There were a total of 6000 participants forming 3151 teams from 65 countries. But the bulk of countries came from India, United States, Bangladesh, China and Russian Federation.

This year, Enigma was somewhat easier, at least the long list of winners says so. This puzzle game was inspired by the Enigma machine which was used by the Nazis to encrypt and decrypt messages during the second World War. It consists of images and a hint to crack it. It has 30 levels, and all those who are successful in cracking them all enter the Enigma hall of fame.

The main coding event started at 1200 Hrs (IST) and concluded at 2359 Hrs (IST). In an amazing change over the previous years, this time there wasn’t any single team that dominated the event throughout the competition. Teams climbed up and descended down throughout the 12 hour period.
The first team to crack any problem was urbo, from the University of Latvia. Setting a new record in the history of Bitwise, they cracked the problem in just within 30 minutes of being uploaded. This certainly has been the best time ever made.

urbo was soon followed by teams – Eryx (Warsaw University), Excalibur (TSinghua University), 2/3 ubc^ (University of British Columbia), and Two Headed Monkey (KTH – Royal Institute of Technology & New York University). The teams went up and down and the last two hours saw the team – ajaysomani from google, climb up to second spot.

The final Rankings are as follows:

  1. Eryx, Warsaw University, Poland
  2. ajaysomani, Google, India
  3. urbo, University of Latvia, Latvia
  4. rem and _pperm, Perm State University, Russian Federation
  5. Two-Headed Monkey, KTH – Royal Institute of Technology & New York University, Sweden
  6. NiN, NNSU, Russian Federation
  7. 2/3 ubc^, University of British Columbia, Canada
  8. aryans, IIIT, Hyderabad, India
  9. daemons, Jagiellonian University, Poland
  10. Deadly Coding Squad, ITESM CQ, Mexico

You can download the solutions to the Bitwise 2010 Problems here and enigma answers can be found here.

The Bitwise 2010 team at the Software Lab.

Bitwise 2010 team
Bitwise 2010 Team (Diptesh behind the cam)
Follow

Get every new post delivered to your Inbox.

Join 233 other followers