<commit_before>#!/bin/bash
MAC=$1
echo -n "At $(date) my local IP is: "
ifconfig wlan0 | grep "inet " | awk '{print $2}' | awk -F : '{print $2}'
ifconfig bnep0 | grep "inet " | awk '{print $2}' | awk -F : '{print $2}'
echo -n "At $(date) my public IP is: "
if ! curl -m 15 icanhazip.com; then
    echo -n "Error, cycling networking "
    # simply restart networking completely for stability purposes
    sudo /etc/init.d/networking stop
    sleep 5
    sudo /etc/init.d/networking start
    echo -n "and getting new wlan0 IP"
    ps aux | grep -v grep | grep -q "dhclient wlan0" && sudo killall dhclient
    sudo dhclient wlan0 -r
    sudo dhclient wlan0
    echo
    echo -n "At $(date) my public IP is: "
    if ! curl -m 15 icanhazip.com; then
        echo -n "Error, connecting BT to $MAC "
        oref0-bluetoothup
        sudo bt-pan client $MAC
        echo -n "and getting bnep0 IP"
        sudo dhclient bnep0
        echo
        echo -n "At $(date) my public IP is: "
        curl -m 15 icanhazip.com
        echo
    fi
fi<commit_msg>Trying to prioritize one mac address;if fail, try another<commit_after>#!/bin/bash
MAC=$1
MAC2=$2
echo -n "At $(date) my local IP is: "
ifconfig wlan0 | grep "inet " | awk '{print $2}' | awk -F : '{print $2}'
ifconfig bnep0 | grep "inet " | awk '{print $2}' | awk -F : '{print $2}'
echo -n "At $(date) my public IP is: "
if ! curl -m 15 icanhazip.com; then
    echo -n "Error, cycling networking "
    # simply restart networking completely for stability purposes
    sudo /etc/init.d/networking stop
    sleep 5
    sudo /etc/init.d/networking start
    echo -n "and getting new wlan0 IP"
    ps aux | grep -v grep | grep -q "dhclient wlan0" && sudo killall dhclient
    sudo dhclient wlan0 -r
    sudo dhclient wlan0
    echo
    echo -n "At $(date) my public IP is: "
    if ! curl -m 15 icanhazip.com; then
        echo -n "Error, connecting BT to $MAC "
        oref0-bluetoothup
        sudo bt-pan client $MAC
        echo -n "and getting bnep0 IP"
        sudo dhclient bnep0
        echo
        echo -n "At $(date) my public IP is: "
        if ! curl -m 15 icanhazip.com; then
            if [[ ! -z "${MAC2}" ]]; then
                echo -n "Error, connecting BT to $MAC2 "
                oref0-bluetoothup
                sudo bt-pan client $MAC2
                echo -n "and getting bnep0 IP"
                sudo dhclient bnep0
                echo
                echo -n "At $(date) my public IP is: "
            fi
        fi
        echo
    fi
fi
{'fraction_non_alphanumeric': 0.10731319554848967, 'fraction_numerical': 0.01987281399046105, 'mean_word_length': 1.9822274881516588, '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': '7418167', 'n_tokens_mistral': 901, 'n_tokens_neox': 838, 'n_words': 334}