<commit_before>#!/bin/bash

set -e

echo "Setting up git..."

## Preparing SSH environment for $VAGRANT_USER
touch $HOME_DIR/.ssh/known_hosts
grep github.com $HOME_DIR/.ssh/known_hosts || ssh-keyscan github.com >> $HOME_DIR/.ssh/known_hosts
sudo -u $VAGRANT_USER git config --global url."<EMAIL>:".insteadOf "https://github.com/"

## Preparing SSH environment for root
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
grep github.com ~/.ssh/known_hosts || ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global url."<EMAIL>:".insteadOf "https://github.com/"

# Add key to SSH agent (fail when no ssh-agent is accessible, one won't be able to download private repos)
# Add ssh keys for root - needed to run an experiment
rm -fr /root/.ssh/id_rsa
ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
chmod og-wx /root/.ssh/authorized_keys
ssh-keyscan localhost >> /root/.ssh/known_hosts

## SSH-agent veryfication
ssh-add -l<commit_msg>Enable SSH access on KopernikCI (#392)<commit_after>#!/bin/bash

set -e

echo "Setting up git..."

## Preparing SSH environment for $VAGRANT_USER
touch $HOME_DIR/.ssh/known_hosts
grep github.com $HOME_DIR/.ssh/known_hosts || ssh-keyscan github.com >> $HOME_DIR/.ssh/known_hosts
sudo -u $VAGRANT_USER git config --global url."<EMAIL>:".insteadOf "https://github.com/"

## Preparing SSH environment for root
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
grep github.com ~/.ssh/known_hosts || ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global url."<EMAIL>:".insteadOf "https://github.com/"

# Add key to SSH agent (fail when no ssh-agent is accessible, one won't be able to download private repos)
# Add ssh keys for root - needed to run an experiment
rm -fr /root/.ssh/id_rsa
ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
chmod og-wx /root/.ssh/authorized_keys
ssh-keyscan localhost >> /root/.ssh/known_hosts

## SSH-agent veryfication
ssh-add -l

echo "Injecting SSH public keys..."
pushd $HOME_DIR
git clone https://github.com/intelsdi-x/sno-ops.git
cat sno-ops/public_keys/* >> $HOME_DIR/.ssh/authorized_keys
popd
{'fraction_non_alphanumeric': 0.14701803051317613, 'fraction_numerical': 0.0013869625520110957, 'mean_word_length': 3.819599109131403, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6886583', 'n_tokens_mistral': 847, 'n_tokens_neox': 748, 'n_words': 218}