Friday, July 10, 2009

Script that reboots a router

A script to reboot BSNL/Airtel broadband routers via telnet login. : Script to reboot router
Usage: [-u username] [-p password] [IPaddress]

In case you don't specify username or password, it defaults to "admin" and "admin" respectively. This behaviour can be changed by editing the first few lines of the script.

UPDATE ( 01 NOVEMBER 2010 ):

Alternatively, this seems to work on some routers but not all :
wget --http-user="admin" --password="admin"

Thursday, March 26, 2009

Finch - The Swiss Army Knife of CLI Instant Messaging

As I was moving away from the bloated world of GUI (as always), I came across Finch the other day. Finch is a console-based IM program that lets you sign on to AIM, Jabber, MSN, Yahoo!, MySpaceIM and other IM networks on a *nix box.
It's fast, sleek, friendly enough for a terminal junkie and
based on libpurple.

The UI (ASCII UI?) is quite similar to that of Pidgin. Keyboard commands are quite obvious and easy.
Alt+W brings up a window list which is more of a "taskbar in a window" for Finch that is,
Alt+C closes the current window,
Alt+R resizes the active window,
Alt+M moves the active window,
Alt+A brings up an "Actions" menu using which you can open windows relating to a bunch of things,
F10 opens up a menu bar,
Ctrl+C/Alt+Q allows you to quit Finch (duh!),
and that's not the end of it. The manual page describes a few (okay, a lot) more shortcuts but the ones I mentioned are most frequently used by me.

Apart from that, it also has a nice set of plugins, my favorite being "psychic mode" and also Buddy Pounces to sneak up on unsuspecting victims (read Buddies).
Configuring the application can be done via the ~/.qntrc file using which you can change colors, key bindings, mouse configuration, menu texts and what-not. Haven't tried it personally but the man page says it can be done.

In short, it's basically Pidgin on a terminal. Cool? Definitely...

Saturday, January 31, 2009

Mucking around with conky

From the Conky homepage,
Conky is a free, light-weight system monitor for X, that displays any information on your desktop.
Enough about the introduction, lets cut to the chase.

Q : What do you get when you are a bored GNU/Linux user and you have an entire, boring, sunny weekend afternoon all to yourself?
A : In my case, a new conky config and here's a screenshot...

And here's the config file. Just copy and paste(the yellow text) into a new file (sorry, works for 1024x768 only :) :
    Copyright (C) 2008 Rohit (stuntdawg [at] gmail [dot] com)
Version 0.9, Licensed under GPL2
background no
use_xft yes
xftfont Dejavu Sans Mono-7
xftalpha 1
update_interval 1
own_window no
double_buffer yes
minimum_size 200 5
maximum_width 1024
draw_shades yes
draw_outline yes
draw_borders yes
stippled_borders 0
border_margin 0
border_width 0
default_color CCCCCC
default_outline_color black
alignment top_left
gap_x 2
gap_y 0
no_buffers no
uppercase no
use_spacer left

${offset 980}linrdx
${offset 938}${hr}
${offset 968}Users : $user_number
${offset 938}Uptime: $uptime_short
${voffset 40}${offset 115}CPU : $cpu %
${offset 113}Temp : ${execi 1 sensors|grep temp3|awk '{ print $2 }'|cut -c 2,3,4,5}
${offset 113}Fan:${execi 1 sensors|grep fan1|awk '{ print $2 }'}RPM${offset 370}$mem / $memmax
${offset 550}Cache : $cached
${offset 550}Buffer: $buffers
${voffset 225}${offset 69}${downspeedf eth0} kbps D
${offset 69}${upspeedf eth0} kbps U
${offset 735}Disk : /dev/sda
${offset 735}Temp : ${execi 5 sudo hddtemp /dev/sda|awk '{ print $3 }'}
${offset 735}I/O : ${diskiograph /dev/sda 10,50}
${voffset 33}
${offset 735}Disk : /dev/sdb
${offset 735}Temp : ${execi 5 sudo hddtemp /dev/sdb|awk '{ print $3 }'}
${offset 735}I/O : ${diskiograph /dev/sdb 10,50}
${voffset 53}
${offset 135}AC'97
${offset 117}PCM :${execi 5 amixer get PCM|tail -n 1|cut -d '[' -f 2|cut -d ']' -f 1}
${offset 117}Mic :${execi 5 amixer get Mic|grep Mono|cut -d '[' -f 2|cut -d ']' -f 1|tail -n 1}
${voffset 20}
${offset 533}USB devices : ${execi 2 lsusb | grep -vc 1d6b}
${offset 533}PCI devices : ${exec lspci | grep -c ''}
${offset 533}System time : ${time %H:%M %d-%m-%y}
And the wallpaper I made using Inkscape to go with it (license : WTFPL) :