<commit_before>#!/bin/bash
################################################################################################
# Bash script to automate installation of Security Monkey.
#
# This script assumes that you're going to run Security Monkey on an Ubuntu EC2 Instance in AWS.
#
# This script will work for a Postgres DB installation on both RDS and localhost.
#
# I'm sure it could be significantly improved on and I'd love feedback on "how" :)
#
# Written by :: markofu
#
# Date :: September 2014
#
# Version History :: 
#
#       0.1 :: September 2014 :: First version submitted to Netflix Develop Branch. Few issues.
#       0.2 :: October 2014   :: Fixed a few aesthetics.
#       0.3 :: October 2014   :: Config-deploy file now takes in any user & usage recommendations.
#                                Removing the Postgres password prompt
#
# To Do :: 
#         Investigate how to prevent the supervisor interactive prompt spawning
#         Fix bug with password containing !
################################################################################################
 
set -e 

### Declaring some variables

USAGE="Usage: ./$(basename $0) [-hv] [-d arg] [-e arg] [-i arg] [-n arg] [-p arg] [-r arg] [-s arg] [-u arg] [-w arg].

Ensure that the script is executable, for example, with permissions of 755 (rwxr_xr_x) using `chmod 755 $(basename $0)`
For example - 

              ./$(basename $0) -d 10.11.1.11 -e <EMAIL> -i 10.10.10.10 -n ec2-10-10-10-10.us-west-1.compute.amazonaws.com -p SuperSecretPasswordYo -r <EMAIL> -s <EMAIL> -u postgres -w secmonkey.com
    
              ./$(basename $0) -h 

              ./$(basename $0) -v
    

CLI switches - 
              -d  >> Hostname or IP Address of the Postgres Database
              -e  >> Email Address used for SSL Cert for the Security Monkey Instance
              -i  >> IP Address (what you want the hostname resolve to) of the SecurityMonkey Instance
              -h  >> Prints this message
              -n  >> Hostname of the SecurityMonkey Instance
              -p  >> Password for the Postgres DB on the SecurityMonkey Instance
              -r  >> Recipient Email Address for the Security Monkey Notifications
              -s  >> Sender Email Address for the Security Monkey Notifications
              -u  >> Postgres DB User
              -v  >> Version of the $(basename $0) script
              -w  >> Site (Domain) be used for the self-signed certificate
    "

VERSION="0.3"
ARGS=$#

err_code=10<commit_msg>No DB passwd prompt & config-deploy varies user<commit_after>#!/bin/bash
################################################################################################
# Bash script to automate installation of Security Monkey.
#
# This script assumes that you're going to run Security Monkey on an Ubuntu EC2 Instance in AWS.
#
# This script will work for a Postgres DB installation on both RDS and localhost.
#
# I'm sure it could be significantly improved on and I'd love feedback on "how" :)
#
# Written by :: markofu
#
# Date :: September 2014
#
# Version History :: 
#
#       0.1 :: September 2014 :: First version submitted to Netflix Develop Branch. Few issues.
#       0.2 :: October 2014   :: Fixed a few aesthetics.
#       0.3 :: October 2014   :: Config-deploy file now takes in any user & usage recommendations.
#                                Removing the Postgres password prompt
#
# To Do :: 
#         Investigate how to prevent the supervisor interactive prompt spawning
#         Fix bug with password containing !
################################################################################################
 
set -e 

### Declaring some variables

USAGE="Usage: ./$(basename $0) [-hv] [-d arg] [-e arg] [-i arg] [-n arg] [-p arg] [-r arg] [-s arg] [-u arg] [-w arg].

Ensure that the script is executable, for example, with permissions of 755 (rwxr_xr_x) using 'chmod 755 $(basename $0)'

For example - 

              ./$(basename $0) -d 10.11.1.11 -e <EMAIL> -i 10.10.10.10 -n ec2-10-10-10-10.us-west-1.compute.amazonaws.com -p <PASSWORD> -r <EMAIL> -s <EMAIL> -u postgres -w secmonkey.com
    
              ./$(basename $0) -h 

              ./$(basename $0) -v
    

CLI switches - 
              -d  >> Hostname or IP Address of the Postgres Database
              -e  >> Email Address used for SSL Cert for the Security Monkey Instance
              -i  >> IP Address (what you want the hostname resolve to) of the SecurityMonkey Instance
              -h  >> Prints this message
              -n  >> Hostname of the SecurityMonkey Instance
              -p  >> Password for the Postgres DB on the SecurityMonkey Instance
              -r  >> Recipient Email Address for the Security Monkey Notifications
              -s  >> Sender Email Address for the Security Monkey Notifications
              -u  >> Postgres DB User
              -v  >> Version of the $(basename $0) script
              -w  >> Site (Domain) be used for the self-signed certificate
    "

VERSION="0.3"
ARGS=$#

err_code=10
{'fraction_non_alphanumeric': 0.16739389131297105, 'fraction_numerical': 0.025386751289170964, 'mean_word_length': 2.487551867219917, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5916588', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1352, 'n_words': 575}