<commit_before>#!/usr/bin/env bash

#bootstrap_tar_url="http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz"
bootstrap_tar_url="https://s3.amazonaws.com/kcsdb-init/chef_10.12.0_bootstrap.tar.gz"

welcome(){
	echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
	echo "::: KIT Cloud Serving Deployment and Benchmark welcomes you :) :::"
	echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
}

pause(){
   read -p "$*"
}

configure_opscenter(){
	echo "::::::::::::::::::::::::::::"
	echo "::: Configuring OpsCenter..."
	echo "::::::::::::::::::::::::::::"
	
	# private IP of this machine, NOT public IP
	kcsdb=$(curl -L http://16172.16.31.1054/latest/meta-data/local-ipv4 -s)
	sudo sed -i 's/interface = .*/interface = '$kcsdb'/g' /etc/opscenter/opscenterd.conf
	
	# don't use SSL
	echo '[agents]' | sudo tee -a etc/opscenter/opscenterd.conf
	echo 'use_ssl = false' | sudo tee -a etc/opscenter/opscenterd.conf
	
	sudo service opscenterd restart
}

install_kcsdb(){
	echo ":::::::::::::::::::::::"
	echo "::: Installing KCSDB..."
	echo ":::::::::::::::::::::::"
	git clone https://github.com/lehoanganh/kcsdb.git
	(cd $HOME/kcsdb && bundle update)
	cp $HOME/kcsdb/chef-repo/.chef/conf/state.tmpl.yml $HOME/kcsdb/chef-repo/.chef/conf/state.yml
}

build_chef_solo_config() {
	echo "::::::::::::::::::::::::::::::::::::::::::::"
	echo "::: Building configurations for chef-solo..."<commit_msg>[bf] missing a "/" character<commit_after>#!/usr/bin/env bash

#bootstrap_tar_url="http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz"
bootstrap_tar_url="https://s3.amazonaws.com/kcsdb-init/chef_10.12.0_bootstrap.tar.gz"

welcome(){
	echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
	echo "::: KIT Cloud Serving Deployment and Benchmark welcomes you :) :::"
	echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
}

pause(){
   read -p "$*"
}

configure_opscenter(){
	echo "::::::::::::::::::::::::::::"
	echo "::: Configuring OpsCenter..."
	echo "::::::::::::::::::::::::::::"
	
	# private IP of this machine, NOT public IP
	kcsdb=$(curl -L http://169.254.169.254/latest/meta-data/local-ipv4 -s)
	sudo sed -i 's/interface = .*/interface = '$kcsdb'/g' /etc/opscenter/opscenterd.conf
	
	# don't use SSL
	echo '[agents]' | sudo tee -a /etc/opscenter/opscenterd.conf
	echo 'use_ssl = false' | sudo tee -a /etc/opscenter/opscenterd.conf
	
	sudo service opscenterd restart
}

install_kcsdb(){
	echo ":::::::::::::::::::::::"
	echo "::: Installing KCSDB..."
	echo ":::::::::::::::::::::::"
	git clone https://github.com/lehoanganh/kcsdb.git
	(cd $HOME/kcsdb && bundle update)
	cp $HOME/kcsdb/chef-repo/.chef/conf/state.tmpl.yml $HOME/kcsdb/chef-repo/.chef/conf/state.yml
}

build_chef_solo_config() {
	echo "::::::::::::::::::::::::::::::::::::::::::::"
	echo "::: Building configurations for chef-solo..."
{'fraction_non_alphanumeric': 0.33206371191135736, 'fraction_numerical': 0.014196675900277008, 'mean_word_length': 4.9937759336099585, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2683240', 'n_tokens_mistral': 991, 'n_tokens_neox': 934, 'n_words': 176}