<commit_before>#!/bin/bash

# Terminate after the first line that fails (returns nonzero exit code)
set -e

echo 'Installing nginx'
# TODO: Must install nginx > 1.4 for websockets support
sudo echo "deb http://ppa.launchpad.net/nginx/release/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C

sudo apt-get update
sudo apt-get install nginx -yf


echo 'Stopping process running on port 80 (free it up for nginx)'
sudo fuser -k 80/tcp

echo 'Starting nginx server'
sudo service nginx start

# Copy the config files in nginx/sites-available
if [[ $1 == 'development' ]]; then<commit_msg>updated nginx installation script (not tested yet)<commit_after>#!/bin/bash

# Terminate after the first line that fails (returns nonzero exit code)
set -e

echo 'Installing nginx'
# TODO: Install only when the latest nginx is not already installed / running
# TODO: Must install nginx > 1.4 for websockets support
# REF: https://www.digitalocean.com/community/articles/how-to-install-the-latest-version-of-nginx-on-ubuntu-12-10
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx -yf

echo 'Stopping process running on port 80 (free it up for nginx)'
sudo fuser -k 80/tcp

echo 'Starting nginx server'
sudo service nginx start

# Copy the config files in nginx/sites-available
if [[ $1 == 'development' ]]; then
{'fraction_non_alphanumeric': 0.099644128113879, 'fraction_numerical': 0.015658362989323844, 'mean_word_length': 4.325757575757576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '2717395', 'n_tokens_mistral': 502, 'n_tokens_neox': 434, 'n_words': 170}