<commit_before># configure nagios
/sbin/chkconfig nagios on

/bin/sed -i 's:enable_notifications=1:enable_notifications=0:' /etc/nagios/nagios.cfg
/bin/sed -i 's:enable_flap_detection=1:enable_flap_detection=0:' /etc/nagios/nagios.cfg
/bin/sed -i 's:cfg_file=/etc/nagios/objects/localhost.cfg:#cfg_file=/etc/nagios/objects/localhost.cfg:' /etc/nagios/nagios.cfg

/sbin/restorecon -v /usr/lib64/nagios/plugins/*

# configure graphite
touch /etc/carbon/storage-aggregation.conf

/bin/sed -i 's:LOG_LISTENER_CONNECTIONS = True:LOG_LISTENER_CONNECTIONS = False:' /etc/carbon/carbon.conf
/bin/sed -i 's:LOG_CACHE_QUEUE_SORTS = True:LOG_CACHE_QUEUE_SORTS = False:' /etc/carbon/carbon.conf
/bin/sed -i 's:ENABLE_LOGROTATION = True:ENABLE_LOGROTATION = False:' /etc/carbon/carbon.conf

grep -q ^SECRET_KEY /etc/graphite-web/local_settings.py

if [ $? -eq 1 ]
then
  echo "SECRET_KEY = '$(openssl rand 32 -hex)'" >> /etc/graphite-web/local_settings.py
  echo "TIME_ZONE = 'UTC'" >> /etc/graphite-web/local_settings.py

  python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb --noinput
  chown apache:apache /var/lib/graphite-web/graphite.db

  cat << EOF > /etc/carbon/storage-schemas.conf
[carbon]
pattern = ^carbon\.
retentions = 60:90d

[asm_thresholds]
pattern = ^asm\..+Threshold
retentions = 1h:30d, 1d:5y

[default]
pattern = .*
retentions = 5m:30d, 1h:1y, 1d:5y
EOF

  /bin/sed -i 's:^:#:' /etc/httpd/conf.d/graphite-web.conf

  chkconfig carbon-cache on
fi

<commit_msg>Change Gemfile.lock permissions<commit_after># configure nagios
/sbin/chkconfig nagios on

/bin/sed -i 's:enable_notifications=1:enable_notifications=0:' /etc/nagios/nagios.cfg
/bin/sed -i 's:enable_flap_detection=1:enable_flap_detection=0:' /etc/nagios/nagios.cfg
/bin/sed -i 's:cfg_file=/etc/nagios/objects/localhost.cfg:#cfg_file=/etc/nagios/objects/localhost.cfg:' /etc/nagios/nagios.cfg

/sbin/restorecon -v /usr/lib64/nagios/plugins/*

# configure graphite
touch /etc/carbon/storage-aggregation.conf

/bin/sed -i 's:LOG_LISTENER_CONNECTIONS = True:LOG_LISTENER_CONNECTIONS = False:' /etc/carbon/carbon.conf
/bin/sed -i 's:LOG_CACHE_QUEUE_SORTS = True:LOG_CACHE_QUEUE_SORTS = False:' /etc/carbon/carbon.conf
/bin/sed -i 's:ENABLE_LOGROTATION = True:ENABLE_LOGROTATION = False:' /etc/carbon/carbon.conf

grep -q ^SECRET_KEY /etc/graphite-web/local_settings.py

if [ -e "/opt/asm-deployer/Gemfile.lock" ]
  then
  chown root:razor "/opt/asm-deployer/Gemfile.lock" && chmod 0664 "/opt/asm-deployer/Gemfile.lock"
fi

if [ $? -eq 1 ]
then
  echo "SECRET_KEY = '$(openssl rand 32 -hex)'" >> /etc/graphite-web/local_settings.py
  echo "TIME_ZONE = 'UTC'" >> /etc/graphite-web/local_settings.py

  python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb --noinput
  chown apache:apache /var/lib/graphite-web/graphite.db

  cat << EOF > /etc/carbon/storage-schemas.conf
[carbon]
pattern = ^carbon\.
retentions = 60:90d

[asm_thresholds]
pattern = ^asm\..+Threshold
retentions = 1h:30d, 1d:5y

[default]
pattern = .*
retentions = 5m:30d, 1h:1y, 1d:5y
EOF

  /bin/sed -i 's:^:#:' /etc/httpd/conf.d/graphite-web.conf

  chkconfig carbon-cache on
fi

{'fraction_non_alphanumeric': 0.15634971282705806, 'fraction_numerical': 0.018506700701978303, 'mean_word_length': 4.38659793814433, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '2330336', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1287, 'n_words': 209}