<commit_before>#!/bin/bash
apt-get -y update
apt-get -y install python-software-properties
add-apt-repository -y ppa:ondrej/php5-oldstable
apt-get -y update

# set up a silent install of MySQL
dbpass=$1

export DEBIAN_FRONTEND=noninteractive
echo mysql-server-5.6 mysql-server/root_password password $dbpass | debconf-set-selections
echo mysql-server-5.6 mysql-server/root_password_again password $dbpass | debconf-set-selections

# install the LAMP stack
apt-get -y install apache2 mysql-client mysql-server php5

# install moodle requirements
apt-get -y install graphviz aspell php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap

# add port 8000 for admin access
sudo perl -0777 -p -i -e 's/Listen 80/Listen 80\nListen 8080/ig' /etc/apache2/ports.conf
sudo perl -0777 -p -i -e 's/\*:80/*:80 *:8080/g' /etc/apache2/sites-enabled/000-default.conf

# install Moodle
cd /var/www/html
wget https://download.moodle.org/download.php/direct/stable29/moodle-2.9.2.zip -O moodle.zip
apt-get install unzip
unzip moodle.zip

# make the moodle directory writable for owner
chown -R www-data moodle
chmod -R 0755 moodle

# # mount moodledata disk
# # The ARM script only mounts a single data disk.  It is safe 
# # to assume that on a new VM, this data disk is located at /dev/sdc.

# # If you have a more complicated setup, then do examine what this
# # script is doing and modify accordingly.

# # create a partition table for the disk
# parted -s /dev/sdc mklabel msdos

# # create a single large partition
# parted -s /dev/sdc mkpart primary ext4 0\% 100\%

# # install the file system
# mkfs.ext4 /dev/sdc1

# # create the mount point
# mkdir -p /moodledata

# # mount the disk
# mount /dev/sdc1 /moodledata/

# # premissions
# chown -R www-data /moodledata
# chmod -R 777 /moodledata

# # add mount to /etc/fstab to persist across reboots
# echo "/dev/sdc1    /moodledata/    ext4    defaults 0 0" >> /etc/fstab

# TODO: create cron entry
# * * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null

# restart Apache
apachectl restart<commit_msg>Mount file share on /var/www/moodledata.<commit_after>#!/bin/bash
apt-get -y update
apt-get -y install python-software-properties
add-apt-repository -y ppa:ondrej/php5-oldstable
apt-get -y update

# set up a silent install of MySQL
dbpass=$1

export DEBIAN_FRONTEND=noninteractive
echo mysql-server-5.6 mysql-server/root_password password $dbpass | debconf-set-selections
echo mysql-server-5.6 mysql-server/root_password_again password $dbpass | debconf-set-selections

# install the LAMP stack
apt-get -y install apache2 mysql-client mysql-server php5

# install moodle requirements
apt-get -y install graphviz aspell php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap

# add port 8000 for admin access
sudo perl -0777 -p -i -e 's/Listen 80/Listen 80\nListen 8080/ig' /etc/apache2/ports.conf
sudo perl -0777 -p -i -e 's/\*:80/*:80 *:8080/g' /etc/apache2/sites-enabled/000-default.conf

# install Moodle
cd /var/www/html
wget https://download.moodle.org/download.php/direct/stable29/moodle-2.9.2.zip -O moodle.zip
apt-get install unzip
unzip moodle.zip

# make the moodle directory writable for owner
chown -R www-data moodle
chmod -R 0755 moodle

# create moodledata directory
mkdir /var/www/moodledata
chown -R www-data /var/www/moodledata
chmod -R 777 /var/www/moodledata

# # mount moodledata disk
# # The ARM script only mounts a single data disk.  It is safe 
# # to assume that on a new VM, this data disk is located at /dev/sdc.

# # If you have a more complicated setup, then do examine what this
# # script is doing and modify accordingly.

# # create a partition table for the disk
# parted -s /dev/sdc mklabel msdos

# # create a single large partition
# parted -s /dev/sdc mkpart primary ext4 0\% 100\%

# # install the file system
# mkfs.ext4 /dev/sdc1

# # create the mount point
# mkdir -p /moodledata

# # mount the disk
# mount /dev/sdc1 /moodledata/

# # premissions
# chown -R www-data /moodledata
# chmod -R 777 /moodledata

# # add mount to /etc/fstab to persist across reboots
# echo "/dev/sdc1    /moodledata/    ext4    defaults 0 0" >> /etc/fstab

# TODO: create cron entry
# * * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null

# restart Apache
apachectl restart

# mount share file on /var/www/moodledata
SharedStorageAccountName=$2
SharedAzureFileName=$3
SharedStorageAccountKey=$4
sudo apt-get install cifs-utils
sudo mount -t cifs //$SharedStorageAccountName.file.core.windows.net/$SharedAzureFileName /var/www/moodledata -o vers=2.1,username=$SharedStorageAccountName,password=$Shared<PASSWORD>,dir_mode=0777,file_mode=0777
	
#add mount to /etc/fstab to persist across reboots
sudo chmod 777 /etc/fstab
sudo echo "//$SharedStorageAccountName.file.core.windows.net/$SharedAzureFileName /var/www/moodledata cifs vers=3.0,username=$SharedStorageAccountName,password=$<PASSWORD>,dir_mode=0777,file_mode=0777" >> /etc/fstab
{'fraction_non_alphanumeric': 0.107085346215781, 'fraction_numerical': 0.03482286634460548, 'mean_word_length': 3.782483156881617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 14, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5757426', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1748, 'n_words': 541}