Skip to content

Instantly share code, notes, and snippets.

@arudmin arudmin/rpi.sh
Last active Jun 8, 2019

Embed
What would you like to do?
Raspberry Pi Starting Script
#!/bin/bash
echo "RASPBERRY PI UPDATING SCRIPT STARTED"
# Nginx Repo Add
sudo hostname -v pi
sudo localedef en_US.UTF-8 -i en_US -fUTF-8
sudo echo 'deb http://nginx.org/packages/debian/ wheezy nginx
deb-src http://nginx.org/packages/debian/ wheezy nginx' >> /etc/apt/sources.list
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key && rm nginx_signing.key
sudo aptitude remove -y wolfram-engine
sudo aptitude update -y
sudo aptitude upgrade -y
sudo aptitude dist-upgrade -y
sudo aptitude install -y git npm htop iftop iotop telnet dstat screen runit chkconfig \
gcc g++ make autoconf avahi-utils build-essential chkconfig libao-dev mutt isc-dhcp-server \
libavahi-client-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libjpeg8-dev \
libssl-dev libwww-perl pkg-config matchbox ttf-mscorefonts-installer xwit python-setuptools\
sqlite3 libnss3 ruby make gcc binutils cups libasound2-dev libavahi-client-dev \
libxml2-dev libxslt-dev python-dev python-lxml python-html5lib python-bs4 librsvg2-dev \
python-rsvg heroku fswebcam
sudo easy_install pip
sudo pip install virtualenv
#pil html5lib sh lxml beautifulsoup4 tweepy config xively
## PiJS.io
curl http://pijs.io/install-pijs.sh | bash
##SHAIRPORT
cd
git clone git://github.com/abrasive/shairport.git shairport
cd shairport
sudo ./configure && sudo make && sudo make install
cd ..
sudo mv shairport/ /usr/local/shairport/
#shairport -a 'Speakers'
## KIOSK MODE
# sudo aptitude install -y chromium x11-xserver-utils
# http://blogs.wcode.org/2013/09/howto-boot-your-raspberry-pi-into-a-fullscreen-browser-kiosk/
## RUBY and GEMs
#wget http://rubyforge.org/frs/download.php/76073/rubygems-1.8.24.tgz
#gunzip rubygems-1.8.24.tgz
#tar -xf rubygems-1.8.24.tar
#cd rubygems-1.8.24
#sudo ruby ./setup.rb
#cd ..
#rm -fR rubygems-1.8.24
## VPN
## MANUAL ## http://ablex.ru/2013/04/nastrojjka-vpn-servera-na-raspberry-pi/
## Time Capsule
## Manual ## http://www.zisoft.de/elektronik/raspberrypi/timecapsule.html
# sudo aptitude install -y hfsplus hfsutils hfsprogs avahi-daemon libavahi-client-dev libdb5.3-dev db-util db5.3-util libgcrypt11 libgcrypt11-dev
# wget http://downloads.sourceforge.net/project/netatalk/netatalk/3.1.1/netatalk-3.1.1.tar.bz2
#UUID=`sudo blkid | awk -F "\"" ' /'hfsplus'/ {print $2} '`
#SDA_path=`sudo blkid | awk -F ":" ' /'hfsplus'/ {print $1} '`
#TC_path="/mnt/timecapsule"
#sudo mkdir $TC_path
#sudo mount -o force $SDA_path $TC_path
#echo "sudo nano /etc/fstab"
#sudo su -c 'echo "UUID=\"$UUID\" $TC_path hfsplus rw,force,exec,auto,users 0 3" >> /etc/fstab'
@arudmin

This comment has been minimized.

Copy link
Owner Author

arudmin commented Jun 7, 2014

DO DOKKU Fix
sudo wget -O /etc/init/docker.conf https://raw.github.com/dotcloud/docker/master/contrib/init/upstart/docker.conf
sudo service docker restart

@arudmin

This comment has been minimized.

Copy link
Owner Author

arudmin commented Jun 7, 2014

NAT Fix

sudo iptables -t nat -A PREROUTING -d 192.168.1.143 -p tcp --dport 89 -j DNAT --to-destination 10.0.0.20:80
sudo iptables -t nat -A POSTROUTING -d 10.0.0.20 -p tcp --dport 80 -j SNAT --to-source 192.168.1.143

sudo iptables -t nat -A PREROUTING -d 192.168.1.143 -p tcp --dport 8922 -j DNAT --to-destination 10.0.0.20:22
sudo iptables -t nat -A POSTROUTING -d 10.0.0.20 -p tcp --dport 22 -j SNAT --to-source 192.168.1.143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.