<commit_before>#!/bin/bash -ex

VPC_CIDR=$1
DATABASE=$2

. ./postgresenv.sh

"${POSTGRESBINDIR}"/initdb -D "${POSTGRESDBDIR}"

cat ./conf/hba.conf >> "${POSTGRESDBDIR}"/pg_hba.conf

sed -i "s/<VPC_CIDR>/${VPC_CIDR}/g" "${POSTGRESDBDIR}"/pg_hba.conf
sed -i "s/<DATABASE>/${DATABASE}/g" "${POSTGRESDBDIR}"/pg_hba.conf

cat ./conf/pg.conf >> "${POSTGRESDBDIR}"/postgresql.conf<commit_msg>minor fix for pg_hba.conf<commit_after>#!/bin/bash -ex

VPC_CIDR=$1
DATABASE=$2
VPC_CIDR_ESCAPED=$(echo ${VPC_CIDR}|awk -F/ '{print $1 "\\""/" $2}')

. ./postgresenv.sh

"${POSTGRESBINDIR}"/initdb -D "${POSTGRESDBDIR}"

cat ./conf/hba.conf >> "${POSTGRESDBDIR}"/pg_hba.conf

# replace VPC_CIDR and DATABASE in pg_hba.conf and uncomment lines if necessary
sed -i "s/<VPC_CIDR>/${VPC_CIDR_ESCAPED}/g" "${POSTGRESDBDIR}"/pg_hba.conf
sed -i "s/\(#\)\(.*${VPC_CIDR_ESCAPED}.*\)/\2/g" "${POSTGRESDBDIR}"/pg_hba.conf
sed -i "s/<DATABASE>/${DATABASE}/g" "${POSTGRESDBDIR}"/pg_hba.conf
sed -i "s/\(#\)\(.*${DATABASE}.*\)/\2/g" "${POSTGRESDBDIR}"/pg_hba.conf

cat ./conf/pg.conf >> "${POSTGRESDBDIR}"/postgresql.conf
{'fraction_non_alphanumeric': 0.24381301558203483, 'fraction_numerical': 0.007332722273143905, 'mean_word_length': 4.747368421052632, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '1266291', 'n_tokens_mistral': 524, 'n_tokens_neox': 537, 'n_words': 71}