HowTo: Automate start and stop BSNL router in Linux

BSNL is the culprit of spreading insomnia(sleeplessness) among young India. In other words, the happy hours of BSNL free download is scheduled from 0200 hrs to 0800 hrs which results in people staying awake early in the morning and missing out on the essential sleep. This is when automation tools and schedulers come to picture.

This guide basically does you want to do at 0200 hrs and 0800 hrs with a BSNL broadband connection. This works only if your modem is configured in the bridge mode and not in the PPPoE mode, assuming most of you have port-forwarding enabled for higher download speeds which by default needs bridge mode.

OK, here we go. At 0200 hrs -

  • You want to start the internet connection
  • You want to reset your IP
  • You want to start your torrent client

and at 0800 hrs -

  • You want to stop the internet connection
  • You want to stop your torrent client

At a point when you are about to sleep, turn off the internet connection with this command in the terminal:

sudo /etc/init.d/networking stop


Now, start your torrent client and enable all downloads. The downloads will not begin since your internet is off. Remember your modem is still ON.

The main task here is to switch on the internet connection at 0200 hrs, and stop the connection at 0800 hrs and close all torrent clients and download managers. For this we use the inbuilt automation tool in Linux, cron. Open up the terminal and -

sudo crontab -e

Note that if you are running cron for the first time, it asks you to choose an editor. I strongly recommend you to use nano. Enter the following lines into the file -

05 02 * * * /etc/init.d/networking restart
55 07 * * * killall ktorrent deluge
55 07 * * * /etc/init.d/networking stop

Save and close the file. Here replace ktorrent or deluge with your favorite torrent client. Once this is done, your internet automatically restarts at 5 past 2 early morning, starts all your downloads and turns down the internet at 5 minutes to 8 and also closes down the torrent clients.

Now, you may ask how do I initially configure my internet connection in Bridge mode. Thats simple as well.

Open the terminal -

sudo pppoeconf

Follow on screen instructions, enter your BSNL username and password when asked and done, your connection is up and running and activates at every boot.

With this, you can now sleep tight. Good night.

PS: To automate stuff in the PPPoE mode, follow Madhusudan’s Guide.

After two years, I found the best font for (K)Ubuntu

Two things which always I (and Madhusudan) think that Windows scores over Ubuntu would be undoubtedly -

1. Games

2. Fonts

Its upto the Game developers to release games for Ubuntu and there is nothin much I can do about it. But, there is something I can surely do to make fonts in Ubuntu clean, sleek and smooth. I have always hated the default Dejavu Sans but lived with it since I had no choice.

Then recently, when I was hanging out at the UbuntuForums, ( my second home :) ), I came across this wonderful Lucida Grande font. This is the default font used in Mac OS X and is absolutely wonderful. I liked it the moment I saw it. After googling for about 5 minutes I found the ttf and right away installed it. Damn, Ubuntu does not be default smoothen or Hint the fonts. So I followed these steps to obtain the look I needed.

Step 1. Download the Lucida Grande font.

Step 2. Extract the archive and copy the ttf onto the .fonts directory which can be found in your $HOME.

Step 3. Now we need to reconfigure the fonts configuration to get a better font rendering. Open Konsole and enter -

sudo dpkg-reconfigure fontconfig-config

This will popup a dialog box and ask some questions. Make sure you select AutoHinter, Always, and Yes.

Step 4. Assuming you are in KDE4, go to system Settings -> Appearance -> Fonts and Adjust all fonts to Lucida Grande size 9.

Step 5. In the same window enable Anti-Aliasing and configure the hinting style to Full. Force Fonts DPI to 96.

Step 6. Go back and make GTK applications use the KDE fonts.

Step 7. Logout and Login to experience the best fonts for (K)Ubuntu.

Happy (K)Ubuntu-ing.

HOWTO: Make GTK applications look sleek on KDE4 – QtCurve

By default GTK application look ugly on KDE4. Now, this becomes a big issue because Firefox and Pidgin are two GTK applications that I cannot give up.

Ugly Default Look

Ugly Default Look

The solution to this problem is simple. Thanks to the package qtcurve if you are using Kubuntu.

Step 1: Start konsole

Step 2: sudo apt-get install qtcurve

Step 3: Go to System Settings -> Appearance -> GTK styles and fonts

Step4: In the GTK styles sub-menu select QtCurve

Step 5: Restart your GTK Apps. Enjoy the new sleek look :)

New Sleek Look

New Sleek Look

One line media codec installation in Ubuntu

This simple commandline installs the most common restricted codecs in Hardy Heron, allowing you to play mp3, aac, DVD ,mp4, avi, wmv, divx and many more formats. It also installs the codecs for ripping mp3s. It also installs VLC and Exaile media players

sudo apt-get install gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libsubtitles-perl vlc vlc-nox exaile

Who says Ubuntu does not play MUZIC ?

HowTo: Connect to internet in Ubuntu for DataOne

This is a simple guide for connecting to internet for Ubuntu for BSNL DataOne users.

Make sure you have a lan(ethernet card). All my efforts to find a solution for usb modem have failed. Better buy a lan card, costs only 200 bucks.

Step 1: Make sure all connections are intact and power, link and lan lights are on in your modem.

Step 2: Hit Alt+F2. Type network-admin. Enter your password if you are prmopted for.

Step 3: Select Wired Connection. Then Disable roaming mode in the check box.

Step 4: Select Static IP in the drop down.

Step 5: Use the following addresses

IP adderess :  192.168.1.100

Subnet Mask : 255.255.255.0

Gateway : 192.168.1.1

Press OK.

Step 6: Select the DNS tab. Enter the following OPEN DNS.

208.67.222.222

208.67.220.220

Press OK.

Now you are done. Open Firefox and test your internet. Enjoy.