<commit_before>#!/bin/bash
set -eu

ip="$1"
threshold="$2"

sshpass -p root \
    ssh -T -o UserKnownHostsFile=/dev/null \
        -o StrictHostKeyChecking=no \
        -o ConnectTimeout=30 \
    root@"$ip" "
threshold=$threshold;
share=\`/usr/bin/cgminer-api | sed -n 's| \+\[GHS av\] => \([[:digit:]]\+\).\+|\1|gp'\`;
if [[ \"\$share\" -lt \"\$threshold\" ]]; then
    echo lower than expected \"\$threshold\", restarting... >&2 ;
    /etc/init.d/cgminer restart ;
fi
"<commit_msg>重启 cgminer 前先杀死 cgminer<commit_after>#!/bin/bash
set -eu

ip="$1"
threshold="$2"

sshpass -p root \
    ssh -T -o UserKnownHostsFile=/dev/null \
        -o StrictHostKeyChecking=no \
        -o ConnectTimeout=30 \
    root@"$ip" "
threshold=$threshold;
share=\`/usr/bin/cgminer-api | sed -n 's| \+\[GHS av\] => \([[:digit:]]\+\).\+|\1|gp'\`;
if [[ \"\$share\" -lt \"\$threshold\" ]]; then
    echo lower than expected \"\$threshold\", restarting... >&2 ;
    killall -s 9 cgminer ;
    sleep 1 ;
    /etc/init.d/cgminer restart ;
fi
"
{'fraction_non_alphanumeric': 0.23107177974434612, 'fraction_numerical': 0.01376597836774828, 'mean_word_length': 2.5719298245614035, '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': '346098', 'n_tokens_mistral': 428, 'n_tokens_neox': 402, 'n_words': 89}