Skip to content

Instantly share code, notes, and snippets.

@leoh0
Created May 9, 2016 17:04
Show Gist options
  • Select an option

  • Save leoh0/21d61d3bebe394d278e6f18d5465415d to your computer and use it in GitHub Desktop.

Select an option

Save leoh0/21d61d3bebe394d278e6f18d5465415d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo apt-get install -qqy git make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev libxml2-dev libxslt1-dev libffi-dev
curl -sL https://raw.github.com/yyuu/pyenv-installer/master/bin/pyenv-installer | \
bash
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
echo 'export PATH="~/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4" ~/.pyenv/bin/pyenv install 2.7.9
~/.pyenv/bin/pyenv global 2.7.9
cat << OPENRC_CHOOSER > ~/.pyenv/pyenv.d/exec/openstack.bash
openstack_root=\$(pwd -P 2>/dev/null || command pwd)
while [ ! -e "\$openstack_root/openrc" ];
do
openstack_root=\${openstack_root%/*}
if [ "\$openstack_root" == "" ]; then
break
fi
done
if [ "\$openstack_root" != "" ]; then
while read var; do unset "\$var"; done< <(env | awk -F= '/^OS_/{print \$1}')
. "\$openstack_root/openrc"
fi
OPENRC_CHOOSER
echo 'need relogin'
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment