<commit_before>#!/bin/bash
sshd_basedir=$(dirname $(readlink -f $0))
sshd_calldir=$(pwd)

cd "$sshd_basedir"

set -e

# osx does not understand locale so dont accept their wrong LANG shit
sed -e 's/\(.*AcceptEnv.*\)/# \1/' -i /etc/ssh/sshd_config
systemctl restart ssh

# insert the insecure key
addinsecurekey=0
if [[ ! -e "/home/ubuntu/.ssh/authorized_keys" ]]; then
    addinsecurekey=1
elif [[ "0" == "$(cat /home/ubuntu.ssh/authorized_keys | wc -l)" ]]; then
    addinsecurekey=1
fi

if [[ 1 == $addinsecurekey ]]; then
    wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub \
        -O /home/ubuntu/.ssh/authorized_keys
    chmod 700 /home/ubuntu/.ssh
    chmod 600 /home/ubuntu/.ssh/authorized_keys
    chown -R ubuntu:ubuntu /home/ubuntu/.ssh
fi

cd "$sshd_calldir"<commit_msg>sshd :: fix typo in authorized_keys check<commit_after>#!/bin/bash
sshd_basedir=$(dirname $(readlink -f $0))
sshd_calldir=$(pwd)

cd "$sshd_basedir"

set -e

# osx does not understand locale so dont accept their wrong LANG shit
sed -e 's/\(.*AcceptEnv.*\)/# \1/' -i /etc/ssh/sshd_config
systemctl restart ssh

# insert the insecure key
addinsecurekey=0
if [[ ! -e "/home/ubuntu/.ssh/authorized_keys" ]]; then
    addinsecurekey=1
elif [[ "0" == "$(cat /home/ubuntu/.ssh/authorized_keys | wc -l)" ]]; then
    addinsecurekey=1
fi

if [[ 1 == $addinsecurekey ]]; then
    wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub \
        -O /home/ubuntu/.ssh/authorized_keys
    chmod 700 /home/ubuntu/.ssh
    chmod 600 /home/ubuntu/.ssh/authorized_keys
    chown -R ubuntu:ubuntu /home/ubuntu/.ssh
fi

cd "$sshd_calldir"
{'fraction_non_alphanumeric': 0.1547260686333534, 'fraction_numerical': 0.015653220951234198, 'mean_word_length': 3.516304347826087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6462274', 'n_tokens_mistral': 692, 'n_tokens_neox': 610, 'n_words': 146}