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

# Check if the setup is already made. 
[ -f /root/.setup ] && exit 0

# Set Kerberos database.
setKerberos () {
    kdb5_util create -r BONSAI.TEST -s -W -P p@ssword
    kadmin.local -q "addprinc -pw p@ssword admin"
    kadmin.local -q "addprinc -pw p@ssword chuck"
    kadmin.local -q "ktadd -k /etc/krb5kdc/kadm5.keytab kadmin/admin"
    kadmin.local -q "ktadd -k /ect/krb5kdc/kadm5.keytab kadmin/changepw"
    kadmin.local -q "addprinc -randkey host/bonsai.test"
    kadmin.local -q "ktadd host/bonsai.test"
    kadmin.local -q "add_principal -randkey ldap/bonsai.test"
    kadmin.local -q "ktadd -keytab /etc/ldap/ldap.keytab ldap/bonsai.test"
    chown ldap:ldap /etc/ldap/ldap.keytab
    chown ldap:ldap /var/log/kadmin.log
    chown -Rf ldap:ldap /etc/krb5kdc/
    chown -Rf ldap:ldap /var/lib/krb5kdc/
    setcap 'cap_net_bind_service=+ep' /usr/sbin/krb5kdc # Allow to open port
    setcap 'cap_net_bind_service=+ep' /usr/sbin/kadmind
}

# Load the LDIF files and some schema into the server.
setLDAP () {
    chown -Rf ldap:ldap /var/run/slapd<commit_msg>Fix typo in Kerberos setup<commit_after>#!/bin/bash
set -e

# Check if the setup is already made. 
[ -f /root/.setup ] && exit 0

# Set Kerberos database.
setKerberos () {
    kdb5_util create -r BONSAI.TEST -s -W -P p@ssword
    kadmin.local -q "addprinc -pw p@ssword admin"
    kadmin.local -q "addprinc -pw p@ssword chuck"
    kadmin.local -q "ktadd -k /etc/krb5kdc/kadm5.keytab kadmin/admin"
    kadmin.local -q "ktadd -k /etc/krb5kdc/kadm5.keytab kadmin/changepw"
    kadmin.local -q "addprinc -randkey host/bonsai.test"
    kadmin.local -q "ktadd host/bonsai.test"
    kadmin.local -q "add_principal -randkey ldap/bonsai.test"
    kadmin.local -q "ktadd -keytab /etc/ldap/ldap.keytab ldap/bonsai.test"
    chown ldap:ldap /etc/ldap/ldap.keytab
    chown ldap:ldap /var/log/kadmin.log
    chown -Rf ldap:ldap /etc/krb5kdc/
    chown -Rf ldap:ldap /var/lib/krb5kdc/
    setcap 'cap_net_bind_service=+ep' /usr/sbin/krb5kdc # Allow to open port
    setcap 'cap_net_bind_service=+ep' /usr/sbin/kadmind
}

# Load the LDIF files and some schema into the server.
setLDAP () {
    chown -Rf ldap:ldap /var/run/slapd
{'fraction_non_alphanumeric': 0.1257349615558571, 'fraction_numerical': 0.008141112618724558, 'mean_word_length': 2.9855855855855857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4086003', 'n_tokens_mistral': 968, 'n_tokens_neox': 949, 'n_words': 221}