Saturday, November 29, 2008

Useful Unix Commands..

1. Trim space and replace it with add new line?
cat file |  tr -s ' ' '\n' ..redirect output into a file
2. Opening remote file through Vim
 vim scp://root@74.125.45.100//root/harendra_file.txt
3. Printer command to print
 lpr -Pprintername file 
 lp -dprintername file
4. Write a command to kill the last background job?
 kill $!
5. Write a command to print success/failure of last executed command?
 echo $?
6. To mount disk
 mount /dev/sda5 /data/
 mount /dev/sda1 /mnt/winxp/
7. Putting an entry in crontab
crontab -e
* * * * * /sbin/ifconfig eth0 arp
* * * * * /sbin/ifconfig eth1 arp
8. adding welcome message when ssh 
 /etc/motd
9. To set date on system
date monthdayhourminutyear
date 010100302000
 or
============================
date - Would list the date and time of the server. Below is an example of the output.

Thu Feb 8 16:47:32 MST 2001
date -s "11/20/2003 12:48:00" - Set the date to the date and time shown.

date '+DATE: %m/%d/%y%nTIME:%H:%M:%S' - Would list the time and date in the below format:

    DATE: 02/08/01
    TIME:16:44:55
=============================
10. extracting/list/zip a file file1 from tgz File.tgz
 tar -xz file1 -f File.tgz
 tar -tzvf File.tgz
 tar -czvf File.tgz
 tar -xzvf File.tgz
11. Allowing all incoming packets
iptables -I INPUT -j ACCEPT
12. Printing.. required librabies for an executable 
ldd ./sipp_tls
13. Printing disk uses
du -chS
14. alsamixer volume controller for linux
alsamixer //volume controller
15. Adding route manually
route add -net 172.16.26.0/24 gw 192.168.0.101
16. pearl command to replace a string in a file
perl -pi -e 's/svk//' `find . -name Root`
perl -pi -e 's/svk@bilbo:2/harendra@172.16.45.102:9/' `find . -name Root`
17. write a message for users connected with different terminals.
wall and ctrl-d
18.  command to kill a process by a signal. 
pkill -USR1 -x tgist
19. tethereal command 
tethereal -i any -R "sip||h225||h245||q931" -S -w file.cap -b file:5 -a filesize:500
20. To print interface details using snmp walk.
snmpbulkwalk -r 1 -Oe -Ot -v 2c -c public localhost ifTable
21. Running valgrind command for memcheck.
valgrind --tool=memcheck --leak-check=full --leak-resolution=high --show-reachable=yes --num-callers=20 --log-file-exactly=/var/log/valg.log --error-limit=no -v ./tgist
22. On fedora Linux starting a service at startup time, list the services
    #chkconfig --add servicename
    #chkconfig --level 2345 servicename [on|off|]
   #chkconfig --list
23. Redirecting output, error to a file on fedora linux
   command &> filename
  command > filename 2 > &1



Friday, June 27, 2008

Firm In Trouble? Give charge to woman.

It's been long time, I created this account I really don't know why?? Probably I was thinking to write something at that point of time I could not make it. This is simply because writing a blog is not a child's play... Look at the guts of mine I at least tried it today. Even I have copied it from some where but it's alright.

Women are being 'setup to fail' because when they get top jobs, it is with a firm in trouble, research says. Companies with falling share prices and collapsing profits are desperate to hire a woman as boss rather a man. This is because women are generally firefighters and good in crisis. The researchers also admit that women are offered top jobs generally with falling companies. This is because such companies struggle to find a man to accept the post. Because females find it difficult to land very senior jobs they generally accept less attractive positions. The chartered Institute of personnel and development, which interviewed the women in power and dubbed the problem 'the glass cliff'. They say that even if women break the glass ceiling the leadership position they land at firm in crisis are relatively risky and precarious. By accepting such positions they are more likely to face possible career suicide by falling off the cliff if they fail to rescue the firm.