<commit_before>SCRIPTDIR=$(cd $(dirname "$0") && pwd)
# Attempt to kill ROS if it is already running
echo "Killing everything, please wait a moment . . ."
pkill -f metatron_id.launch
pkill ngrok
sleep 10
pkill roslaunch
sleep 10
pkill roscore
sleep 1
echo "Everything Killed."
# If you want to be able to reset the ports,
# you need to add the script resetUSB.sh to the /etc/sudoers file,
# like this:
#chrisl8 ALL = NOPASSWD: /home/chrisl8/metatron/scripts/resetUSB.sh
sudo -nl|grep resetUSB > /dev/null
if [ $? -eq 0 ]
then
sudo -n ${SCRIPTDIR}/resetUSB.sh
fi
<commit_msg>Improve kill script to be faster and smarter.<commit_after>SCRIPTDIR=$(cd $(dirname "$0") && pwd)
# Attempt to kill ROS if it is already running
echo "Killing everything, please wait a moment . . ."
if (pkill -f metatron_id.launch)
then
    while (pgrep -f metatron_id.launch)
    do
        echo "Waiting for Metatron to close . . ."
        sleep 1
    done
fi
if (pkill ngrok)
then
    while (pgrep ngrok)
    do
        echo "Waiting for ngrok to close . . ."
        sleep 1
    done
fi
if (pkill -f "arlobot_bringup minimal.launch")
then
    while (pgrep -f "arlobot_bringup minimal.launch")
    do
        echo "Waiting for Arlobot to close . . ."
        sleep 1
    done
fi
if (pkill roslaunch)
then
    while (pgrep roslaunch)
    do
        echo "Waiting for roslaunch to close . . ."
        sleep 1
    done
fi
if (pkill roscore)
then
    while (pgrep roscore)
    do
        echo "Waiting for roscore to close . . ."
        sleep 1
    done
fi
echo "Everything Killed."
# If you want to be able to reset the ports,
# you need to add the script resetUSB.sh to the /etc/sudoers file,
# like this:
#chrisl8 ALL = NOPASSWD: /home/chrisl8/metatron/scripts/resetUSB.sh
sudo -nl|grep resetUSB > /dev/null
if [ $? -eq 0 ]
then
sudo -n ${SCRIPTDIR}/resetUSB.sh
fi

{'fraction_non_alphanumeric': 0.09652928416485901, 'fraction_numerical': 0.009761388286334056, 'mean_word_length': 2.7653061224489797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5174541', 'n_tokens_mistral': 682, 'n_tokens_neox': 656, 'n_words': 242}