Skip to content

Instantly share code, notes, and snippets.

@explodecomputer
Created August 2, 2016 12:19
Show Gist options
  • Save explodecomputer/b4e8275f56b8c76872807060b5cb82ee to your computer and use it in GitHub Desktop.
Save explodecomputer/b4e8275f56b8c76872807060b5cb82ee to your computer and use it in GitHub Desktop.
setting up pi
# Setup bash profile
mkdir repo
cd repo
git clone [email protected]:explodecomputer/bashInit.git
cd bashInit
./init.sh
# Mount hard drive
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install exfat-fuse exfat-utils -y
sudo mkdir /mnt/usbstorage
sudo chown -R pi:pi /mnt/usbstorage
sudo chmod -R 775 /mnt/usbstorage
sudo setfacl -Rdm g:pi:rwx /mnt/usbstorage
sudo setfacl -Rm g:pi:rwx /mnt/usbstorage
sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/usbstorage
echo "UUID=552E-64DE /mnt/usbstorage exfat nofail,uid=pi,gid=pi 0 0" | sudo tee -a /etc/fstab
sudo mount -a
sudo reboot
# Setup explodecomputer.com
sudo apt-get install apache2 php5 libapache2-mod-php5 -y
sudo apt-get install mysql-server php5-mysql -y
cd ${HOME}/repo
git clone [email protected]:root/explodecomputer-com.git
cd explodecomputer-com
wget https://www.dropbox.com/s/lknzahljfqo2q44/explodecomputer.sql?dl=1
mv explodecomputer.sql?dl=1 explodecomputer.sql
echo "DROP DATABASE IF EXISTS explodecomputer; CREATE DATABASE explodecomputer; GRANT ALL PRIVILEGES ON explodecomputer.* To 'gib'@'localhost' IDENTIFIED BY 'Odeadfsws123qwe';" | mysql -u root -p
mysql -u root -p explodecomputer < explodecomputer.sql
rm explodecomputer.sql
sudo mkdir -p /var/www/explodecomputer.com/public_html
sudo cp -r * /var/www/explodecomputer.com/public_html
sudo rm -f /etc/apache2/sites-available/explodecomputer.com.conf
sudo touch /etc/apache2/sites-available/explodecomputer.com.conf
echo "<VirtualHost *:80>" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo " ServerAdmin [email protected]" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo " ServerName explodecomputer.com" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo " ServerAlias www.explodecomputer.com" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo " DocumentRoot /var/www/explodecomputer.com/public_html" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo " ErrorLog ${APACHE_LOG_DIR}/error.log" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo " CustomLog ${APACHE_LOG_DIR}/access.log combined" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
echo "</VirtualHost>" | sudo tee -a /etc/apache2/sites-available/explodecomputer.com.conf
sudo sed -i 's@short_open_tag = Off@short_open_tag = On@g' /etc/php5/apache2/php.ini
sudo a2ensite explodecomputer.com.conf
sudo service apache2 restart
# Setup gibandjo.com
sudo rm -f /etc/apache2/sites-available/gibandjo.com.conf
sudo touch /etc/apache2/sites-available/gibandjo.com.conf
echo "<VirtualHost *:80>" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo " ServerAdmin [email protected]" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo " ServerName gibandjo.com" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo " ServerAlias www.gibandjo.com" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo " DocumentRoot /var/www/gibandjo.com/public_html" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo " ErrorLog ${APACHE_LOG_DIR}/error.log" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo " CustomLog ${APACHE_LOG_DIR}/access.log combined" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
echo "</VirtualHost>" | sudo tee -a /etc/apache2/sites-available/gibandjo.com.conf
sudo mkdir -p /var/www/gibandjo.com/public_html
sudo a2ensite gibandjo.com.conf
sudo service apache2 restart
sudo mkdir /root/.ssh
sudo cp ${HOME}/repo/bashInit/wrayvisscher.pub /root/.ssh/authorized_keys
# Setup gitlab
cd ${HOME}/Downloads
wget https://s3-eu-west-1.amazonaws.com/downloads-packages/raspberry-pi/gitlab_7.9.0-omnibus.pi-1_armhf.deb
sudo dpkg -i gitlab_7.9.0-omnibus.pi-1_armhf.deb
sudo gitlab-ctl reconfigure
sudo a2ensite gitlab.conf
sudo a2enmod proxy_http
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment