<commit_before>#!/bin/bash

if [ -n "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_CONSUMER" ] || [ -n "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_PRODUCER" ]; then
    # Generate temporary keystore password
    export CERTS_STORE_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)

    mkdir -p /tmp/kafka

    # Import certificates into keystore and truststore
    # $1 = trusted certs, $2 = TLS auth cert, $3 = TLS auth key, $4 = truststore path, $5 = keystore path, $6 = certs and key path
    kafka_mirror_maker_tls_prepare_certificates.sh \
        "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_CONSUMER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_CERT_CONSUMER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_KEY_CONSUMER" \
        "/tmp/kafka/consumer.truststore.p12" \
        "/tmp/kafka/consumer.keystore.p12" \
        "/opt/kafka/consumer-certs"

    kafka_mirror_maker_tls_prepare_certificates.sh \
        "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_PRODUCER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_CERT_PRODUCER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_KEY_PRODUCER" \
        "/tmp/kafka/producer.truststore.p12" \
        "/tmp/kafka/producer.keystore.p12" \
        "/opt/kafka/producer-certs"
fi

# Generate and print the consumer config file
echo "Kafka Mirror Maker consumer configuration:"
./kafka_mirror_maker_consumer_config_generator.sh | tee /tmp/strimzi-consumer.properties
echo ""

# Generate and print the producer config file
echo "Kafka Mirror Maker producer configuration:"
./kafka_mirror_maker_producer_config_generator.sh | tee /tmp/strimzi-producer.properties
echo ""

# Disable Kafka's GC logging (which logs to a file)...
export GC_LOG_ENABLED="false"<commit_msg>Fixed command not found error<commit_after>#!/bin/bash

if [ -n "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_CONSUMER" ] || [ -n "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_PRODUCER" ]; then
    # Generate temporary keystore password
    export CERTS_STORE_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)

    mkdir -p /tmp/kafka

    # Import certificates into keystore and truststore
    # $1 = trusted certs, $2 = TLS auth cert, $3 = TLS auth key, $4 = truststore path, $5 = keystore path, $6 = certs and key path
    ./kafka_mirror_maker_tls_prepare_certificates.sh \
        "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_CONSUMER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_CERT_CONSUMER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_KEY_CONSUMER" \
        "/tmp/kafka/consumer.truststore.p12" \
        "/tmp/kafka/consumer.keystore.p12" \
        "/opt/kafka/consumer-certs"

    ./kafka_mirror_maker_tls_prepare_certificates.sh \
        "$KAFKA_MIRRORMAKER_TRUSTED_CERTS_PRODUCER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_CERT_PRODUCER" \
        "$KAFKA_MIRRORMAKER_TLS_AUTH_KEY_PRODUCER" \
        "/tmp/kafka/producer.truststore.p12" \
        "/tmp/kafka/producer.keystore.p12" \
        "/opt/kafka/producer-certs"
fi

# Generate and print the consumer config file
echo "Kafka Mirror Maker consumer configuration:"
./kafka_mirror_maker_consumer_config_generator.sh | tee /tmp/strimzi-consumer.properties
echo ""

# Generate and print the producer config file
echo "Kafka Mirror Maker producer configuration:"
./kafka_mirror_maker_producer_config_generator.sh | tee /tmp/strimzi-producer.properties
echo ""

# Disable Kafka's GC logging (which logs to a file)...
export GC_LOG_ENABLED="false"
{'fraction_non_alphanumeric': 0.10348977135980746, 'fraction_numerical': 0.010830324909747292, 'mean_word_length': 3.702970297029703, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3228007', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1276, 'n_words': 223}