<commit_before>#!/usr/bin/env bash

# mark the ruby package as hold, so that apt won't update it.  if it updates,
# it gets pushed to ruby 1.9, which we don't want.
apt-mark hold ruby

apt-get update
apt-get install -y rubygems python-twisted git libxml2-dev libxslt-dev curl libcurl4-openssl-dev python-software-properties mongodb vim

# Install bundler, rake, and specific versions of some of the gems that are
# either known to work with ShC or work-around specific problems in the
# vagrant provisioning.
gem install bundler
gem install rake
gem install i18n --version 0.6.11
gem install rails --version 3.2.19

# Add the user and group needed for nginx
id -u deploy &>/dev/null || useradd -r -G sudo deploy

# install passenger and nginx to go with it
gem install passenger
passenger-install-nginx-module --auto --auto-download

# add an rc.d script for nginx
cd
curl -s -O https://raw.githubusercontent.com/jnstq/rails-nginx-passenger-ubuntu/master/nginx/nginx
mv nginx /etc/init.d/nginx
chown root:root /etc/init.d/nginx
chmod 755 /etc/init.d/nginx
sed 's/^PIDSPATH=.*/PIDSPATH=\/var\/run/' /etc/init.d/nginx
update-rc.d nginx defaults

# reset the nginx config to something that works for us.  i would have
# liked to do this with augeas, but I couldn't get it to scan nginx.conf
# for some reason.  even with a newer version of augeas it still never
# loaded it.
cat <<EOF > /opt/nginx/conf/nginx.conf
user deploy;
worker_processes  1;

error_log /opt/nginx/logs/error.log;
pid       /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    passenger_root /var/lib/gems/1.8/gems/passenger-5.0.11;
    passenger_ruby /usr/bin/ruby1.8;
    passenger_max_pool_size 6;
    passenger_buffer_response on;<commit_msg>Fix issues with passenger version changing<commit_after>#!/usr/bin/env bash

# mark the ruby package as hold, so that apt won't update it.  if it updates,
# it gets pushed to ruby 1.9, which we don't want.
apt-mark hold ruby

apt-get update
apt-get install -y rubygems python-twisted git libxml2-dev libxslt-dev curl libcurl4-openssl-dev python-software-properties mongodb vim

# Install bundler, rake, and specific versions of some of the gems that are
# either known to work with ShC or work-around specific problems in the
# vagrant provisioning.
gem install bundler
gem install rake
gem install i18n --version 0.6.11
gem install rails --version 3.2.19

# Add the user and group needed for nginx
id -u deploy &>/dev/null || useradd -r -G sudo deploy

# install passenger and nginx to go with it
gem install passenger
passenger-install-nginx-module --auto --auto-download
PASSENGER_VERSION=`ls -1 /var/lib/gems/1.8/gems | grep passenger-`

# add an rc.d script for nginx
cd
curl -s -O https://raw.githubusercontent.com/jnstq/rails-nginx-passenger-ubuntu/master/nginx/nginx
mv nginx /etc/init.d/nginx
chown root:root /etc/init.d/nginx
chmod 755 /etc/init.d/nginx
sed 's/^PIDSPATH=.*/PIDSPATH=\/var\/run/' /etc/init.d/nginx
update-rc.d nginx defaults

# reset the nginx config to something that works for us.  i would have
# liked to do this with augeas, but I couldn't get it to scan nginx.conf
# for some reason.  even with a newer version of augeas it still never
# loaded it.
cat <<EOF > /opt/nginx/conf/nginx.conf
user deploy;
worker_processes  1;

error_log /opt/nginx/logs/error.log;
pid       /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    passenger_root /var/lib/gems/1.8/gems/${PASSENGER_VERSION};
    passenger_ruby /usr/bin/ruby1.8;
    passenger_max_pool_size 6;
    passenger_buffer_response on;
{'fraction_non_alphanumeric': 0.09630459126539753, 'fraction_numerical': 0.01707726763717805, 'mean_word_length': 3.5984555984555984, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3572798', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1213, 'n_words': 429}