Important Linux Monitoring Command

1) netstat -rn
2 )netstat -plan | grep :80 | awk ‘{print $5}’ | cut -d: -f 1 | sort | uniq -c | sort -n
3) netstat -plan | grep :25 | awk ‘{print $5}’ | cut -d: -f 1 | sort | uniq -c | sort -n
4) pstree -paul
5) cd /tmp
6) rm -f dos-* sess_* .spamassassin*
7) find . -user nobody -exec rm -f ‘{}’ \;
8) ps -C exim -fH ewww
9) ps -C exim -fH eww |grep home
10) netstat -ntu | grep ‘:’ | awk ‘{print $5}’ | awk ‘{sub(“::ffff:”,””);print}’ | cut -f1 -d ‘:’ | sort | uniq -c | sort -n
11) mysqladmin proc |grep Sleep |awk {‘print $4′}|cut -d_ -f 1|sort|uniq -c|sort -nk 1
12) ps -C exim -fH ewww
13) for i in `ipcs -s | awk ‘{print $2}’`; do (ipcrm -s $i); done
14) for i in `mysqladmin proc |grep Sleep |cut -d ” ” -f 2`; do mysqladmin kill $i; done
15) exim -bp |grep “*** frozen ***” |awk ‘{print $3}’ |xargs exim -Mrm
16) exiqgrep -z -i | xargs exim -Mrm;exiqgrep -o 432000 -i | xargs exim -Mrm

Difference Between GZIP and TAR

In Short:
1. Gzip is a compression tool used to reduce the size of a file
2. Tar is an archiver used to to combine multiple files into one
3. Gzip and Tar are usually used in tandem to create Tarballs that are compressed significantly
4. Extracting an individual file can take a lot longer with zipped tarballs than with other formats

Brief:-

GZIP vs TAR
The .tar.gz extension is a very popular one when downloading files especially in non Windows operating systems. But unlike most extensions, this is not meant to identify a single program that would be used to open this file; it points to two. Tar is a file format but is also the name of the program that produces the file. Tar is an archiver, meaning it would archive multiple files into a single file but without compression. Gzip which handles the .gz extension is the compression tool that is used to reduce the disk space used by the file.

Most Windows users are used to having a single program compress and archive the files. Some of the programs that do this are Winrar, 7zip, and Winzip. But this is not the case in the UNIX and Linux environments where archiving and compressing are two different operations altogether. Tarball is the name used to identify any collection of files that have been archived into a single file by the Tar application whether it is compressed or not. Although Gzip is the most common compression tool that is used with tarballs, it is not the only one. There is also another compression tool called Bzip2 that could compress the file further but would take a lot longer.

There are advantages and disadvantages in creating a zipped tarball compared to the standard applications that does both. A zipped tarball could have dramatically reduced filesize the compression tool is not compressing the files individually but treating the whole tarball as one big file. This is even more apparent when dealing with semi compressed files like GIF and JPG files.

The disadvantage of using this format is that you would be unable to extract a single file. Since the entire archive is compressed as a whole, you would also need to uncompress the whole archive before extracting a single file. Extracting a single file from a large zipped tarball could take significantly longer compared to extracting a single file from the same files compressed and archived by a different tool like Winrar or Winzip.

Kickstart Installation in Linux

Many system administrators would prefer to use an automated installation method to install Red Hat Enterprise Linux on their machines. To answer this need, Red Hat created the kickstart installation method. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical installation.
Kickstart files can be kept on a single server system and read by individual computers during the installation. This installation method can support the use of a single kickstart file to install Red Hat Enterprise Linux on multiple machines, making it ideal for network and system administrators.
Kickstart provides a way for users to automate a Red Hat Enterprise Linux installation.

To begin a kickstart installation, you must boot the system from boot media you have made or the Red Hat Enterprise Linux CD-ROM #1, and enter a special boot command at the boot prompt. The installation program looks for a kickstart file if the ks command line argument is passed to the kernel.

CD-ROM #1 and Diskette
The linux ks=floppy command also works if the ks.cfg file is located on a vfat or ext2 file system on a diskette and you boot from the Red Hat Enterprise Linux CD-ROM #1.

An alternate boot command is to boot off the Red Hat Enterprise Linux CD-ROM #1 and have the kickstart file on a vfat or ext2 file system on a diskette. To do so, enter the following command at the boot: prompt:

linux ks=hd:fd0:/ks.cfg
With Driver Disk
If you need to use a driver disk with kickstart, specify the dd option as well. For example, to boot off a boot diskette and use a driver disk, enter the following command at the boot: prompt:

linux ks=floppy dd
Boot CD-ROM
If the kickstart file is on a boot CD-ROM as described in Section 1.8.1 Creating Kickstart Boot Media, insert the CD-ROM into the system, boot the system, and enter the following command at the boot: prompt

Other options to start a kickstart installation are as follows:

ks=nfs::/ The installation program looks for the kickstart file on the NFS server , as file . The installation program uses DHCP to configure the Ethernet card. For example, if your NFS server is server.example.com and the kickstart file is in the NFS share /mydir/ks.cfg, the correct boot command would be ks=nfs:server.example.com:/mydir/ks.cfg.

ks=http:/// The installation program looks for the kickstart file on the HTTP server , as file . The installation program uses DHCP to configure the Ethernet card. For example, if your HTTP server is server.example.com and the kickstart file is in the HTTP directory /mydir/ks.cfg, the correct boot command would be ks=http://server.example.com/mydir/ks.cfg.

ks=floppy
The installation program looks for the file ks.cfg on a vfat or ext2 file system on the diskette in /dev/fd0.

ks=floppy:/ The installation program looks for the kickstart file on the diskette in /dev/fd0, as file .

ks=hd::/
The installation program mounts the file system on (which must be vfat or ext2), and look for the kickstart configuration file as in that file system (for example, ks=hd:sda3:/mydir/ks.cfg).

ks=file:/
The installation program tries to read the file from the file system; no mounts are done. This is normally used if the kickstart file is already on the initrd image.

ks=cdrom:/ The installation program looks for the kickstart file on CD-ROM, as file .

ks
If ks is used alone, the installation program configures the Ethernet card to use DHCP. The kickstart file is read from the “bootServer” from the DHCP response as if it is an NFS server sharing the kickstart file. By default, the bootServer is the same as the DHCP server. The name of the kickstart file is one of the following:

If DHCP is specified and the boot file begins with a /, the boot file provided by DHCP is looked for on the NFS server.

If DHCP is specified and the boot file begins with something other then a /, the boot file provided by DHCP is looked for in the /kickstart directory on the NFS server.

If DHCP did not specify a boot file, then the installation program tries to read the file /kickstart/1.2.3.4-kickstart, where 1.2.3.4 is the numeric IP address of the machine being installed.

ksdevice=
The installation program uses this network device to connect to the network. For example, to start a kickstart installation with the kickstart file on an NFS server that is connected to the system through the eth1 device, use the command ks=nfs::/ ksdevice=eth1 at the boot: prompt.

How to Install TeamViewer on CentOS

How to Install TeamViewer on CentOS

Steps to Install Team Viewer 5 (all version) on Linux ( Fedora, RHEL, CentOS) Red Hat Enterprise Linux.

1) Download Team Viewer 5. Execute Following Command on Linux Terminal.

wget -c http://www.teamviewer.com/download/teamviewer_linux.rpm

Or You can also click on above link to Download using your Browser.

2) Now It’s Time to Install Team Viewer 5 on Linux. Execute Following Command as root.

rpm -ivh teamviewer_linux.rpm

3) Once Team Viewer Get Installed. Make sure you are switch to Normal User. Because New Team Viewer cannot be run as root.

From GUI :- Click on Applications -> Internet -> TeamViewer