<commit_before>#!/bin/sh

#
# Reference:
# - http://launchd.info/
# - http://stackoverflow.com/questions/16542301/running-a-shell-script-on-shutdown-via-launchd
#
# To Do to run as work:
# - cp daily-uptime-osx.sh ~/Applications
# - Edit the path in daily-uptime-osx.plist to path of script
# - cp daily-uptime-osx.plist ~/Library/LaunchAgents
# - logout and login
#

DAILYUPTIMEFILE="$HOME/daily-uptime.log"

StopService() {
    echo "Shutting Down. Logging your uptime :)"
    touch "$DAILYUPTIMEFILE"
    uptime >> "$DAILYUPTIMEFILE"
    exit 0
}

trap StopService SIGTERM
while true; do
    sleep 86400 &
    wait
done<commit_msg>daily-uptime: added date<commit_after>#!/bin/sh

#
# Reference:
# - http://launchd.info/
# - http://stackoverflow.com/questions/16542301/running-a-shell-script-on-shutdown-via-launchd
#
# To Do to run as work:
# - cp daily-uptime-osx.sh ~/Applications
# - Edit the path in daily-uptime-osx.plist to path of script
# - cp daily-uptime-osx.plist ~/Library/LaunchAgents
# - logout and login
#

DAILYUPTIMEFILE="$HOME/daily-uptime.log"

StopService() {
    echo "Shutting Down. Logging your uptime :)"
    touch "$DAILYUPTIMEFILE"
    echo "`date +%Y-%m-%dT%H:%M:%S%z` |`uptime`" >> "$DAILYUPTIMEFILE"
    exit 0
}

trap StopService SIGTERM
while true; do
    sleep 86400 &
    wait
done
{'fraction_non_alphanumeric': 0.14502657555049356, 'fraction_numerical': 0.02126044039483675, 'mean_word_length': 3.4982935153583616, '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': '3728696', 'n_tokens_mistral': 540, 'n_tokens_neox': 500, 'n_words': 108}