Tuesday, July 30, 2013

list open ports and unix sockets

To do this I use netstat command

to list all open ports:
$ sudo netstat -tuplen

to list open ports and unix sockets:
$ sudo netstat -nlp

note: using sudo you will get more info

Friday, July 19, 2013

Basic yum commands

Original post by imdeemvp
[http://forums.fedoraforum.org/showthread.php?t=25880]
[small modification by me :)]

To update system. Update of the system with all the dependencies that are necessary:
$ sudo yum update

To make a search:
$ yum search any-package

to get package information:
$ yum info any-package

Installation of packages with dependencies:
$ sudo yum install any-package

Uninstalling packages with dependencies:
$ sudo yum remove any-package

The following thing will list all the packages installed in the system:
$ yum list installed | less

To list using *patterns*
For installed packages in database:
$ yum list installed | grep *patterns*

For all packages in database:
$ yum list | grep *patterns*

The following thing will list all the packages installed in the system and that can (they must) be updated:
$ yum list updates | less

Clean yum catch and temp files to free disk space:
$ sudo yum clean all

Group install
Code:
$ sudo yum groupinstall "groupname"
{Don't forget the quotation marks for group install.}

Compile Python2.7 on CentOS 6

[ These steps may work on CentOS 5.*  too]

Prepare your OS for it

$ sudo yum groupinstall "Development tools"

$ sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel

Now Download python 2.7 at any location [say make a directory name py in your home directory]
$ wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
Unzip it:
$ tar xf Python-2.7.5.tar.bz2
Change directory:
$ cd Python-2.7.5
inside Python-2.7.5 directory run these command one by one:
$ ./configure --prefix=/usr/local
$ make

***
when make command finishes at the end you will see something like this:
----------
Python build finished, but the necessary bits to build these modules were not found:
bsddb185           dl           imageop
sunaudiodev                      
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
----------
NOTE: sunaudiodev is for Sun platforms,dl for 32bit platforms, imageop is deprecated and bsddb185 is undocumented.
***

$ sudo make altinstall

** you must use [make altinstall] otherwise you will corrupt the system
(CentOS comes with python 2.6 and yum is dependent on it if you use [make install] it will replace python 2.6 and yum may not work)

to test your installation run this command:
$ python2.7

list open ports and unix sockets

To do this I use netstat command to list all open ports: $ sudo netstat -tuplen to list open ports and unix sockets: $ sudo netstat -...