<commit_before>#!/bin/bash

export INSTANCEID="R-${RANDOM}-${RANDOM}-${RANDOM}-${RANDOM}-${RANDOM}"

if [[ "$1" == "dev" ]]; then
    sed s/#DEV#//g /usr/local/openresty/nginx/conf/nginx.conf > /tmp/nginx.conf
    cp /tmp/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
    echo "Running in dev mode. Point your browser to http://localhost:8780"
    export DEV_MODE="TRUE"
fi



if [ ! -z "$MESOS_TASK_ID" ]; then
    echo "It's a Meso substrate, so discover _stomp._rabbit-funcatron._tcp.marathon.mesos" 1>&2

    HOST=""
    PORT=""

    host () {
        HOST=$(dig rabbit-funcatron.marathon.mesos  | \
                      grep -v "^\;" | \
                      grep "IN\s\+A" | \
                      grep -o "[0-9]*\.[0-9]*\.[[0-9]*\.[0-9]*$" | \
                      sed -n 1p)
    }

    port () {
        PORT=$(dig _stomp._rabbit-funcatron._tcp.marathon.mesos SRV | \
                      grep -v "^\;" | grep -e "IN\s\+SRV" | \
                      grep -o "[0-9]* *[^ ]*$" | \
                      grep -o "^[0-9]*" | sed -n 1p)<commit_msg>Further cleanup for service discovery script<commit_after>#!/bin/bash

export INSTANCEID="R-${RANDOM}-${RANDOM}-${RANDOM}-${RANDOM}-${RANDOM}"

if [[ "$1" == "dev" ]]; then
    sed s/#DEV#//g /usr/local/openresty/nginx/conf/nginx.conf > /tmp/nginx.conf
    cp /tmp/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
    echo "Running in dev mode. Point your browser to http://localhost:8780"
    export DEV_MODE="TRUE"
fi



if [ ! -z "$MESOS_TASK_ID" ]; then
    echo "It's a Meso substrate, so discover _stomp._rabbit-funcatron._tcp.marathon.mesos" 1>&2

    HOST=""
    PORT=""

    host () {
        HOST=$(dig +short rabbit-funcatron.marathon.mesos  |
                      sed -n 1p)
    }

    port () {
        PORT=$(dig +short _stomp._rabbit-funcatron._tcp.marathon.mesos SRV | \
                      sed -n 1p | \
                      grep -o '[0-9]* *[^ ]*$' | \
                      grep -o '^[0-9]*')
{'fraction_non_alphanumeric': 0.18790931989924434, 'fraction_numerical': 0.01712846347607053, 'mean_word_length': 1.8330955777460771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2713228', 'n_tokens_mistral': 784, 'n_tokens_neox': 734, 'n_words': 140}