<commit_before>#! /bin/sh
# /etc/init.d/dosenet.sh
### BEGIN INIT INFO
# Provides: dosenet
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: DoseNet - sends data for the DoseNet project
### END INIT INFO

# setup paths and check config files
HOME=/home/pi
DOSENET=$HOME/dosenet-raspberrypi
CONFIGDIR=$HOME/config
LOGTAG=dosenet

CONFIGFILE=$CONFIGDIR/config.csv
PUBLICKEY=$CONFIGDIR/id_rsa_lbl.pub
# if either file is missing, in normal mode, let manager.py raise the IOError

case "$1" in
  start)
    logger --stderr --id --tag $LOGTAG "Waiting for NTP to be synced..."
    sudo service ntp stop
    sudo timeout 60s ntpd -gq
    sudo service ntp start
    logger --stderr --id --tag $LOGTAG "Starting DoseNet script"
    # -dm runs screen in background. doesn't work without it on Raspbian Jesse.
    sudo screen -dm python $DOSENET/manager.py -i 30
    ;;
  stop)
    logger --stderr --id --tag $LOGTAG "Stopping DoseNet script"
    sudo killall python &
    ;;
  finish)
    sudo kill -s SIGQUIT
    ;;
  test)
    logger --stderr --id --tag $LOGTAG "Testing DoseNet script"
    # allow testing without configfile and/or publickey
    if [ -f $CONFIGFILE ]; then
      if [ -f $PUBLICKEY ]; then
        sudo python $DOSENET/manager.py -c $CONFIGFILE -k $PUBLICKEY --test
      else
        sudo python $DOSENET/manager.py -c $CONFIGFILE --test
      fi
    else
      sudo python $DOSENET/manager.py --test
    fi
    ;;
  *)
    echo "Usage: /etc/init.d/dosenet {start|test|stop}"
    exit 1
    ;;
esac<commit_msg>Revert 30-s interval from testing<commit_after>#! /bin/sh
# /etc/init.d/dosenet.sh
### BEGIN INIT INFO
# Provides: dosenet
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: DoseNet - sends data for the DoseNet project
### END INIT INFO

# setup paths and check config files
HOME=/home/pi
DOSENET=$HOME/dosenet-raspberrypi
CONFIGDIR=$HOME/config
LOGTAG=dosenet

CONFIGFILE=$CONFIGDIR/config.csv
PUBLICKEY=$CONFIGDIR/id_rsa_lbl.pub
# if either file is missing, in normal mode, let manager.py raise the IOError

case "$1" in
  start)
    logger --stderr --id --tag $LOGTAG "Waiting for NTP to be synced..."
    sudo service ntp stop
    sudo timeout 60s ntpd -gq
    sudo service ntp start
    logger --stderr --id --tag $LOGTAG "Starting DoseNet script"
    # -dm runs screen in background. doesn't work without it on Raspbian Jesse.
    sudo screen -dm python $DOSENET/manager.py
    ;;
  stop)
    logger --stderr --id --tag $LOGTAG "Stopping DoseNet script"
    sudo killall python &
    ;;
  finish)
    sudo kill -s SIGQUIT
    ;;
  test)
    logger --stderr --id --tag $LOGTAG "Testing DoseNet script"
    # allow testing without configfile and/or publickey
    if [ -f $CONFIGFILE ]; then
      if [ -f $PUBLICKEY ]; then
        sudo python $DOSENET/manager.py -c $CONFIGFILE -k $PUBLICKEY --test
      else
        sudo python $DOSENET/manager.py -c $CONFIGFILE --test
      fi
    else
      sudo python $DOSENET/manager.py --test
    fi
    ;;
  *)
    echo "Usage: /etc/init.d/dosenet {start|test|stop}"
    exit 1
    ;;
esac
{'fraction_non_alphanumeric': 0.11207430340557276, 'fraction_numerical': 0.00804953560371517, 'mean_word_length': 2.7352601156069363, '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': '7163596', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1105, 'n_words': 367}