<commit_before>#!/usr/bin/env bash
echo "Makahiki Environment Setup Script for Ubuntu (x86)"
echo "--------------------------------------------------"
echo "Script started at $(date)"
echo "Appending locale settings (UTF-8) to /etc/bash.bashrc"
echo "# Makahiki needs UTF-8 for postgresql"
echo "export LANGUAGE=en_US.UTF-8" >> /etc/bash.bashrc
echo "export LANG=en_US.UTF-8" >> /etc/bash.bashrc
echo "export LC_ALL=en_US.UTF-8" >> /etc/bash.bashrc
locale-gen en_US.UTF-8
dpkg-reconfigure locales
echo "Done configuring locale settings."
echo "Updating package list."
apt-get update
echo "Done updating package list."
echo "Installing git."
apt-get install -y git
echo "Done installing git."
echo "Installing gcc."
apt-get install -y gcc
echo "Done installing gcc."
echo "Installing python-setuptools."
apt-get install -y python-setuptools
echo "Done installing python-setuptools."
echo "Installing pip."
easy_install pip
echo "Done installing pip."
echo "Installing python-imaging."
apt-get install -y python-imaging
echo "Done installing python-imaging."
echo "Installing python-dev."
apt-get install -y python-dev
echo "Done installing python-dev."
apt-get install -y libjpeg-dev
# Python Imaging Library shared library symlink setup
echo "Checking locations of Python Imaging Library shared libraries."
if [ ! -f /usr/lib/libjpeg.so ]
	then
		if [ -f /usr/lib/i386-linux-gnu/libjpeg.so ]
			then
				echo "Found: /usr/lib/i386-linux-gnu/libjpeg.so"
				echo "Creating symlink: /usr/lib/libjpeg.so --> /usr/lib/i386-linux-gnu/libjpeg.so"
				echo "sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/libjpeg.so"
				sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/
			else
				echo "Could not find libjpeg.so in /usr/lib or /usr/lib/i386-linux-gnu/." 
				echo "Python Imaging Library packages may not have installed properly."
				echo "Script exiting at $(date)."
				exit 1
		fi
	else
		echo "Found: /usr/lib/libjpeg.so"
fi

if [ ! -f /usr/lib/libz.so ]
	then
		if [ -f /usr/lib/i386-linux-gnu/libz.so ]
			then
				echo "Found: /usr/lib/i386-linux-gnu/libz.so"
				echo "Creating symlink: /usr/lib/libz.so --> /usr/lib/i386-linux-gnu/libz.so"
				echo "sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/"
				sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
			else
				echo "Could not find libz.so in /usr/lib or /usr/lib/i386-linux-gnu/."
				echo "Python Imaging Library packages may not have installed properly."
				echo "Script exiting at $(date)"
				exit 1
		fi
	else
		echo "Found: /usr/lib/libz.so"
fi
echo "Python Imaging Library shared libraries check is complete."
echo "Installing postgresql-9.1."
apt-get install -y postgresql-9.1
echo "Done installing postgresql-9.1."
echo "Installing libpq-dev."
apt-get install -y libpq-dev
echo "Done installing libpq-dev."
echo "Installing memcached."
apt-get install -y memcached
echo "Finished installing memcached."
echo "Installing libmemcached-dev."
apt-get install -y libmemcached-dev
echo "Done installing libmemcached-dev."
echo "Installing virtualenvwrapper."
pip install virtualenvwrapper
echo "Done installing virtualenvwrapper."
echo "Appending virtualenvwrapper settings to /home/vagrant/.bashrc."
echo "# Virtualenvwrapper settings for makahiki" >> /home/vagrant/.bashrc
echo "export WORKON_HOME=/home/vagrant/.virtualenvs" >> /home/vagrant/.bashrc
echo "export PROJECT_HOME=/home/vagrant/makahiki" >> /home/vagrant/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> /home/vagrant/.bashrc
echo "Done appending settings to /home/vagrant/.bashrc."
echo "Script completed at $(date)"
exit 0<commit_msg>install/vagrant_scripts/ubuntu_x86/bootstrap.sh: Added lines to configure postgresql cluster with UTF-8.<commit_after>#!/usr/bin/env bash
echo "Makahiki Environment Setup Script for Ubuntu (x86)"
echo "--------------------------------------------------"
echo "Script started at $(date)"
echo "Appending locale settings (UTF-8) to /etc/bash.bashrc"
echo "# UTF-8 locale settings for Makahiki" >> /etc/bash.bashrc
echo "export LANGUAGE=en_US.UTF-8" >> /etc/bash.bashrc
echo "export LANG=en_US.UTF-8" >> /etc/bash.bashrc
echo "export LC_ALL=en_US.UTF-8" >> /etc/bash.bashrc
locale-gen en_US.UTF-8
dpkg-reconfigure locales
echo "Done configuring locale settings."
echo "Updating package list."
echo "apt-get update"
apt-get update
echo "Done updating package list."
echo "Installing git."
echo "apt-get install -y git"
apt-get install -y git
echo "Done installing git."
echo "Installing gcc."
echo "apt-get install -y gcc"
apt-get install -y gcc
echo "Done installing gcc."
echo "Installing python-setuptools."
echo "apt-get install -y python-setuptools"
apt-get install -y python-setuptools
echo "Done installing python-setuptools."
echo "Installing pip."
echo "easy_install pip"
easy_install pip
echo "Done installing pip."
echo "Installing python-imaging."
echo "apt-get install -y python-imaging"
apt-get install -y python-imaging
echo "Done installing python-imaging."
echo "Installing python-dev."
echo "apt-get install -y python-dev"
apt-get install -y python-dev
echo "Done installing python-dev."
echo "apt-get install -y libjpeg-dev"
apt-get install -y libjpeg-dev
# Python Imaging Library shared library symlink setup
echo "Checking locations of Python Imaging Library shared libraries."
if [ ! -f /usr/lib/libjpeg.so ]
	then
		if [ -f /usr/lib/i386-linux-gnu/libjpeg.so ]
			then
				echo "Found: /usr/lib/i386-linux-gnu/libjpeg.so"
				echo "Creating symlink: /usr/lib/libjpeg.so --> /usr/lib/i386-linux-gnu/libjpeg.so"
				echo "sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/libjpeg.so"
				sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/
			else
				echo "Could not find libjpeg.so in /usr/lib or /usr/lib/i386-linux-gnu/." 
				echo "Python Imaging Library packages may not have installed properly."
				echo "Script exiting at $(date)."
				exit 1
		fi
	else
		echo "Found: /usr/lib/libjpeg.so"
fi

if [ ! -f /usr/lib/libz.so ]
	then
		if [ -f /usr/lib/i386-linux-gnu/libz.so ]
			then
				echo "Found: /usr/lib/i386-linux-gnu/libz.so"
				echo "Creating symlink: /usr/lib/libz.so --> /usr/lib/i386-linux-gnu/libz.so"
				echo "sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/"
				sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
			else
				echo "Could not find libz.so in /usr/lib or /usr/lib/i386-linux-gnu/."
				echo "Python Imaging Library packages may not have installed properly."
				echo "Script exiting at $(date)"
				exit 1
		fi
	else
		echo "Found: /usr/lib/libz.so"
fi
echo "Python Imaging Library shared libraries check is complete."
echo "Installing postgresql-9.1."
echo "apt-get install -y postgresql-9.1"
apt-get install -y postgresql-9.1
echo "Done installing postgresql-9.1."
echo "Installing libpq-dev."
echo "apt-get install -y libpq-dev"
apt-get install -y libpq-dev
echo "Done installing libpq-dev."
echo "Configuring PostgreSQL cluster \"main\" with locale en_US.UTF8"
echo "pg_dropcluster 9.1 main --stop"
pg_dropcluster 9.1 main --stop
echo "pg_createcluster --locale en_US.UTF8 9.1 main"
pg_createcluster --locale en_US.UTF8 9.1 main
echo "Done configuring cluster \"main\"."
echo "Installing memcached."
echo "apt-get install -y memcached"
apt-get install -y memcached
echo "Finished installing memcached."
echo "Installing libmemcached-dev."
echo "apt-get install -y libmemcached-dev"
apt-get install -y libmemcached-dev
echo "Done installing libmemcached-dev."
echo "Installing virtualenvwrapper."
echo "pip install virtualenvwrapper"
pip install virtualenvwrapper
echo "Done installing virtualenvwrapper."
echo "Appending virtualenvwrapper settings to /home/vagrant/.bashrc."
echo "# Virtualenvwrapper settings for makahiki" >> /home/vagrant/.bashrc
echo "export WORKON_HOME=/home/vagrant/.virtualenvs" >> /home/vagrant/.bashrc
echo "export PROJECT_HOME=/home/vagrant/makahiki" >> /home/vagrant/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> /home/vagrant/.bashrc
echo "Done appending settings to /home/vagrant/.bashrc."
echo "Script completed at $(date)"
exit 0
{'fraction_non_alphanumeric': 0.13653870045968444, 'fraction_numerical': 0.015157162380419928, 'mean_word_length': 3.52755905511811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6638974', 'n_tokens_mistral': 3062, 'n_tokens_neox': 2710, 'n_words': 831}