:::: MENU ::::
Browsing posts in: Uncategorized

redis CLI cheat sheet

List all keys
keys *
Delete all keys
List all values of a list
lrange list_key_name 0 -1

show all set members
smembers set_key_name

Install python 2.7 from source in CentOS 6.6

Install necessary packages

yum install zlib-devel bzip2-devel openssl-devel xz xz-libs
yum install wget
yum install gcc gcc-c++

Install python 2.7.9 from source

wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
xz -d Python-2.7.9.tar.xz
tar -xvf Python-2.7.9.tar
cd Python-2.7.9
./configure --prefix=/usr/local
make install

export PATH="/usr/local/bin:$PATH"

Now you have the command python2.7 to run scripts using python 2.7, the default command python is just a symbolic link located at /usr/local/bin/

Now install setuptools

wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-16.0.tar.gz
tar -xvf setuptools-16.0.tar.gz
cd setuptools-16.0
python2.7 setup.py install

Now install pip

wget https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py
python2.7 get-pip.py