Howto's

 

vi editor tricks and tips
when entering in vi editor....words that are typed are stored automatically in
buffers.


u can type ctrl p or ctrl n at any timr and use the previously typed words.
ctrl p is for revere order and ctrl n is for straight order
 

To show line numbers:
:se nu

Vim has a feature for variable name completion. While typing, simply press
Ctrl-N or Ctrl-P in insert mode

to open multiple windows: vi -o .
To switch b/w windows: ctrl w UP or ctrl w DOWN

to invert case:
go to escape mode and keep pressing INS(insert) button on keyboard

to insert newline or tab in the replace string..go to the
position where u want to insert the newline and
press then press enter or tab.
that's it........
 

Entry Point in C
entryPoint.c :
void myfunc()
{
int a=5;
printf("yo man!!! it works!!!\n");
scanf("%d", &a);
printf("u just entered a=%d\n\n", a);
}


gcc -c entryPoint.c
this will produce entryPoint.o


ld -m elf_i386 --dynamic-linker /lib/ld-linux.so.2 --entry=myfunc entryPoint.o
-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lgcc -lc

this will produce a.out

after running a.out successfully,,u get segfault....who cares!!!
 
To put off the monitor
xset dpms force off

 

Cscope tips
ctlr b and ctrl f :
this can be used to search for the already typed words.

it's just like ctrl r on a command prompt, to search already typed words.


ctrl p and ctrl n can be used to go to next search field in the main cscope
window.
useful in telnet connx, as you have to keep pressing enter to go to next field.

 

To find the current shell
ps -p $$