<commit_before>#! /bin/sh
### BEGIN INIT INFO
# Provides:          ghserver
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop GHServer server
### END INIT INFO

logger "GHServer: Start script executed"
GH_SERVER_PATH="/home/myname/Python/ghserver"
export PYTHONPATH="$GH_SERVER_PATH:$PYTHONPATH"

case "$1" in
  start)
    logger "GHServer: Starting"
    echo "Starting GHServer..."
    twistd -y "$GH_SERVER_PATH/ghserverapp.py" -l "$GH_SERVER_PATH/ghserver.log" --pidfile "$GH_SERVER_PATH/twistd.pid"
    ;;
  stop)
    logger "GHServer: Stopping"
    echo "Stopping GHServer..."
    kill `cat $GH_SERVER_PATH/twistd.pid`
    ;;
  *)
    logger "GHServer: Invalid usage"
    echo "Usage: /etc/init.d/ghserver {start|stop}"
    exit 1
    ;;
esac

exit 0<commit_msg>Script optimised for our particular needs<commit_after>#! /bin/sh
### BEGIN INIT INFO
# Provides:          ghserver
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop GHServer server
### END INIT INFO

logger "GHServer: Start script executed"
# Test values
GH_SERVER_PATH="/home/sgongar/Dev/protocol"
export PYTHONPATH="$GH_SERVER_PATH:$PYTHONPATH"

case "$1" in
  start)
    logger "GHServer: Starting"
    echo "Starting GHServer..."
    # twistd -y "$GH_SERVER_PATH/ghserverapp.py" -l "$GH_SERVER_PATH/ghserver.log" --pidfile "$GH_SERVER_PATH/twistd.pid"
    twistd -y "$GH_SERVER_PATH/server_amp.py" -l "$GH_SERVER_PATH/server_amplog.log" --pidfile "GH_SERVER_PATH/twistd.pid"
    ;;
  stop)
    logger "GHServer: Stopping"
    echo "Stopping GHServer..."
    kill `cat $GH_SERVER_PATH/twistd.pid`
    ;;
  *)
    logger "GHServer: Invalid usage"
    echo "Usage: /etc/init.d/ghserver {start|stop}"
    exit 1
    ;;
esac

exit 0
{'fraction_non_alphanumeric': 0.13028344107409248, 'fraction_numerical': 0.009945300845350571, 'mean_word_length': 3.501118568232662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4847295', 'n_tokens_mistral': 772, 'n_tokens_neox': 717, 'n_words': 175}