<commit_before>#!/bin/bash
set -e
set -x

packages="help2man apache2 libapache2-mod-php5 php5-mcrypt curl"

if [ "x$DB" = "xmysql" ]; then
  dbuser=travis
  packages="$packages php5-mysql"

  mysql -u $dbuser -e 'create database ykksm;'
  mysql -u $dbuser ykksm < ykksm-db.sql

  dbrun="mysql -u $dbuser ykksm -e"
elif [ "x$DB" = "xpgsql" ]; then
  dbuser=postgres
  packages="$packages php5-pgsql"

  psql -U $dbuser -c 'create database ykksm;'
  psql -U $dbuser ykksm < ykksm-db.sql

  dbrun="psql -U $dbuser ykksm -c"
else
  echo "unknown DB $DB"
  exit 1
fi

sudo apt-get update -qq
sudo apt-get install -qq -y $packages

git submodule update --init
sudo make install symlink
echo 'include_path = "/etc/yubico/ksm:/usr/share/ykksm"' > ykksm.ini
phpenv config-add ykksm.ini
sudo chmod a+r /usr/share/yubikey-ksm/* /etc/yubico/ksm/*
cat > config-db.php << EOF
<?php
\$dbuser = '$dbuser';
\$dbpass = '';
\$dbname = 'ykksm';
\$dbtype = '$DB';
?>
EOF
sudo mv config-db.php /etc/yubico/ksm/

$dbrun 'insert into yubikeys (publicname,internalname,aeskey) values("idkfefrdhtru","<KEY>","<KEY>");'
<commit_msg>apparently not using phpenv..<commit_after>#!/bin/bash
set -e
set -x

packages="help2man apache2 libapache2-mod-php5 php5-mcrypt curl"

if [ "x$DB" = "xmysql" ]; then
  dbuser=travis
  packages="$packages php5-mysql"

  mysql -u $dbuser -e 'create database ykksm;'
  mysql -u $dbuser ykksm < ykksm-db.sql

  dbrun="mysql -u $dbuser ykksm -e"
elif [ "x$DB" = "xpgsql" ]; then
  dbuser=postgres
  packages="$packages php5-pgsql"

  psql -U $dbuser -c 'create database ykksm;'
  psql -U $dbuser ykksm < ykksm-db.sql

  dbrun="psql -U $dbuser ykksm -c"
else
  echo "unknown DB $DB"
  exit 1
fi

sudo apt-get update -qq
sudo apt-get install -qq -y $packages

git submodule update --init
sudo make install symlink
sudo sh -c "echo 'include_path = "/etc/yubico/ksm:/usr/share/ykksm"' > /etc/php5/conf.d/ykksm.ini"
sudo chmod a+r /usr/share/yubikey-ksm/* /etc/yubico/ksm/*
cat > config-db.php << EOF
<?php
\$dbuser = '$dbuser';
\$dbpass = '';
\$dbname = 'ykksm';
\$dbtype = '$DB';
?>
EOF
sudo mv config-db.php /etc/yubico/ksm/

$dbrun 'insert into yubikeys (publicname,internalname,aeskey) values("idkfefrdhtru","<KEY>","<KEY>");'

{'fraction_non_alphanumeric': 0.16606822262118492, 'fraction_numerical': 0.00763016157989228, 'mean_word_length': 3.7628205128205128, 'pattern_counts': {'":': 0, '<': 17, '<?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': '6455677', 'n_tokens_mistral': 1005, 'n_tokens_neox': 961, 'n_words': 239}