Skip to main content

Install/Update to Python 2.7 and latest Pip on AWS EC2 Linux:

 


# install build tools 
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y 

# install python 2.7 and change default python symlink 
sudo yum install python27-devel -y 
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python 

# yum still needs 2.6, so write it in and backup script 
sudo cp /usr/bin/yum /usr/bin/_yum_before_27 
sudo sed -i s/python/python2.6/g /usr/bin/yum 
sudo sed -i s/python2.6/python2.6/g /usr/bin/yum 

# should display now 2.7.5 or later: 
python -V 

# now install pip for 2.7 
sudo curl -o /tmp/ez_setup.py
https://sources.rhodecode.com/setuptools/raw/bootstrap/ez_setup.py 


sudo /usr/bin/python27 /tmp/ez_setup.py 
sudo /usr/bin/easy_install-2.7 pip 
sudo pip install virtualenv

# should display current versions:
pip -V && virtualenv --version



Install/Update to Python 2.7 on CentOS 6.5:

$ python --version

Python 2.6.6

$

$ sudo yum groupinstall "Development tools"

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

$ cd /opt

$ sudo wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz

$ sudo tar xf Python-2.7.6.tar.xz 

$ cd Python-2.7.6

$ sudo ./configure --prefix=/usr/local

$ sudo make && sudo make altinstall

 NOTE: It is important to use ‘altinstall’ otherwise you will end up with two different versions of Python on your filesystem, both named ‘python’.

You can verify the install like so

$ ls -la /usr/local/bin/python2.7*

-rwxr-xr-x 1 root root 6214493 Apr 30 15:14 /usr/local/bin/python2.7

-rwxr-xr-x 1 root root    1674 Apr 30 15:14 /usr/local/bin/python2.7-config

$ /usr/local/bin/python2.7 --version

Python 2.7.6

$

# change default python symlink

$ sudo rm /usr/bin/python

$ sudo ln -s /usr/local/bin/python2.7 /usr/bin/python

$

$ python --version
Python 2.7.6


Install psycopg2 on AWS EC2 Linux:

sudo yum install gcc python-setuptools python-devel postgresql-devel 
sudo pip install psycopg2


Install AWS CLI on new AWS EC2 Linux:

<Ref: http://aws.amazon.com/cli/>

Requires Python 2.6.5 or higher.

# run following commands on command prompt under home directory

pip install awscli

aws configure

-----

AWS Access Key ID [None]: <enter your access key>

AWS Secret Access Key [None]:<enter your secret key>

Default region name [None]: <optional default AWS region>

Default output format [None]: <optional output format, if you don't know just hit "enter/return">

-----

Above steps would create .aws hidden folder under home directory.

You can change keys anytime via either of following:

  1. run aws configure command again under home directly 
  2. editing .aws/config file. You con maintain multiple profile with different keys as well

Check your AWS CLI are woking by issue following command under your home directory:

aws s3 ls

Above command should list all the S3 buckets of your AWS account. 

Install Git on new AWS EC2 Linux:

sudo yum install git

Install tmux on new AWS EC2 Linux:

sudo yum install libevent-devel

method1:

sudo yum install tmux

method2:

wget http://downloads.sourceforge.net/tmux/tmux-1.8.tar.gz

tar zxf tmux-1.8.tar.gz

cd tmux-1.8

sudo make clean

sudo ./configure

sudo make

sudo ./tmux -V

sudo make install




Comments

Popular posts from this blog

HP SMART ARRAY CLI COMMANDS

Show configuration : /opt/hp/hpssacli/bin/hpssacli ctrl all show config Controller status /opt/hp/hpssacli/bin/hpssacli ctrl all show status Show detailed controller information for all controllers /opt/hp/hpssacli/bin/hpssacli ctrl all show detail Show detailed controller information for controller in slot 0 /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 show detail Rescan for New Devices /opt/hp/hpssacli/bin/hpssacli rescan Physical disk status /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show status Show detailed physical disk information /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 pd all show detail Logical disk status /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld all show status View Detailed Logical Drive Status /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 ld 2 show Create New RAID 0 Logical Drive /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld drives=1I:1:2 raid=0 Create New RAID 1 Logical Drive /opt/hp/hpssacli/bin/hpssacli ctrl slot=0 create type=ld dri...

Monthly Mksys OS backup AIX

Step-1 Estimate Backup: ================================================================= df -tk `lsvgfs rootvg` | awk ‘{total+=$3}\ END {printf “Estimated mksysb size: %d bytes, %.2f GB\n”, total*1024, total/1024/1024}’ It will give you the estimated time of backup, Step-2 Backup Command: backupios -file /home/padmin/28August2013_TESTVIOI_mksysb ===============> VIO Backup Command mksysb -e -i -X /mksysb/10Nov2013_server-1_mksysb============================>AIX server Backup command Step-3 ================= Pre -checks: => check NFS FS size(Backup file) and root vg FS sizes . Note : if any FS Full Zip old logs => To check performance of the server => To check root VG FS => To check /etc/exclude ========================== Step-4 ================================ server-1 mksysb -e -i -X /mksysb/02March2014_server-1_mksysb server-2 mksysb -e -i -X /mksysb/02March2014_sever-2_mksysb Post checkups: ==> check the process running o...

HP proliant SERVER hardware commands

to check the failed disk, adapter, any physical component on hp prolient server use the below important command. # hpacucli controller all show config———-to See the failed disk in HP proliant server  Smart Array P410i in Slot 0 (Embedded) (sn: 500143802590F6C0) logicaldrive 1 (558.9 GB, RAID 1, Interim Recovery Mode) array A (SAS, Unused Space: 0 MB) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 600 GB, OK) physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 600 GB, Failed)====>indicating the faild drive SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: 500143802590F6CF) [root@TEST:/root]# hpacucli ctrl slot=0 show Smart Array P410i in Slot 0 (Embedded) Bus Interface: PCI Slot: 0 Serial Number: 500143802590F6C0 Cache Serial Number: PBCDH0CRH1Z6R3 RAID 6 (ADG) Status: Disabled Controller Status: OK Hardware Revision: C Firmware Version: 6.60 Rebuild Priority: Medium Expand Priority: Medium Surface Scan Delay: 3 secs Surface Scan Mode: Idle Queue Depth: Autom...