2015-12-21 07:04:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-12-23 06:26:27 +00:00
|
|
|
MYSQL_ROOT_PASSWORD="i_hate_passwords"
|
|
|
|
|
2015-12-21 07:04:00 +00:00
|
|
|
echo "Updating system..."
|
2015-12-23 06:26:27 +00:00
|
|
|
apt-get -y update
|
|
|
|
apt-get -y upgrade
|
|
|
|
|
|
|
|
echo "Preparing for MySQL installation..."
|
|
|
|
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD"
|
|
|
|
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD"
|
2015-12-21 07:04:00 +00:00
|
|
|
|
|
|
|
echo "Installing dependencies..."
|
2015-12-23 06:26:27 +00:00
|
|
|
apt-get -y install python
|
2016-03-03 05:36:51 +00:00
|
|
|
apt-get -y install python-pip libjpeg-dev
|
2015-12-23 06:26:27 +00:00
|
|
|
apt-get -y install python-dev libmysqlclient-dev
|
|
|
|
apt-get -y install nginx
|
|
|
|
apt-get -y install mysql-server
|
2016-01-03 02:20:50 +00:00
|
|
|
apt-get -y install tmux
|
2015-12-21 07:04:00 +00:00
|
|
|
|
|
|
|
echo "Installing pip dependencies..."
|
2016-01-03 02:16:47 +00:00
|
|
|
pip install -r /vagrant/scripts/requirements.txt
|
2015-12-23 06:26:27 +00:00
|
|
|
|
|
|
|
echo "PATH=$PATH:/vagrant" >> /etc/profile
|
2016-01-03 02:20:50 +00:00
|
|
|
source /etc/profile
|
2015-12-23 06:26:27 +00:00
|
|
|
cp /vagrant/ctf.nginx /etc/nginx/sites-enabled/ctf
|
2015-12-23 06:40:32 +00:00
|
|
|
rm /etc/nginx/sites-*/default
|
2015-12-21 22:37:08 +00:00
|
|
|
|
2016-01-03 02:16:47 +00:00
|
|
|
sudo service nginx restart
|
|
|
|
|
|
|
|
mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "CREATE DATABASE easyctf;"
|