Last active
July 11, 2018 15:52
-
-
Save bixu/1033ed8954fafea48f2f7b3f32faf1fe to your computer and use it in GitHub Desktop.
python & machine learning on bananapi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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