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

# <EMAIL>
# (c) Solinea, Inc  2014

# MAKE SURE YOU SDIST THE PACKAGE BEFORE YOU DO THIS !

# 0. sanity check
# 1. install elasticsearch schema (external)
# 2. install logstash configs
# 3. create package for syslog distribution to OS clients
# 4. create virtualenv
# 5. install pips
# 6. install apache
# 7. create mod_wsgi
# 8. sanity tests
# 9. 


function pre_install_sanity() {
    server_os = `uname -o`
    if [[ server_os = 'GNU/Linux' ]]; then
        bail_out("You need to be running a Linux server")
    fi
    redhat_release = `cat /etc/redhat-release`
    if [[ redhat_release = 'CentOS release 6.5 (Final)' ]]
        bail_out("You need to be running CentOS 6.5")
    fi
}

function install_elasticsearch () {
    curl -XGET https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.noarch.rpm > elasticsearch-1.1.1.noarch.rpm
    yum install java-1.7.0-openjdk.x86_64
    yum install gcc
    yum install gcc-c++
    yum install python-devel
    yum install postgresql-server
    yum install postgresql-devel
    yum install libffi-devel
    yum install openssl-devel
    yum install httpd
    yum install mod_wsgi
    rpm -Uhv elasticsearch-1.1.1.noarch.rpm
    chkconfig --add elasticsearch
    service elasticsearch start
}

function install_logstash() {
    curl -XGET https://download.elasticsearch.org/logstash/logstash/packages/centos/logstash-1.4.0-1_c82dc09.noarch.rpm > logstash-1.4.0-1_c82dc09.noarch.rpm<commit_msg>more fun with bash comparisons<commit_after>#!/usr/bin/env bash

# <EMAIL>
# (c) Solinea, Inc  2014

# MAKE SURE YOU SDIST THE PACKAGE BEFORE YOU DO THIS !

# 0. sanity check
# 1. install elasticsearch schema (external)
# 2. install logstash configs
# 3. create package for syslog distribution to OS clients
# 4. create virtualenv
# 5. install pips
# 6. install apache
# 7. create mod_wsgi
# 8. sanity tests
# 9. 

function bail_out() {
    exit
}

function pre_install_sanity() {
    server_os=`uname -o`
    if [[ $server_os == 'GNU/Linux' ]]; then
        bail_out("You need to be running a Linux server")
    fi
    redhat_release=`cat /etc/redhat-release`
    if [[ $redhat_release == 'CentOS release 6.5 (Final)' ]]
        bail_out("You need to be running CentOS 6.5")
    fi
}

function install_elasticsearch () {
    curl -XGET https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.noarch.rpm > elasticsearch-1.1.1.noarch.rpm
    yum install java-1.7.0-openjdk.x86_64
    yum install gcc
    yum install gcc-c++
    yum install python-devel
    yum install postgresql-server
    yum install postgresql-devel
    yum install libffi-devel
    yum install openssl-devel
    yum install httpd
    yum install mod_wsgi
    rpm -Uhv elasticsearch-1.1.1.noarch.rpm
    chkconfig --add elasticsearch
    service elasticsearch start
}

function install_logstash() {
    curl -XGET https://download.elasticsearch.org/logstash/logstash/packages/centos/logstash-1.4.0-1_c82dc09.noarch.rpm > logstash-1.4.0-1_c82dc09.noarch.rpm
{'fraction_non_alphanumeric': 0.10281597904387688, 'fraction_numerical': 0.03274394237066143, 'mean_word_length': 3.2196132596685083, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6554834', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1067, 'n_words': 284}