<commit_before>#!/bin/sh

# setup repositories
apt-get update

apt-get install -y --force-yes software-properties-common

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository 'deb http://dl.hhvm.com/ubuntu vivid main'

apt-get update
# install needed tools and daemons
export DEBIAN_FRONTEND=noninteractive

apt-get install curl wget git nginx nodejs npm redis-server hhvm screen vim percona-server-server-5.6 -y --force-yes
update-rc.d hhvm defaults
ln -s /usr/bin/nodejs /usr/bin/node

rm /etc/nginx/sites-enabled/default
ln -s /vagrant/conf/nginx-osu-next /etc/nginx/sites-available/nginx-osu-next
ln -s /etc/nginx/sites-available/nginx-osu-next /etc/nginx/sites-enabled/nginx-osu-next

cd /data/osu\!web/

mkdir -p "public/uploads"
chmod 777 "public/uploads"

./bin/db_setup

# replace mysql config vars to be reachable from vm host
sed -i 's/bind-address/#bind-address/' /etc/mysql/my.cnf

sed -i '$a hhvm.http.slowquerytreshold = 60000' /etc/hhvm/server.ini

#this shouldn't be applied to live servers, but is required for a shitty virtualbox bug (https://www.virtualbox.org/ticket/9069)
sed -i 's/sendfile on/sendfile off/' /etc/nginx/nginx.conf

service mysql restart
service hhvm restart
service nginx restart

echo "Finished setup of daemons and servers"<commit_msg>When provisioning, make sure mysql is running before running db_setup.<commit_after>#!/bin/sh

# setup repositories
apt-get update

apt-get install -y --force-yes software-properties-common

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository 'deb http://dl.hhvm.com/ubuntu vivid main'

apt-get update
# install needed tools and daemons
export DEBIAN_FRONTEND=noninteractive

apt-get install curl wget git nginx nodejs npm redis-server hhvm screen vim percona-server-server-5.6 -y --force-yes
update-rc.d hhvm defaults
ln -s /usr/bin/nodejs /usr/bin/node

rm /etc/nginx/sites-enabled/default
ln -s /vagrant/conf/nginx-osu-next /etc/nginx/sites-available/nginx-osu-next
ln -s /etc/nginx/sites-available/nginx-osu-next /etc/nginx/sites-enabled/nginx-osu-next

cd /data/osu\!web/

mkdir -p "public/uploads"
chmod 777 "public/uploads"

# replace mysql config vars to be reachable from vm host
sed -i 's/bind-address/#bind-address/' /etc/mysql/my.cnf

sed -i '$a hhvm.http.slowquerytreshold = 60000' /etc/hhvm/server.ini

#this shouldn't be applied to live servers, but is required for a shitty virtualbox bug (https://www.virtualbox.org/ticket/9069)
sed -i 's/sendfile on/sendfile off/' /etc/nginx/nginx.conf

service mysql restart
service hhvm restart
service nginx restart

./bin/db_setup

echo "Finished setup of daemons and servers"
{'fraction_non_alphanumeric': 0.11570853167337972, 'fraction_numerical': 0.020505309410472353, 'mean_word_length': 3.97632058287796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '169198', 'n_tokens_mistral': 1054, 'n_tokens_neox': 975, 'n_words': 270}