<commit_before>#!/bin/sh -eux
# install tomcat 8 web server by apache.
# NOTE: This script is still a work-in-progress.

# set default values for input environment variables if not set. ---------------
# tomcat web server install parameters.
tomcat_home="${tomcat_home:-apache-tomcat-8}"                       # [optional] tomcat home (defaults to 'apache-tomcat-8').
tomcat_release="${tomcat_release:-8.5.47}"                          # [optional] tomcat release (defaults to '8.5.47').

tomcat_username="${tomcat_username:-vagrant}"                       # [optional] tomcat user name (defaults to 'vagrant').
tomcat_group="${tomcat_group:-vagrant}"                             # [optional] tomcat group (defaults to 'vagrant').

tomcat_admin_username="${tomcat_admin_username:-admin}"             # [optional] tomcat admin user name (defaults to 'admin').
tomcat_admin_password="${tomcat_admin_password:-<PASSWORD>}"          # [optional] tomcat admin password (defaults to '<PASSWORD>').
tomcat_admin_roles="${tomcat_admin_roles:-manager-gui,admin-gui}"   # [optional] tomcat admin roles (defaults to 'manager-gui,admin-gui').
                                                                    #            NOTE: for appd java agent, use 'manager-script'.
tomcat_jdk_home="${tomcat_jdk_home:-/usr/local/java/jdk180}"        # [optional] tomcat jdk home (defaults to '/usr/local/java/jdk180').
                                                                    # [optional] tomcat catalina opts (defaults to '-Xms512M -Xmx1024M -server -XX:+UseParallelGC').
                                                                    #            NOTE: for appd java agent, add '-javaagent:/opt/appdynamics/appagent/javaagent.jar'.
tomcat_catalina_opts="${tomcat_catalina_opts:--Xms512M -Xmx1024M -server -XX:+UseParallelGC}"
                                                                    # [optional] tomcat java opts (defaults to '-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom').
tomcat_java_opts="${tomcat_java_opts:--Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom}"

# define usage function. -------------------------------------------------------
usage() {
  cat <<EOF
Usage:
  All inputs are defined by external environment variables.
  Script should be run with 'root' privilege.
  Example:
   # tomcat web server install parameters.
    [root]# export tomcat_home="apache-tomcat-8"                # [optional] tomcat home (defaults to 'apache-tomcat-8').
    [root]# export tomcat_release="8.5.47"                      # [optional] tomcat release (defaults to '8.5.47').
   #
    [root]# export tomcat_username="vagrant"                    # [optional] tomcat user name (defaults to 'vagrant').
    [root]# export tomcat_group="vagrant"                       # [optional] tomcat group (defaults to 'vagrant').
   #
    [root]# export tomcat_admin_username="admin"                # [optional] tomcat admin user name (defaults to 'admin').
    [root]# export tomcat_admin_password="<PASSWORD>"             # [optional] tomcat admin password (defaults to '<PASSWORD>').
    [root]# export tomcat_admin_roles="manager-gui,admin-gui"   # [optional] tomcat admin roles (defaults to 'manager-gui,admin-gui').
                                                                #            NOTE: for appd java agent, use 'manager-script'.
    [root]# export tomcat_jdk_home="/usr/local/java/jdk180"     # [optional] tomcat jdk home (defaults to '/usr/local/java/jdk180').
                                                                # [optional] tomcat catalina opts (defaults to '-Xms512M -Xmx1024M -server -XX:+UseParallelGC').
                                                                #            NOTE: for appd java agent, add '-javaagent:/opt/appdynamics/appagent/javaagent.jar'.
    [root]# export tomcat_catalina_opts="-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
                                                                # [optional] tomcat java opts (defaults to '-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom').
    [root]# export tomcat_java_opts="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
    [root]# $0
EOF
}

# install apache tomcat. -------------------------------------------------------
# set tomcat web server installation variables.
tomcat_folder="${tomcat_home:0:-2}-${tomcat_release}"
tomcat_binary="${tomcat_folder}.tar.gz"
<commit_msg>Upgraded support for Apache Tomcat 8.5.49.<commit_after>#!/bin/sh -eux
# install tomcat 8 web server by apache.
# NOTE: This script is still a work-in-progress.

# set default values for input environment variables if not set. ---------------
# tomcat web server install parameters.
tomcat_home="${tomcat_home:-apache-tomcat-8}"                       # [optional] tomcat home (defaults to 'apache-tomcat-8').
tomcat_release="${tomcat_release:-8.5.49}"                          # [optional] tomcat release (defaults to '8.5.49').

tomcat_username="${tomcat_username:-vagrant}"                       # [optional] tomcat user name (defaults to 'vagrant').
tomcat_group="${tomcat_group:-vagrant}"                             # [optional] tomcat group (defaults to 'vagrant').

tomcat_admin_username="${tomcat_admin_username:-admin}"             # [optional] tomcat admin user name (defaults to 'admin').
tomcat_admin_password="${tomcat_admin_password:-<PASSWORD>}"          # [optional] tomcat admin password (defaults to '<PASSWORD>').
tomcat_admin_roles="${tomcat_admin_roles:-manager-gui,admin-gui}"   # [optional] tomcat admin roles (defaults to 'manager-gui,admin-gui').
                                                                    #            NOTE: for appd java agent, use 'manager-script'.
tomcat_jdk_home="${tomcat_jdk_home:-/usr/local/java/jdk180}"        # [optional] tomcat jdk home (defaults to '/usr/local/java/jdk180').
                                                                    # [optional] tomcat catalina opts (defaults to '-Xms512M -Xmx1024M -server -XX:+UseParallelGC').
                                                                    #            NOTE: for appd java agent, add '-javaagent:/opt/appdynamics/appagent/javaagent.jar'.
tomcat_catalina_opts="${tomcat_catalina_opts:--Xms512M -Xmx1024M -server -XX:+UseParallelGC}"
                                                                    # [optional] tomcat java opts (defaults to '-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom').
tomcat_java_opts="${tomcat_java_opts:--Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom}"

# define usage function. -------------------------------------------------------
usage() {
  cat <<EOF
Usage:
  All inputs are defined by external environment variables.
  Script should be run with 'root' privilege.
  Example:
   # tomcat web server install parameters.
    [root]# export tomcat_home="apache-tomcat-8"                # [optional] tomcat home (defaults to 'apache-tomcat-8').
    [root]# export tomcat_release="8.5.49"                      # [optional] tomcat release (defaults to '8.5.49').
   #
    [root]# export tomcat_username="vagrant"                    # [optional] tomcat user name (defaults to 'vagrant').
    [root]# export tomcat_group="vagrant"                       # [optional] tomcat group (defaults to 'vagrant').
   #
    [root]# export tomcat_admin_username="admin"                # [optional] tomcat admin user name (defaults to 'admin').
    [root]# export tomcat_admin_password="<PASSWORD>"             # [optional] tomcat admin password (defaults to '<PASSWORD>').
    [root]# export tomcat_admin_roles="manager-gui,admin-gui"   # [optional] tomcat admin roles (defaults to 'manager-gui,admin-gui').
                                                                #            NOTE: for appd java agent, use 'manager-script'.
    [root]# export tomcat_jdk_home="/usr/local/java/jdk180"     # [optional] tomcat jdk home (defaults to '/usr/local/java/jdk180').
                                                                # [optional] tomcat catalina opts (defaults to '-Xms512M -Xmx1024M -server -XX:+UseParallelGC').
                                                                #            NOTE: for appd java agent, add '-javaagent:/opt/appdynamics/appagent/javaagent.jar'.
    [root]# export tomcat_catalina_opts="-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
                                                                # [optional] tomcat java opts (defaults to '-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom').
    [root]# export tomcat_java_opts="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
    [root]# $0
EOF
}

# install apache tomcat. -------------------------------------------------------
# set tomcat web server installation variables.
tomcat_folder="${tomcat_home:0:-2}-${tomcat_release}"
tomcat_binary="${tomcat_folder}.tar.gz"

{'fraction_non_alphanumeric': 0.14781246503300885, 'fraction_numerical': 0.014770057066129574, 'mean_word_length': 1.9803267755918639, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1791099', 'n_tokens_mistral': 2506, 'n_tokens_neox': 2393, 'n_words': 591}