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.

A Jhalak of The Jaunty Jakalope

Come April and starts off a countdown for yet another (K)Ubuntu Release and this time its Ubuntu 9.04, the Jaunty Jakalope. With first inputs from Madhusudan C.S that Jaunty went terribly wrong for him, dented all hopes of another wonderful release. But then, when I had my hands on, I say, the Jaunty is a Gem. Here are my first impressions of Kubuntu 9.04 -

Installer - Minor changes to the installer in timezone selection and partition manager. This time around the partition manager took less than 10 seconds to display the table as against over a minute with the Ibex. The installation process went on smoothly with CD-in to CD-out happened well within 15 minutes. That’s great!

Boot time – AS promised by Mark Shuttleworth, the Jaunty boots at an unbelievable timing of 22 seconds. The benchmark says 21 seconds but then I spend 1 second hitting the Enter Key at the Grub :P

With successful installation and a fast boot, JJ was all set, and this time its Kubuntu 9.04 for me.

Desktop Environment – With KDE 4.2.2 as default DE one could not have asked for more.  With its world-renowned Ubuntu core and the KDE 4.2 desktop, Kubuntu 9.04 gives users a well-rounded, feature-filled and elegant desktop.

ext 4 – The revolutionary ext4 has been performing well and is showing amazing speeds of data transfer. I now get around 35Mibps as compared to 20Mibps in ext3. Another reason to love GNU/Linux.

Gtk Support – Firefox, Pidgin and ntfs-config are the first and foremost packages I install on a Kubuntu machine. Started firefox and to my surprise it looked beautiful. For a moment I could not believe my eyes. The Qt Curve has been such nicely integrated with GTK applications that they almost seem native. Qt Curve Devs – Take a bow :)

Display – And yet again displayconfig-gtk is what I miss in this section. Ubuntu, post Gutsy never took my default screen resolution and I had to replace my xorg.conf. Once done, no problems whatsoever. If you have display problems then replace your /etc/X11/xorg.conf with this – http://tr.im/xorg and after a restart you can see the resolution in your display manager. Note – only for those with Intel Graphics.

Audio – Works out of the box and yeah Amarok rocks :)

Network Management – The old network manager is replaced with the new Plasma Widget. Super Cool! It displays the IP address on mouse hover.

Plasma – Whole lot of improvements to the Plasma and more new innovative widgets which make the Desktop experience more refined. The notification system looks good too.

System Settings – New in System Settings are tools for managing software and printer configuration. Finally, a full fledged KDE alternative to Synaptic Package Manager has arrived. The Kpackagekit ! Search, Install, Add/Remove, Update and edit software sources -  all at one place is what Kpackagekit gives you. Awesomeness!

Quassel IRC – Why? What was the need to replace Konversation? I personally did not like Quassel one little bit. The whole look and feel of Quassel seems so foreign. Usability is not easy either. I’m sticking with Konvy.

Digikam – YaY! Digikam has been updated to its first KDE 4 release. This version is not a complete port to KDE 4 technologies (Solid, Phonon…), but it includes major functionality improvements and I’m loving it. Works fine with my Kodak C653.

All-in-all, Kubuntu 9.04, the Jaunty Jakalope is one such release that has been problem free and its been a long time since I have seen such a stable release. No firefox freezes, no application crashes and no misbehaviours. Guys, Kubuntu 9.04 is out in the wild and is a combination of Speed, Beauty and Innovation.

Download Kubuntu Now