Monday, February 11, 2013

Installing Python 2.7, Pip, Fabric on RedHat 5.6

RedHat 5.6 comes with Python 2.4, Fabric requires Python 2.5+

Test Box Setup: 

vagrant box add centos5.6 http://dl.dropbox.com/u/15307300/vagrant-0.7-centos-64-base.box
vagrant init centos5.6
vagrant up

Install ActiveState Python 2.7
wget http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz
tar zxvf ActivePython-2.7.2.5-linux-x86_64.tar.gz 

rm ActivePython-2.7.2.5-linux-x86_64.tar.gz 
cd ActivePython-2.7.2.5-linux-x86_64/
./install.sh 

Install Fabric in a virtualenv
cd ~
mkdir venvs
cd venvs
curl -kO https://raw.github.com/pypa/virtualenv/master/virtualenv.py
python virtualenv.py fab-env
vi ~/.bashrc
After "export PATH=/home/jenkins/ActivePython-2.7/bin:$PATH" insert:
if [ -f ~/venvs/fab-env/bin/activate ]; then
    source ~/venvs/fab-env/bin/activate
fi
fab




Other Failed Attempt:

EPEL

Install Python 2.6

Install EPEL:
wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
sudo rpm -Uvp epel-release-5-4.noarch.rpm

Fix yum repo:
sudo vi /etc/yum.repos.d/elff.repo
search for:
baseurl=http://download.elff.bravenet.com/5/$basearch
replace with:
baseurl=http://rbel.frameos.org/stable/el5/$basearch

sudo yum --nogpgcheck install -y python26
sudo yum install -y gcc make python26-devel
mkdir ~/venvs
cd venvs
curl -kO https://raw.github.com/pypa/virtualenv/master/virtualenv.py
python2.6 virtualenv.py fab
source fab/bin/activate
pip install fabric
echo "source venvs/fab/bin/activate" >> ~/.bashrc

This approach worked fine in Centos but not RedHat...
Problem with this approach:
"pip install fabric" requires a newer version of Python (Python 2.4 currently installed in RedHat 5.6):  ".. if .. else .." syntax does not work


~ $ pip install fabric
Downloading/unpacking fabric
  Downloading Fabric-1.5.3.tar.gz (241Kb): 241Kb downloaded
  Running setup.py egg_info for package fabric
    Traceback (most recent call last):
      File "<string>", line 14, in ?
      File "/home/jenkins/build/fabric/setup.py", line 7, in ?
        from fabric.version import get_version
      File "fabric/version.py", line 57
        sha1 = (" (%s)" % sha) if sha else ""
                                ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in ?

  File "/home/jenkins/build/fabric/setup.py", line 7, in ?

    from fabric.version import get_version

  File "fabric/version.py", line 57

    sha1 = (" (%s)" % sha) if sha else ""
                            ^
SyntaxError: invalid syntax




Refs:









[vagrant@vagrant-centos-64 ~]$ python
Python 2.4.3 (#1, Nov 11 2010, 13:30:19)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>




[vagrant@vagrant-centos-64 ~]$ sudo yum install python26
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirror.aarnet.edu.au
 * base: mirror.aarnet.edu.au
 * epel: mirror.overthewire.com.au
 * extras: mirror.aarnet.edu.au
 * updates: mirror.aarnet.edu.au
http://download.elff.bravenet.com/5/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: elff. Please verify its path and try again



[vagrant@vagrant-centos-64 venvs]$ python2.6 virtualenv.py fab
New python executable in fab/bin/python2.6
Also creating executable in fab/bin/python
Installing setuptools............................done.
Installing pip.....................done.


Friday, February 1, 2013

Cool data visualisation tools or sites


http://www.netmagazine.com/features/top-20-data-visualisation-tools

http://www.hongkiat.com/blog/data-visualization-tools-resources/

http://www.taggalaxy.de/
http://www.wikimindmap.org/