Tuesday, March 11, 2008

see the differences between two branches of CVS

To see all of the changes between two branches

1. checkout the source from HEAD/or branch, CD into it
2. run command cvs -q diff --brief -r brach_to_compare | grep Index

Monday, March 10, 2008

vi environment variables

set
you can customize your environment with this command by typing set var=value, this will set the specified var to value for a scalar variable. For boolean varaibles, use set var to set and set novar to unset. You can see which variables are set by just typing the set by its itself. You can see a list of all variables by typing set all. some environment variables are specific to the ex editor and some are specific to the vi editor.

boolean variables:

autoindent(ai)

begin editing next line at same level of indent-ion as this one.

autowrite(aw)

write current buffer before leaving

exrc(ex)

tells vi/ex if it should read the .exrc file in the current directory(this can be a security risk).

errorbells

editor sends a beep to the terminal when an incorrect

flash

inverse the screen on an error instead of producing a bell

ignorecase(ic)

ignore case of characters in searches.

lisp

enter lisp mode

list

place a $ at the end of each line and a ^I on each tab.

magic

allow ., [, and * to be interpreted as special characters in RE's.

modelines

execute the first and last 5 lines of the file if of the form: ex:command: or vi:command:

number(nu)

number lines in left margin

showmatch(sm)

when closing a paren., brace or bracket; move the visual cursor to opening item to check scope

showmode(smd)

show type of insert mode

wrapscan(ws)

when searching and at bottom of file, continue searching from the top


Scalar variables:

directory

the location of the temporary directory used by vi

paragraphs(para)

macros to signify the beginning of a paragraph

report

vi will notify you if you change more lines than the value of report

sections(sect)

macros to signify the beginning of a section

shell

The shell to use when executing the command :sh or :!

shiftwidth(sw)

number of spaces to to insert on a shift operation

showmatch(sm)

show the match of ) and } when typed

tabstop

the length, in characters, of a tabstop

term

holds the name of the terminal type being used

wrapmargin(wm)

split lines at the column which is equal to the value of wrapmargin

avoid error "Not owner of .exrc or .exrc is group or world writable" in vi

set this environment variable

export EXINIT="set noexrc"

Saturday, March 8, 2008

vi Editor Commands

The VI editor is a screen-based editor used by many Unix users. The VI editor has powerful features to aid programmers, but many beginning users avoid using VI because the different features overwhelm them.

General startup
To use vi: vi
To exit vi and save changes: ZZ or :wq
To exit vi without saving changes: :q!
To enter vi command mode: [esc]
Read the original file back in so that you can start over.: :e!


Counts

A number preceding any vi command tells vi to repeat that command that many times.
Deleting
x delete character under cursor
X delete character before cursor
dd delete line under cursor
dw delete word under cursor
db delete word before cursor
D delete to the end of line from the current cursor position
d^ delete from current cursor position to the beginning of the line
d$ delete from current cursor position to the end of the line

Copy/Paste Text
yy copies line
P paste copied data before cursor
p paste copied data after cursor

Find Commands
? finds a word going backwards
/ finds a word going forwards
f finds a character on the line under the cursor going forward
F finds a character on the line under the cursor going backwards
t find a character on the current line going forward and stop one character before it
T find a character on the current line going backward and stop one character before it
; repeat last f, F, t, T
, repeat last f, F, t, T going backwards
n repeat last search given by ‘/’ or ‘?’
N repeat last search given by ‘/’ or ‘?’ going backwards

Miscellaneous Commands
. repeat last command
u undoes last command issued
U undoes all commands on one line
xp deletes first character and inserts after second (swap)
J join current line with the next line
^G display current line number
% if at one parenthesis, will jump to its mate
mx mark current line with character x
'x find line marked with character x
^^ Go back to last file
READING/WRITING FILES
:r filename Copies filename after cursor in file currently editing
:n Start editing next file in list
:rew rewind file list, start editing 1st file on argument list
:w Saves the current file without quitting

MOVING
:# Move to line #
:$ Move to last line of file


Character/Line Formatting
~ Switch the case of the character under cursor
< Shifts the line upto where to the left by one shiftwidth
<< Shifts the current line to the left, and can be specified with a count
> Shifts the line upto where to the right by one shiftwidth
>> Shifts the current line to the right, and can be specified with a count
J Join the current line with the next one.

SHELL ESCAPE
:!'CMD' Executes CMD as a shell command
:!sh Fork shell in vi; hit ctrl-d to go back to vi

INSERTING
r replace character under cursor with next character typed
R keep replacing character until [esc] is hit
i insert before cursor
I insert from the beginning of line
a append after cursor
A append at end of line
o open line below cursor and enter append mode
O open line above cursor and enter append mode
c change until . "cc" changes the current line
C change to the end of line from the current cursor position
s substitute one character under the cursor and go into insert mode
S change an entire line


Screen Movement
G move to the last line in the file
xG move to line x
z+ move current line to top of screen
z move current line to the middle of screen
z- move current line to the bottom of screen
^F move forward one screen
^B move backward one line
^D move forward one half screen
^U move backward one half screen
^R redraw screen (does not work with vt100 type terminals)
^L redraw screen (does not work with Televideo terminals)

Cursor Movement
h move left
j move down
k move up
l move right
[return] move to the beginning of next line
$ last column on the current line
0 move cursor to the first column on the current line
^ move cursor to the first nonblank column on the current line
w move to the beginning of the previous word or punctuation
W move past the next space
b move to the beginning of the previous word or punctuation mark
B move to the beginning of the previous word, ignores punctuation
e end of next word or punctuation mark
E end of next word, ignoring punctuation
H move cursor to the top of the screen
M move cursor to the middle of the screen
L move cursor to the bottom of the screen
^H move cursor one space to the left
^J move cursor down one line in same column
^M move to the first character on the next line
^N move cursor down one line in same column
^P move cursor up one line in same column
% move cursor to the matching parenthesis or brace
( move cursor to the beginning of a sentence
) move cursor to the beginning of the next sentence
{ move cursor to the preceding paragraph
} move cursor to the next paragraph
| move cursor to the column specified by the count
+ move cursor to the first non-whitespace character in the next line
- move cursor to the first non-whitespace character in the previous line
_ move cursor to the first non-whitespace character in the current line

Wednesday, January 9, 2008

Finding bugs in the application

A QA engineer always thinks of a bug in the application and always try to find them. Finding bugs in any application is really a challenging work and if you find bugs, it gives you the satisfaction of your job. Below are few tips by which you can find bugs in the application:


1. Understand the application/module in depth before starting the testing
2. Prepare good functional test cases before starting the testing.
3. Create all possible type of test data before testing.
4. Test the system in different environments.
5. When you tired or bored by testing same module or application, do MONKEY TESTING, really it works. I tried it many times and got good bugs :)
6. Try some standard test cases for which you found the bugs in some different application.
7. Test the application with dedication and passion.
8. Think alike of different users while testing the application.


Doing QA is like being a goalkeeper. You can make a hundred brilliant saves but the only shot that people remember is the one that gets past you.

Saturday, December 29, 2007

Read properties from ant build file using perl

I want to read some properties from my ant build file in my perl script. I wrote a sample perl script for it. below is the script:

Thursday, December 27, 2007

Check all arguments of a running process

Many Java processes have long command lines, and as as a regular user, I may wish to determine that my java processes are running with the correct arguments or not.
unfortunately with the ps (/usr/bin/ps) command, users can only see the first 80 characters of command line, rest are ignored. So the user can not see the all command line arguments.

Solution:
1. Use pargs argument (ex. ps -eaf | pargs -a <pid>)
or
2. Use /usr/ucb/ps command ( /usr/ucb/ps -awwx | grep <pid>)

Wednesday, December 26, 2007

What version of Flash do you have?

Visit following link to display the currently installed version of the Flash player.

www.adobe.com/products/flash/about

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507

Monday, December 24, 2007

Kill java processes from perl script

Requirement:- If multiple java processes are running on your system and you want to kill only few specific from them.
If we do it manually then we have to perform below two steps:

1. jps (it will return all the java processes running on the system) in below format:
<pid>     <process name>
<pid>     <process name>
<pid>     <process name>
<pid>     <process name>
...

in my case i got the below output from above command:

1234 Server1
1334 Server2
1454 Server3
1264 Server4
1238 Server5
1244 Server6

2. now i have the process id of all the java processes so i can kill them using kill command, (let say if i have to kill only Server1, Server5 , then)

kill -9 1234
kill -9 1238

By using perl script, i can write below simple script which will do my above task:

foreach $_ (`jps`) {
my($pid,$pname) = /(\S+)\s+(.*)/;
if($pname eq "Server1" | $pname eq "Server5" ) {
print("Killing Process : $pname ($pid) \n");
system("kill -9 $pid");
}
}

Monday, December 17, 2007

Searching tips in Google

1. Explicit Phrase: Lets say you are looking for content about internet marketing. Instead of just typing internet marketing into the Google search box, you will likely be better off searching explicitly for the phrase. To do this, simply enclose the search phrase within double quotes.

Example: “internet marketing”

2. Exclude Words: Lets say you want to search for content about internet marketing, but you want to exclude any results that contain the term advertising. To do this, simply use the “-“ sign in front of the word you want to exclude.

Example Search: internet marketing -advertising

3. Site Specific Search: Often, you want to search a specific website for content that matches a certain phrase. Even if the site doesn’t support a built-in search feature, you can use Google to search the site for your term. Simply use the “site:somesite.com” modifier.

Example: “internet marketing” site:www.smallbusinesshub.com

4. Similar Words and Synonyms: Let’s say you want to include a word in your search, but want to include results that contain similar words or synonyms. To do this, use the “~” in front of the word.

Example: “internet marketing” ~professional

5. Specific Document Types: If you’re looking to find results that are of a specific type, you can use the modifier “filetype:”. For example, you might want to find only PowerPoint presentations related to internet marketing.

Example: “internet marketing” filetype:ppt

6. This OR That: By default, when you do a search, Google will include all the terms specified in the search. If you are looking for any one of one or more terms to match, then you can use the OR operator. (Note: The OR has to be capitalized).

Example: internet marketing OR advertising

7. Phone Listing: Let’s say someone calls you on your mobile number and you don’t know how it is. If all you have is a phone number, you can look it up on Google using the phonebook feature.

Example: phonebook:617-555-1212 (note: the provided number does not work – you’ll have to use a real number to get any results).

8. Area Code Lookup: If all you need to do is to look-up the area code for a phone number, just enter the 3-digit area code and Google will tell you where it’s from.

Example: 617

9. Numeric Ranges: This is a rarely used, but highly useful tip. Let’s say you want to find results that contain any of a range of numbers. You can do this by using the X..Y modifier (in case this is hard to read, what’s between the X and Y are two periods. This type of search is useful for years (as shown below), prices or anywhere where you want to provide a series of numbers.

Example: president 1940..1950

10. Stock (Ticker Symbol): Just enter a valid ticker symbol as your search term and Google will give you the current financials and a quick thumb-nail chart for the stock.

Example: GOOG

11. Calculator: The next time you need to do a quick calculation, instead of bringing up the Calculator applet, you can just type your expression in to Google.

Example: 48512 * 1.02

12. Conversion: The next time you need to do a quick calculation on the temperature, you can just type your expression in to Google.

Example: 72F in C

The conversion feature works for a whole host of things: "100cm in inches", "100us gallons in uk gallons", "100bar in psi", "100 GBP in USD", etc.

13. Word Definitions: If you need to quickly look up the definition of a word or phrase, simply use the “define:” command.

Example: define:plethora

14. Searching for URLs containing certain words. Use the "inurl:word" modifier.

Example site:i-hack.org inurl:psp