<commit_before>#!/bin/bash

usage() { echo "Usage: $0 -h <trojan-host> -w <password> [-p <port-number>]" 1>&2; exit 1; }

while getopts ":d:h:p:w:" o; do
	case "${o}" in
		h)
			TJHOST="$(echo -e "${OPTARG}" | tr -d '[:space:]')"
			;;
		p)
			TJPORT="$(echo -e "${OPTARG}" | tr -d '[:space:]')"
			;;
		w)
			PASSWORD="$(echo -e "${OPTARG}" | tr -d '[:space:]')"
			;;
		*)
			usage;
	esac
done

if [ -z "${TJHOST}" ] || [ -z "${PASSWORD}" ]; then
	usage
fi

if [ -z "${TJPORT}" ]; then
	TJPORT=443
fi

shift $((OPTIND-1))

cat /trojan/examples/client.json-example  \
	| jq " .\"local_addr\" |= \"0.0.0.0\" " \
	| jq " .\"local_port\" |= 1080 " \<commit_msg>remove -d option<commit_after>#!/bin/bash

usage() { echo "Usage: $0 -h <trojan-host> -w <password> [-p <port-number>]" 1>&2; exit 1; }

while getopts ":h:p:w:" o; do
	case "${o}" in
		h)
			TJHOST="$(echo -e "${OPTARG}" | tr -d '[:space:]')"
			;;
		p)
			TJPORT="$(echo -e "${OPTARG}" | tr -d '[:space:]')"
			;;
		w)
			PASSWORD="$(echo -e "${OPTARG}" | tr -d '[:space:]')"
			;;
		*)
			usage;
	esac
done

if [ -z "${TJHOST}" ] || [ -z "${PASSWORD}" ]; then
	usage
fi

if [ -z "${TJPORT}" ]; then
	TJPORT=443
fi

shift $((OPTIND-1))

cat /trojan/examples/client.json-example  \
	| jq " .\"local_addr\" |= \"0.0.0.0\" " \
	| jq " .\"local_port\" |= 1080 " \
{'fraction_non_alphanumeric': 0.2835481425322214, 'fraction_numerical': 0.024260803639120546, 'mean_word_length': 2.75, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '309314', 'n_tokens_mistral': 666, 'n_tokens_neox': 588, 'n_words': 142}