Monday, May 28, 2007

Example Note 1

This is an example of a formatted note note



Powered by ScribeFire.

Sunday, May 27, 2007

Some Cool Vim Features

:ta /functionname - to search for function names when we dont know the complete function name
:tn - iterate through all the matches of the previous command.

:s/old/new/g - replaces all occurrences on the current line

:!ls - executes external commands

:r - inserts the filename to the position of the cursor

:r !ls - inserts the output of ls to the cursor position

use h j k l for cursor movement in vi

v - Visual mode to select text.
follow the above by operations like 'y' ( to copy ) or 'd' (to delete)

Some UNIX tips I used

To select multiple emails in pine :-

For Eg : Deleting Multiple Emails

To delete multiple messages in Pine you first need to enable the
aggregate command set. Then use them to mark and delete groups
of messages.


1. From the main menu Press S (Setup)
2. Press C (Config)
3. Scroll down using the down arrow key to:

[ ] enable-aggregate-command-set

4. Press X It should now look like:


'[X] enable-aggregate-command-set'

5. Press E (Exit) to exit the setup. You will be asked to confirm the change.
6. Press Y (Yes)

You should now be back at the main menu.
7. Press I (Index) This will put you in the inbox index.


The commands you need to use are ; (select) and A
(Apply). If you Press O once or twice you should see
these on the menu. But this is not necessary to actually
use the commands. Now we show two examples of deleting multiple Emails.


To delete the first 1000 messages:


1. Press ; (Select).
You will be asked for what category.
2. Press N (Number).
You will be asked to enter a comma delimited list or use a dash
for a range.
3. Type 1-1000.


The system will respond by placing an X in front of the first
thousand messages. Next you will delete the messages.


4. Press A (Apply). You will be asked which command you want to apply to the marked
messages.
5. Press D (Delete)
6. Press X (eXpunge)


Instead of pressing X (eXpunge) you could also quit pine and
answer Y(Yes) when it asked if you want to expunge them.


********************************************************************************

Saving a Message to a Folder You Specify

1. At the Message Index screen, use the arrow keys to highlight the message you want to save.
2. Type S (Save) to save a message.
3. You are asked if you want to save it to the saved-messages folder or another folder:
SAVE to folder [saved-messages]:
4. Type a folder name and press .
For example, to save a message to a folder named "friends," type friends and press . If this is the first time you have named this folder, you see the message:
Folder "friends" doesn't exist. Create?
5. Type Y or press to create the folder.
Once you have created the folder, or whenever you type the name of a folder that already exists, you see a message like this one:
[Message "#" copied to folder "friends" and marked deleted]

****************************************************************************************************


to find pdf files from a root dir with a modification date in 2007.
find ./ -name "*.pdf" | xargs stat -c='%x %n' | awk '{ if ( substr($1, 1, 5) >= "=2007" ) { print $1 $4;}} '

to untar all tar.gz files in a directory
for filename in *.tar.gz
do
tar zxf $filename
done


if u want to open a Xsession from a remote login , first add the IP of the remote computer to the access list of the host computer using the cmd : xhost + . Then set the DISPLAY variable on the remote computer to the IP of host computer using the command - export DISPLAY=:0.0