Search This Blog

Monday, March 28, 2011

All about Application and Port.

Check below url for finding port number associated with an application.
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

Above listing helps to identify which applications are using which port.

In Linux a command line utility netstat is used widely for identifying port.
a good articles over netstat can be found on below links.
http://www.thegeekstuff.com/2010/03/netstat-command-examples/

Tuesday, March 22, 2011

Apache Server Hardening .

Found Nice article of securing apache server.

Please check all the articles from thegeekstuff they are very useful.

http://www.thegeekstuff.com/2011/03/apache-hardening/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+TheGeekStuff+%28The+Geek+Stuff%29

Please Leave us with your comments and Queries/Suggestions.
I will try to reply asap.

Friday, March 18, 2011

How to Monitor network traffic using TCPDUMP.

There is a very useful utility provided in linux to monitor the network traffic between two hosts.

Example : To monitor network traffic between Machine A and Machine B .
run following command on Machine A.

#tcpdump -npi eth0 host (MACHINEB)HOSTNAME/IP -vvvs0 -w /var/tmp/network_traffic.cap

once the command is executed just use any analysis tool to monitor the logs.

Thursday, March 17, 2011

All about rpm.

RPM (Redhat package Manager).
There have been lot of changes since it was named .So RPM doesnt only relates to redhat distribution of linux .Now most of linux distributions supports RPM package manager.


Topic covered so far

1) RPM Naming convention.
2) How to check list of installed rpm(s).
3) How to list file(s) stored in rpm.


1) RPM Naming convention.

name-version-release.architecture.rpm
for example.

samba-32bit-3.4.2 -1.1.3.1.x8664.rpm

2) How to check list of installed rpm(s).  

run rpm -qa to list all the installed rpm.
-q : Query rpm.
-a : Query all installed packages. 


 3) How to list file(s) stored in rpm. 

use rpm -qpl to find the list of files included in rpm. 
$ rpm -qpl myrpm-1-0.noarch.rpm
/usr/local/bin/myscript.sh
 


 -p, --package PACKAGE_FILE :
              Query  an  (uninstalled) package PACKAGE_FILE.  The PACKAGE_FILE may be specified as an ftp or http style URL, in which case the package header will be downloaded and queried.  See  FTP/HTTP  OPTIONS for information on rpmâs internal ftp and http client support. The PACKAGE_FILE argument(s), if not a binary package, will be interpreted as an ASCII package manifest.  Comments are permitted, starting  with  a  â#â,  and each line of a package manifest file may include white space separated glob expressions, including URLâs with remote glob expressions, that will be expanded to paths that  are substituted in place of the package manifest as additional PACKAGE_FILE arguments to the query.


-l :
              List files in package.

In above example rpm myrpm-1-0.noarch.rpm contains script named /usr/local/bin/myscript.sh

Wednesday, March 16, 2011

Update time of machine specifying ntpserver

Just run following command on the server .

#ntpdate NTPSERVER_HOSTNAME/IP

(Note:You must configure NTPSERVER for the above command to work).

Configure mail Client (Internal Mail Server)

This summary is not available. Please click here to view the post.

Monday, March 14, 2011

How to reduce size of Virtual image (.img) In OVM?

I had created a template of win2k3 machine having size of 80 GB (C drive=30GB,D drive =50GB).

But To cater a request for new VM Machine having size of 1 TB (C drive=30GB, D= 1 TB-30GB)
I had to come up with something .
So i created a machine from template of win2k3(above mentioned one).
Then i deleted d drive partition of 50 GB using Disk management.

Then i shutdown the machine.
Logged in to Server hosting VM guests.

Ran following command
#dd if=/OVS/running_pool/vm_machine_name/System.img of=/OVS/running_pool/vm_machine_name/System1.img bs=1024 count=31457280

Which has reduced the size of System.img to 30 gb.
Modified vm.cfg to include System1.img Instead of System.img.

Started the VM machine.
(Note:It is not advised to do as most of the time you end up getting blue dump for window machines.Not checked on linux machine.)

Linux useful Links

With lot of website claiming to teach you Linux I would like to recommend some of them here .
Each one having unique way describing Linux.

I Love to spend some of my time reading.

http://www.linuxuser.co.uk

My Favorite Linux Forums.

http://www.linuxquestions.org


http://www.unix.com

My Favorite Linux Blog.

http://www.thegeekstuff.com

My Favorite Place for Searching RPMs.

http://search.rpmseek.com

A Must Read Article for Linux Performance Monitor.My personal favorite.

http://www.thegeekstuff.com/2011/03/linux-performance-monitoring-intro/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+TheGeekStuff+%28The+Geek+Stuff%29

Good way to learn linux from scratch

http://www.linuxfromscratch.org/lfs/

Wednesday, March 2, 2011

Fdisk and parted.

Both the commands are used for partitioning the disks ,creating and managing Linux file systems.
choice of command is personal preference.


Note:

Why should you use parted instead of fdisk?
1) Starting from RHEL 6, Redhat recommends use of parted.
2) fdisk doesn’t understand GUID Partition Table (GPT) and it is not designed for large partitions. In particular case use more advanced GNU parted(8).
3) You can't use fdisk for drives greater than 2TB size. you need to use parted utility for that.
source:

http://www.linuxquestions.org/questions/linux-newbie-8/fdisk-v-s-parted-864481/

For all the system administrators fdisk is more common but considering Linux future Admin dudes should learn parted .

Lets learn How the same task can be performed using different fdisk and parted commands.