Skip to content

Instantly share code, notes, and snippets.

@bixu
Last active July 11, 2018 15:52
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 bixu/1033ed8954fafea48f2f7b3f32faf1fe to your computer and use it in GitHub Desktop.
Save bixu/1033ed8954fafea48f2f7b3f32faf1fe to your computer and use it in GitHub Desktop.
python & machine learning on bananapi
#!/bin/bash
# execute this script directly by piping to your shell from `curl` like this:
# curl --silent https://gist.githubusercontent.com/bixu/1033ed8954fafea48f2f7b3f32faf1fe/raw/banana-strap.sh | sudo bash
set -e
echo "Setting up $(hostname)..."
apt-get update
apt-get install --assume-yes \
avahi-daemon \
avahi-discover \
avahi-utils \
ccache \
htop \
libnss-mdns \
mdns-scan
echo ""
echo "Multicast DNS has been set up for this device. You can connect by doing"
echo " ssh $(hostname).local. -l $USER"
echo "from a terminal on this network."
echo ""
curl --silent -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
if ! grep "pyenv virtualenv-init" $HOME/.bash_profile > /dev/null
then
echo 'export PATH="/home/pi/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"' | tee >> $HOME/.bash_profile
fi
source $HOME/.bash_profile
pyenv update
if [ ! -e $HOME/.pyenv/plugins/pyenv-ccache ]
then
git clone https://github.com/yyuu/pyenv-ccache.git $(pyenv root)/plugins/pyenv-ccache
fi
for python in "2.7.15" "3.5.5" "3.6.3"
do
if [ ! -e $HOME/.pyenv/versions/"$python" ]
then
wget https://smartb-downloads.s3.amazonaws.com/python/arm64/"$python".zip
unzip "$python".zip -d .pyenv/versions/
else
pyenv install --skip-existing "$python"
fi
done
echo ""
echo "Python versions available:"
pyenv versions
echo ""
echo "Run"
echo " pyenv global/local <version>"
echo "to set the Python version you want."
echo ""
echo "...setup of $(hostname) complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment