<commit_before>#!/bin/bash

cd "`dirname \"$0\"`"

echo --------- start mongodb ----------

# from https://github.com/codecombat/codecombat/wiki/Dev-Setup:-Linux#running
if type service 1>>/dev/null 2>>/dev/null
then
  sudo service mongod start
else
  sudo systemctl start mongodb
fi
if ! [ "$?" == "0" ]
then
  sudo -u mongodb mongod &
fi

echo --------- deactivate ----------

./deactivate.sh

echo --------- activate ----------

# this MUST be the same in deactivate.sh
comment="# start the codecombat server"
rc_local_line="sudo -u `whoami` \"`pwd`\"/start_server.sh \"$HOME\" $comment"
escaped_rc_local_line="`echo \"$rc_local_line\" | sed -e 's/[\\/\\\\\\&]/\\\\&/g'`"
echo "command: \"$rc_local_line\""
echo "escaped line in /etc/rc.local: \"$escaped_rc_local_line\""
sudo sed -i "s/^exit 0/$escaped_rc_local_line\nexit 0/g" /etc/rc.local

echo "Executing codecombat server"
./start_server.sh
echo "You may want to restart the computer."<commit_msg>explicitely starting mongodb in /etc/rc.local<commit_after>#!/bin/bash

cd "`dirname \"$0\"`"

echo --------- start mongodb ----------

# from https://github.com/codecombat/codecombat/wiki/Dev-Setup:-Linux#running
if type service 1>>/dev/null 2>>/dev/null
then
  sudo service mongod start
else
  sudo systemctl start mongodb
fi
if ! [ "$?" == "0" ]
then
  sudo -u mongodb mongod &
fi

echo --------- deactivate ----------

./deactivate.sh

echo --------- activate ----------

# this MUST be the same in deactivate.sh
comment="# start the codecombat server"
rc_local_line="sudo -u mongodb mongod & sudo -u `whoami` \"`pwd`\"/start_server.sh \"$HOME\" $comment"
escaped_rc_local_line="`echo \"$rc_local_line\" | sed -e 's/[\\/\\\\\\&]/\\\\&/g'`"
echo "command: \"$rc_local_line\""
echo "escaped line in /etc/rc.local: \"$escaped_rc_local_line\""
sudo sed -i "s/^exit 0/$escaped_rc_local_line\nexit 0/g" /etc/rc.local

echo "Executing codecombat server"
./start_server.sh
echo "You may want to restart the computer."
{'fraction_non_alphanumeric': 0.2148298628745556, 'fraction_numerical': 0.006094464195022855, 'mean_word_length': 2.9558232931726907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3162918', 'n_tokens_mistral': 756, 'n_tokens_neox': 698, 'n_words': 187}