IITG Webmail Extension – Auto Login Feature

Chrome, IITG, IITG webmail March 3rd, 2010

Note: This post is only for currently enrolled IITG students.

Today I added a new feature to the “IITG webmail chrome extension” – Auto Login feature. Now you can save your username and password in the options page of the extension and enable auto-login. After enabling auto-login feature, whenever you open http://webmail.iitg.ernet.in, the extension will automatically redirect you to your inbox.

Check out the screenshots at the extension page: https://chrome.google.com/extensions/detail/ljfkohgffehmmfnmghdlbceidmddgdob?hl=en-us

All those who are already using this extension can update it by clicking “Update extensions now” button in chrome://extensions page. New users can directly install the extension at: https://chrome.google.com/extensions/detail/ljfkohgffehmmfnmghdlbceidmddgdob?hl=en-us

Keep pouring in your feedback by posting comments.

Updated IITG Webmail Extension

Chrome, IITG, IITG webmail February 28th, 2010

Note: This post is for currently enrolled IITG students

I wrote about a chrome extension in my yesterday’s post. 1st and 2nd year students of IITG have different mail servers than Disang. They won’t be able to use the extension. So, I updated the extension. Now one can set the default mail server and save the option. Now, the extension works for all the mail servers.

Those who have already installed the extension can update it by clicking on the button “Update Extensions Now” button in the Chrome Extension page. And those who have not yet installed the extension can install the updated version directly from : https://chrome.google.com/extensions/detail/ljfkohgffehmmfnmghdlbceidmddgdob?hl=en

Keep pouring in your feedbacks in the comments.

Google Chrome Extension for IITG Webmail

Chrome, IITG, IITG webmail February 27th, 2010

NOTE: This post is for IITG students.

IITG webmail accounts are hosted on different servers for students, staff and faculty. So every time I open the page – http://webmail.iitg.ernet.in, I have to change the server to Disang. I wrote a simple chrome plugin to do this automatically, every time I visit this page.

It is simple to use. You need to have the latest version of Google chrome installed. Once you have it, just click on this link: https://chrome.google.com/extensions/detail/ljfkohgffehmmfnmghdlbceidmddgdob and then press “Install” button. And you are done. Now open the webmail page – http://webmail.iitg.ernet.in and check out the selected server.

Send me feedback by commenting to this blog or at the plugin page.

Post Pidgin and Twitter status from command line

Linux, Pidgin, Twitter, bash, microblogging January 20th, 2010

I often want to post the same status message in Pidgin and Twitter. I wrote  simple bash script to accomplish this.

One can download the script from here: http://www.spsneo.com/scripts/poststatus.tar.gz

How to use it -

1) Change the permission of the file to make it executable: chmod +x poststatus

2) Then execute the file with the status message as the argument: ./poststatus "Status Message goes here in quotes"

3) The script will first post the status message in your pidgin and will then ask whether you want to post it on twitter.  If you say yes, the script asks you for your twitter username and password.

Start using the script and send me feedback to improve it.

Bash History Tips and Tricks

Linux, Man pages, bash September 19th, 2009

Bash supports history expansion feature which can be very useful for powerful command-line users.

According to bash manual page -

History  expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly.

History expansion is composed of three parts -

  • Event Designators: It is a reference to an entry in the history list.
  • Word Designators: It is used to select a word from the event.
  • Modifiers: Modifies the word selected by the word designator or the action of the command.

All the three parts are optional and are separated from each other by a : (colon). There can be multiple modifiers each separated by a : (colon).

Now I will explain each part one by one.

Event Designators:

  1. ! Start a history substitution, except when followed by a blank, newline, carriage return,  = or (
  2. !n It refers to n’th command in the history. So if you just type in
    !68 at the command prompt, 68th command in your history list will be executed.
  3. !-n It refers to n’th command in the history from last. So if you just type in !-1 at the command prompt, last command will be executed.
  4. !! is an alias for !-1. Example:
    $apt-get install gnome-ppp    //Permission Denied. You need to be sudo to do this!
    $sudo !!                      // This is equivalent to sudo apt-get install gnome-ppp
  5. !string It refers to the most recent command in the history starting with string. It is again an useful expansion when you don’t remember the arguments to a command which you have executed earlier.
  6. !?string[?] It refers to the most recent command containing string. The trailing ? may be omitted if string is immediately followed by a newline.

Word Designators:

  1. n The nth word, count starting from 0. 0th word normally refers to the command. Example:
    $sudo cat /etc/resolv.conf     //Instead you want to edit the resolv.conf file
    $sudo vi !!:2                       //This is equivalent to sudo vi /etc/resolv.conf
  2. ^ This refers to 1st word. This is equivalent to :1 as refered above. The only .advantage is that you can omit : (colon) when you use ^. Example:
    $cat ~/.bashrc
    $vi !!^        //This is equivalent to "vi !!:1" that is vi ~/.bashrc
  3. $ This refers to the last word.
  4. x-y This refers to a range of words; ‘-y‘ is equivalent to ‘0-y’.
  5. * This refers to all the words except the 0th one. This is helpful when you have to execute a command with all the arguments passed to the last command.
  6. x* This is an alias for x-$ .

Note: If a word designator is used without an event specification, the last command in the history is used as the event. Example -
$cat ~/.bashrc
$vi !:1
// This is equivalent to vi !!:1 or vi ~/.bashrc

Modifiers:

  1. h This removes the trailing file name component, leaving the head. Example:
    $cat /home/spsneo/.bashrc
    $ls !!:1:h
    //This expands to ls /home/spsneoExplanation: !! refers to the last command and then :1 refers to the 1st word of the last command and then :h removes the trailing file name component i.e., .bashrc . Hence the expansion.
  2. t This removes all leading file name components, leaving the tail.
  3. r This removes the trailing suffix of the form .xxx , leaving the basename.
  4. p Print the new command but do not execute it.
  5. s/old/new This substitutes the first occurrence of old with new. Example:
    $cat /etc/resolv.conf
    $!!:s/resolv/yum
    //This expands to cat /etc/yum.conf
  6. g This is used in conjunction with “:s” modifier. This causes changes to be applied over the entire event line rather than just the first occurrence. Example:
    $cat test.cpp test.h
    $!!:gs/test/source/
    //This expands to cat source.cpp source.hh

This is all I have to share about bash history expansion.

Do post comments if you find any mistake or if you want any further clarifications. One can also go through the bash manual pages for more options.