Skip to content

Instantly share code, notes, and snippets.

@dgershman
Last active December 9, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgershman/4348083 to your computer and use it in GitHub Desktop.
Save dgershman/4348083 to your computer and use it in GitHub Desktop.
added changes for checking for root, since sudo su don't work right
#!/bin/bash
# Danny Gershman
# Cinchcast
FILE="/tmp/out.$$"
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# First upgrade to python 2.7
# Prepping
yum -y groupinstall 'Development Tools'
yum -y install openssl-devel* ncurses-devel* zlib*.x86_64
yum -y install bzip2 bzip2-devel bzip2-libs
# creating bz2 dependency
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xpzf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make -f Makefile-libbz2_so
make
make install PREFIX=/usr/local
cd ..
# Downloading python source
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz --no-check-certificate
tar xfz Python-2.7.6.tgz
# Building python
cd Python-2.7.6
export PATH=/usr/local:$PATH
./configure --prefix=/usr/local
make
make install
# After doing this close out the ssh session and re-open run
python -V # should return 2.7, if not something isn't right
cd ..
# Download nodejs and unzip
yum install openssl-devel
cd /usr/local/src
wget http://nodejs.org/dist/v0.12.1/node-v0.12.1.tar.gz
tar zxvf node-v0.12.1.tar.gz
# Build
cd node-v0.12.1
# check to make sure that /usr/local/bin is in the $PATH environment variable, and it's before /usr/bin
./configure --prefix=/usr/local
make
make install
@dgershman
Copy link
Author

Things to check on:

  • Stuff will run as root so make sure that when you sudo su that /usr/local/bin is in your path. You may need to add to the /root/.bashrc file export PATH=/usr/local/bin:$PATH
  • When you sudo su check to see if node --version returns v0.8.16.
  • ulimit -n should return a value higher than 1024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment