<commit_before>#!/bin/bash

MYSQL_ROOT_PASS='<PASSWORD>'

# Set $HOME.
HOME=/home/vagrant
cd ~

apt-get update
apt-get upgrade -y

# add-apt-repositories
apt-get install -y software-properties-common
# Warning: PHP5.5.9(Ubuntu's default) has some bugs affecting Phalcon routing.
# That's why this repository is needed.
add-apt-repository ppa:ondrej/php5
apt-get update

# Ignore client locale settings.
sed -i 's/AcceptEnv/#AcceptEnv/' /etc/ssh/sshd_config

# tools
apt-get install -y nano git-core

# apache
apt-get install -y apache2
mv /var/www/html/index.html /var/www/html/index.html_backup

# apache settings
a2enmod rewrite
a2enmod ssl
a2ensite default-ssl
# https://help.ubuntu.com/community/ApacheMySQLPHP#Troubleshooting_Apache
echo 'ServerName localhost' > /etc/apache2/conf-available/fqdn.conf
a2enconf fqdn
cp /vagrant/conf/apache.conf /etc/apache2/sites-available/myapache.conf
a2ensite myapache.conf

# PHP
apt-get install -y php5 php5-common php5-mcrypt curl php5-curl
cp /vagrant/conf/php.ini /etc/php5/mods-available/myphp.ini
php5enmod myphp

# MySQL
debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASS"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASS"
apt-get install -y mysql-server php5-mysqlnd
cp /vagrant/conf/mysql.cnf /etc/mysql/conf.d/mysql.cnf
service mysql restart

# phpMyAdmin
debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2"
debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean true"
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password $MYSQL_ROOT_PASS"
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password"
apt-get -y install phpmyadmin
echo "\$cfg['LoginCookieValidity'] = 14400;" >> /etc/phpmyadmin/config.inc.php

# Phalcon
apt-get install -y php5-dev gcc libpcre3-dev re2c
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd ~/cphalcon/build/
./install
cd ~
rm -rf cphalcon/
echo 'extension=phalcon.so' > /etc/php5/mods-available/phalcon.ini
php5enmod phalcon

# Zephir
git clone https://github.com/phalcon/zephir
cd zephir
./install-json
./install -c
cd ~

# Composer(global)
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
echo 'PATH="$HOME/.composer/vendor/bin:$PATH"' >> .profile

# Phalcon DevTools
composer global require phalcon/devtools:dev-master
ln -s /home/vagrant/.composer/vendor/bin/phalcon.php /home/vagrant/.composer/vendor/bin/phalcon

# Codeception
composer global require codeception/codeception

# auto security update
cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades

chown -R vagrant:vagrant $HOME

apt-get autoremove -y

service apache2 restart<commit_msg>Fix sudoers path<commit_after>#!/bin/bash

MYSQL_ROOT_PASS='<PASSWORD>'

# Set $HOME.
HOME=/home/vagrant
cd ~

apt-get update
apt-get upgrade -y

# add-apt-repositories
apt-get install -y software-properties-common
# Warning: PHP5.5.9(Ubuntu's default) has some bugs affecting Phalcon routing.
# That's why this repository is needed.
add-apt-repository ppa:ondrej/php5
apt-get update

# Ignore client locale settings.
sed -i 's/AcceptEnv/#AcceptEnv/' /etc/ssh/sshd_config

# tools
apt-get install -y nano git-core

# apache
apt-get install -y apache2
mv /var/www/html/index.html /var/www/html/index.html_backup

# apache settings
a2enmod rewrite
a2enmod ssl
a2ensite default-ssl
# https://help.ubuntu.com/community/ApacheMySQLPHP#Troubleshooting_Apache
echo 'ServerName localhost' > /etc/apache2/conf-available/fqdn.conf
a2enconf fqdn
cp /vagrant/conf/apache.conf /etc/apache2/sites-available/myapache.conf
a2ensite myapache.conf

# PHP
apt-get install -y php5 php5-common php5-mcrypt curl php5-curl
cp /vagrant/conf/php.ini /etc/php5/mods-available/myphp.ini
php5enmod myphp

# MySQL
debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASS"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASS"
apt-get install -y mysql-server php5-mysqlnd
cp /vagrant/conf/mysql.cnf /etc/mysql/conf.d/mysql.cnf
service mysql restart

# phpMyAdmin
debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2"
debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean true"
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password $MYSQL_ROOT_PASS"
debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password"
apt-get -y install phpmyadmin
echo "\$cfg['LoginCookieValidity'] = 14400;" >> /etc/phpmyadmin/config.inc.php

# Phalcon
apt-get install -y php5-dev gcc libpcre3-dev re2c
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd ~/cphalcon/build/
./install
cd ~
rm -rf cphalcon/
echo 'extension=phalcon.so' > /etc/php5/mods-available/phalcon.ini
php5enmod phalcon

# Zephir
git clone https://github.com/phalcon/zephir
cd zephir
./install-json
./install -c
cd ~

# Composer(global)
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
echo 'PATH="$HOME/.composer/vendor/bin:$PATH"' >> .profile
echo 'Defaults !secure_path' > /etc/sudoers.d/00-keep-env-path
echo 'Defaults env_keep+="PATH"' >> /etc/sudoers.d/00-keep-env-path

# Phalcon DevTools
composer global require phalcon/devtools:dev-master
ln -s /home/vagrant/.composer/vendor/bin/phalcon.php /home/vagrant/.composer/vendor/bin/phalcon

# Codeception
composer global require codeception/codeception

# auto security update
cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades

chown -R vagrant:vagrant $HOME

apt-get autoremove -y

service apache2 restart
{'fraction_non_alphanumeric': 0.12169680111265646, 'fraction_numerical': 0.01321279554937413, 'mean_word_length': 4.713008937437935, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 20, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '6110839', 'n_tokens_mistral': 2218, 'n_tokens_neox': 2085, 'n_words': 443}