<commit_before>#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright Clairvoyant 2015

DOMAIN1=com
DOMAIN2=clairvoyantsoft
ROOTDN="cn=Manager,dc=${DOMAIN2},dc=${DOMAIN1}"
ROOTPW=password
LDAPPASS=`slappasswd -s $ROOTPW`

#ldapadd -x -w $ROOTPW -D $ROOTDN -H ldapi:/// <<EOF
#dn: dc=${DOMAIN2},dc=${DOMAIN1}
#objectClass: dcObject
#objectClass: organization
#dc: $DOMAIN2
#o: $DOMAIN2
#structuralObjectClass: organization
#EOF

ldapadd -x -w $ROOTPW -D $ROOTDN -H ldapi:/// <<EOF
# Creates a base for DIT
dn: dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: top
objectClass: dcObject
objectclass: organization
o: $DOMAIN2
dc: $DOMAIN2
description: $DOMAIN2

dn: $ROOTDN
objectclass: organizationalRole
cn: Manager

# Creates a People OU (Organizational Unit)
dn: ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: organizationalUnit
ou: People

# Creates a Groups OU
dn: ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: organizationalUnit
ou: Groups
EOF

ldapadd -x -w $ROOTPW -D $ROOTDN -H ldapi:/// <<EOF
dn: uid=user00,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
uid: user00
cn: User 00
givenName: User
sn: 00
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/user00
uidNumber: 15000
gidNumber: 10000
userPassword: ${<PASSWORD>}
mail: user00@${DOMAIN2}.${DOMAIN1}
gecos: user00 User

dn: uid=user01,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
uid: user01
cn: User 01
givenName: User
sn: 01
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/user01
uidNumber: 15001
gidNumber: 10001
userPassword: ${<PASSWORD>}
mail: user01@${DOMAIN2}.${DOMAIN1}
gecos: user01 User

dn: uid=user02,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
uid: user02
cn: User 02
givenName: User
sn: 02
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/user02
uidNumber: 15002
gidNumber: 10002
userPassword: ${<PASSWORD>}
mail: user02@${DOMAIN2}.${DOMAIN1}
gecos: user02 User

dn: cn=group00,ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: posixGroup
objectClass: top
cn: group00
userPassword: {crypt}x
gidNumber: 10000
memberuid: uid=user00

dn: cn=group01,ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: posixGroup
objectClass: top
cn: group01
userPassword: {crypt}x
gidNumber: 10001
memberuid: uid=user01

dn: cn=group02,ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: groupOfNames
member: uid=user02,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
cn: group02
EOF

ldapsearch -x -D $ROOTDN -w $ROOTPW

if [ -x /usr/sbin/kadmin.local ]; then
  kadmin.local <<EOF
addprinc -pw p@ssw0rd user00
EOF
  echo
fi

exit 0
<commit_msg>Add user01 and user02 pricipals.<commit_after>#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright Clairvoyant 2015

DOMAIN1=com
DOMAIN2=clairvoyantsoft
ROOTDN="cn=Manager,dc=${DOMAIN2},dc=${DOMAIN1}"
ROOTPW=password
LDAPPASS=`slappasswd -s $ROOTPW`

#ldapadd -x -w $ROOTPW -D $ROOTDN -H ldapi:/// <<EOF
#dn: dc=${DOMAIN2},dc=${DOMAIN1}
#objectClass: dcObject
#objectClass: organization
#dc: $DOMAIN2
#o: $DOMAIN2
#structuralObjectClass: organization
#EOF

ldapadd -x -w $ROOTPW -D $ROOTDN -H ldapi:/// <<EOF
# Creates a base for DIT
dn: dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: top
objectClass: dcObject
objectclass: organization
o: $DOMAIN2
dc: $DOMAIN2
description: $DOMAIN2

dn: $ROOTDN
objectclass: organizationalRole
cn: Manager

# Creates a People OU (Organizational Unit)
dn: ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: organizationalUnit
ou: People

# Creates a Groups OU
dn: ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: organizationalUnit
ou: Groups
EOF

ldapadd -x -w $ROOTPW -D $ROOTDN -H ldapi:/// <<EOF
dn: uid=user00,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
uid: user00
cn: User 00
givenName: User
sn: 00
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/user00
uidNumber: 15000
gidNumber: 10000
userPassword: ${<PASSWORD>}
mail: user00@${DOMAIN2}.${DOMAIN1}
gecos: user00 User

dn: uid=user01,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
uid: user01
cn: User 01
givenName: User
sn: 01
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/user01
uidNumber: 15001
gidNumber: 10001
userPassword: ${<PASSWORD>}
mail: user01@${DOMAIN2}.${DOMAIN1}
gecos: user01 User

dn: uid=user02,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
uid: user02
cn: User 02
givenName: User
sn: 02
objectClass: top
objectClass: posixAccount
objectClass: inetOrgPerson
loginShell: /bin/bash
homeDirectory: /home/user02
uidNumber: 15002
gidNumber: 10002
userPassword: ${<PASSWORD>}
mail: user02@${DOMAIN2}.${DOMAIN1}
gecos: user02 User

dn: cn=group00,ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: posixGroup
objectClass: top
cn: group00
userPassword: {<PASSWORD>
gidNumber: 10000
memberuid: uid=user00

dn: cn=group01,ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: posixGroup
objectClass: top
cn: group01
userPassword: {<PASSWORD>
gidNumber: 10001
memberuid: uid=user01

dn: cn=group02,ou=Groups,dc=${DOMAIN2},dc=${DOMAIN1}
objectClass: groupOfNames
member: uid=user02,ou=People,dc=${DOMAIN2},dc=${DOMAIN1}
cn: group02
EOF

ldapsearch -x -D $ROOTDN -w $ROOTPW

if [ -x /usr/sbin/kadmin.local ]; then
  kadmin.local <<EOF
addprinc -pw p@ssw0rd user00
addprinc -pw p@ssw0rd user01
addprinc -pw p@ssw0rd user02
EOF
  echo
fi

exit 0

{'fraction_non_alphanumeric': 0.12944832944832946, 'fraction_numerical': 0.04786324786324787, 'mean_word_length': 6.34703196347032, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2453678', 'n_tokens_mistral': 2543, 'n_tokens_neox': 2312, 'n_words': 674}