Monday, October 29, 2012

Installing iostat and its uses

iostat

The iostat utility is installed with yum via the sysstat package as shown below.

#yum install sysstat

The iostat command in is used to monitor the system I/O device.

Command
# iostat [interval [count] ]


The iostat command will generates two reports, one for CPU  and one for device. Using -c option will genertate CPU report and -d option will generate device report.


View only CPU report.
iostat –c

View only device report
iostat -d


Runnig iostat every 5 seconds for 10 times
iostat 5 10   

Wednesday, September 12, 2012

Check Memory/RAM Usage

There are a few tools built-in for gauging and fine-tuning your server's RAM (memory) usage.

free command

# free -m



vmstat command
# vmstat



top command
# top



ps command
# ps aux

Iptables

Iptables is a program that allows you to configure Linux's built-in firewall. By default, no rules are set, meaning the firewall will accept all connections. This guide covers the basics of working with iptables.

An IPTables based firewall is made of three different basic “objects”.
Rules
Chains
Tables

Rules:
The lowest level objects are the “rules” that are performing the packetfiltering or manipulation.

Chains:
Those rules are organized in “chains” which are simple ordered list of rules. There are some built-in chains that are always available for the user like the INPUT or the OUTPUT chain in the filter table.

Tables:
Because of the lots of possibilities that IPTables rules give you to filter and/or mainpulate the packets that are checked the chains themselves are organized in so called “tables”. Each table has it's own set of built-in chains that are available for direct use.


To list all current iptables rules:
# iptables -L

To flush/clear all current firewall rules:
# iptables -F

To stop/disable iptables temporarily:
# service iptables save
# service iptables stop

To restart the iptables service:
# service iptables restart
or
# /etc/rc.d/init.d/iptables restart


Blocking a Single IP Address
Eg:192.20.10.10

/sbin/iptables -I INPUT -s 192.20.10.10 -j DROP


Allowing All Traffic from an IP Address
/sbin/iptables -A INPUT -s 192.20.10.10 -j ACCEPT

Blocking a Port From All Addresses
/sbin/iptables -A INPUT -p tcp --dport 3306 -j DROP

Allowing a Single Port from a Single IP
/sbin/iptables -A INPUT -p tcp -s 192.20.10.10 --dport 3306 -j ACCEPT

Saturday, September 1, 2012

Google Chrome install in Linux


To install Google Chrome I have used following steps

1. Downloaded the rpm file from the Google chrome website https://www.google.com/intl/en/chrome/browser/

2. Logged in as root in terminal and then navigated to the downloaded rpm file
google-chrome-stable_current_i386.rpm

3. Used following command for installation
rpm -ivh google-chrome-stable_current_i386.rpm

But got following error
Error: Package: google-chrome-stable-21.0.1180.89-154005.i386 (/google-chrome-stable_current_i386)
           Requires: lsb >= 4.0

4. Therefore I downloaded following packages from the website http://www.rpmfind.net/linux/rpm2html/search.php
lsb
lsb-core

5. I then installed those two packages
rpm -ivh lsb-core-4.0-mgc25.i686.rpm
rpm -ivh lsb-4.0-mgc25.i686.rpm

6. Finally i installed the Chrome browser
rpm -ivh google-chrome-stable_current_i386.rpm





Installing Abobe Flash for Firefox


Download the tar.gz flash file from Adobe website http://get.adobe.com/flashplayer/

Using the terminal navigate to the downloaded file (install_flash_player_10_linux.tar.gz)

Extract the file using the command
tar -zxvf install_flash_player_10_linux.tar.gz

Following file will be extracted
libflashplayer.so

Login as root
Copy the file 'libflashplayer.so' into the folder '/usr/lib/mozilla/plugins'

cp libflashplayer.so /usr/lib/mozilla/plugins

Now the flash videos will be played in the browser

Repair Corrupt Zip file

If you have corrupted zip file but still you wish to extract the contents 
then use 
the following command

Command:
zip -FF old.zip --out new.zip 
 
Here old.zip is the corrupted file which is now converted to a proper 
file new.zip.

Next you can extract the new.zip file using the command
unzip new.zip
Powered By Blogger

Followers