<commit_before>#!/bin/bash
BASE="/etc/init.d/"
#Edit localhost line
file="/etc/hosts"
sed -i '/127.0.1.1/d' $file
echo "127.0.1.1 `hostname`" >> $file
#Agent checks
agentresult=$(dpkg --get-selections | grep ksks-agent)
source /etc/profile
if [ -z "$agentresult" ] ;then
  echo "not found installed agent package"
  #editing collectd hostname
  /etc/init.d/collectd stop
  (echo "Hostname `hostname | head -1`" && sed '1d' /etc/collectd/collectd.conf) >> /etc/collectd/newcollectd.conf
  mv /etc/collectd/newcollectd.conf /etc/collectd/collectd.conf
  /etc/init.d/collectd start
  #installing agent
  sudo apt-get update
  sudo apt-get --force-yes --assume-yes install ksks-agent
else
  echo "installed agent package is found script will be by-passed"
fi<commit_msg>Remove 127.0.1.1 entry to prevent loopback<commit_after>#!/bin/bash
BASE="/etc/init.d/"
#Remove 127.0.1.1 line
file="/etc/hosts"
sed -i '/127.0.1.1/d' $file
#Agent checks
agentresult=$(dpkg --get-selections | grep ksks-agent)
source /etc/profile
if [ -z "$agentresult" ] ;then
  echo "not found installed agent package"
  #editing collectd hostname
  /etc/init.d/collectd stop
  (echo "Hostname `hostname | head -1`" && sed '1d' /etc/collectd/collectd.conf) >> /etc/collectd/newcollectd.conf
  mv /etc/collectd/newcollectd.conf /etc/collectd/collectd.conf
  /etc/init.d/collectd start
  #installing agent
  sudo apt-get update
  sudo apt-get --force-yes --assume-yes install ksks-agent
else
  echo "installed agent package is found script will be by-passed"
fi
{'fraction_non_alphanumeric': 0.14416775884665792, 'fraction_numerical': 0.022280471821756225, 'mean_word_length': 3.7422360248447206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 5, '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': '1672015', 'n_tokens_mistral': 581, 'n_tokens_neox': 552, 'n_words': 148}