<commit_before>#!/bin/bash

echo "================= START INSTALL-TOMCAT.SH $(date +"%r") ================="
echo " "
echo "BEGIN setting up Tomcat and misc. utilities ..."

# a little housekeeping
echo "... Doing a little housekeeping ..."
sudo apt-get -y autoremove > /dev/null
sudo apt-get -y update --fix-missing > /dev/null

# install some common utilities
if [ ! -f /var/log/utils_installed ]; then
	echo "... Installing misc. utilities ..."

	sudo apt-get -y update > /dev/null
	sudo apt-get -qq install wget curl zip unzip debconf-utils > /dev/null

	touch /var/log/utils_installed
fi

# install java, openssl, and tomcat7
if [ ! -d "/etc/tomcat7" ]; then
	echo "... Installing Tomcat (grab a cup of coffee, this may take a few minutes) ..."

	sudo apt-get -y update > /dev/null
	sudo apt-get -qq install tomcat7 > /dev/null
fi

# copy modified server.xml to the vm
sudo cp /vagrant/configs/server.xml /etc/tomcat7/server.xml

# restart tomcat
sudo service tomcat7 restart > /dev/null

# install iptables
echo "... Installing iptables and configuring port forwarding ..."
sudo apt-get -y update > /dev/null
sudo apt-get -qq install iptables > /dev/null<commit_msg>Copy setenv.sh to vm when it's provisioned<commit_after>#!/bin/bash

echo "================= START INSTALL-TOMCAT.SH $(date +"%r") ================="
echo " "
echo "BEGIN setting up Tomcat and misc. utilities ..."

# a little housekeeping
echo "... Doing a little housekeeping ..."
sudo apt-get -y autoremove > /dev/null
sudo apt-get -y update --fix-missing > /dev/null

# install some common utilities
if [ ! -f /var/log/utils_installed ]; then
	echo "... Installing misc. utilities ..."

	sudo apt-get -y update > /dev/null
	sudo apt-get -qq install wget curl zip unzip debconf-utils > /dev/null

	touch /var/log/utils_installed
fi

# install java, openssl, and tomcat7
if [ ! -d "/etc/tomcat7" ]; then
	echo "... Installing Tomcat (grab a cup of coffee, this may take a few minutes) ..."

	sudo apt-get -y update > /dev/null
	sudo apt-get -qq install tomcat7 > /dev/null
fi

# copy modified server.xml to the vm
sudo cp /vagrant/configs/server.xml /etc/tomcat7/server.xml

# copy setenv.sh to the vm
sudo cp /vagrant/configs/setenv.sh /usr/share/tomcat7/bin/setenv.sh

# restart tomcat
sudo service tomcat7 restart > /dev/null

# install iptables
echo "... Installing iptables and configuring port forwarding ..."
sudo apt-get -y update > /dev/null
sudo apt-get -qq install iptables > /dev/null
{'fraction_non_alphanumeric': 0.15147833130822194, 'fraction_numerical': 0.0044552450384771165, 'mean_word_length': 3.2439862542955327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2337264', 'n_tokens_mistral': 875, 'n_tokens_neox': 802, 'n_words': 286}