Thursday, July 24, 2014

Using pip to install python packages

Pointer 1: To install specific version of packages do
# pip install 'numpy==1.5.1'
Pointer 2: To show what files was installed
# pip show --files numpy
---
Name: numpy
Version: 1.8.1
Location: /usr/local/python-2.7.8/lib/python2.7/site-packages
Requires:
Files:
../numpy/__init__.py
.....
.....
Pointer 3: Uninstall a package
# pip uninstall num
Uninstalling SomePackage:
Pointer 4: Upgrade a package:
# pip install --upgrade SomePackage
[...]
Found existing installation: SomePackage 1.0
Uninstalling SomePackage:
Successfully uninstalled SomePackage
Running setup.py install for SomePackage
Successfully installed SomePackage
Pointer 5: List what packages are outdated:
# pip list --outdated
SomePackage (Current: 1.0 Latest: 2.0)
References:
  1. pip 1.5.6 - A tool for installing and managing Python packages
  2. pip - installation

Wednesday, July 23, 2014

Installing and Compiling Python 2.7.8 on CentOS 5

Step 1: Download the Python 2.7.8 from Python Site Step 2: Use GCC44 to compile. If you have not done it, do
# yum install gcc44 gcc44-c++ gcc44-gfortran
Step 3: Update your alias in your .bashrc
alias gcc='gcc44'
Step 4: Configure python 2.7.8
# cd python-2.7.8
# ./configure --prefix=/usr/local/python-2.7.8
# make -j 8
# make install
Step 5: Update the PATH and LD_LIBRARY_PATH in your .bashrc
export PATH=$PATH:/usr/local/python-2.7.8/bin.........
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python-2.7.8/lib
Step 6: Download get-pip.py For more information see pip installation site Create a directory inside python2.7 directory and put pip in that directory
# mkdir /usr/local/python-2.7.8/pip
# wget https://bootstrap.pypa.io/get-pip.py .
Step 7: Install pip with Administrator rights
# python2.7 get-pip.py
If setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you. To upgrade an existing setuptools (or distribute), run
# pip install -U setuptools
# pip install numpy

Tuesday, July 22, 2014

Finding Performance bottlenecks in your application




This is an interesting blog How to find performance bottlenecks in your application by using gperftools and KCachegrind to profile performance bottlenecks.

Do take a look and happy reading.

Monday, July 21, 2014

Encountering the pars.yacc:5426 error when installing Grace 5.1.23 on CentOS 5

I encountered Encountering the pars.yacc:5426: error: âlog2â undeclared here (not in a function) when installing Grace-5.1.23 on CentOS 5 when Installing Grace (xmgrace) on CentOS 5 and 6

I used gcc44 as the gcc compilers.
pars.yacc:5426: error: âlog2â undeclared here (not in a function)
make[1]: *** [pars.o] Error 1
make[1]: Leaving directory `/root/Downloads/grace-5.1.23/src'
make: *** [subdirs] Error 1

The only solution is to use Grace 5.1.22. It will compile nicely. 

Sunday, July 20, 2014

Checking loaded apache modules



To check loaded apache modules, you can take a look at
#  apachectl -M
OR
# apache2ctl -M


core_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
auth_basic_module (shared)
auth_digest_module (share)
.....
.....
.....

.....
reqtimeout_module (shared)
php5_module (shared)