<commit_before>#!/bin/sh

# Assumes Tor is not already installed, will overwrite existing configuration.

FTEPROXY_VERSION=0.2.0
ARCH=`arch`
TMP_DIR=/tmp
CODENAME=`lsb_release -sc`

# download+install tor
sh -c "echo \"deb http://deb.torproject.org/torproject.org $CODENAME main\" >> /etc/apt/sources.list"
sh -c "echo \"deb http://deb.torproject.org/torproject.org experimental-$CODENAME main\" >> /etc/apt/sources.list"
gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
apt-get update
apt-get -y install tor
apt-get -y install deb.torproject.org-keyring
curl https://raw.github.com/kpdyer/fteproxy/master/deployment/tor/torrc.server > /etc/tor/torrc

# download+install fte
cd $TMP_DIR
curl https://fteproxy.org/dist/fteproxy/linux/fteproxy-$FTEPROXY_VERSION-linux-$ARCH.tar.gz > fteproxy-$FTEPROXY_VERSION-linux-$ARCH.tar.gz
tar zxvf fteproxy-$FTEPROXY_VERSION-linux-$ARCH.tar.gz
mkdir -p /usr/local/fteproxy/bin
cp -rfv fteproxy-$FTEPROXY_VERSION-linux-$ARCH/* /usr/local/fteproxy/bin/

# restart tor to pickup fte changes
service tor restart<commit_msg>Update fteproxy_install_tor_client.sh<commit_after>#!/bin/sh

# Assumes Tor is not already installed, will overwrite existing configuration.

FTEPROXY_VERSION=0.2.0
ARCH=`arch`
TMP_DIR=/tmp
CODENAME=`lsb_release -sc`

# download+install tor
sh -c "echo \"deb http://deb.torproject.org/torproject.org $CODENAME main\" >> /etc/apt/sources.list"
sh -c "echo \"deb http://deb.torproject.org/torproject.org experimental-$CODENAME main\" >> /etc/apt/sources.list"
gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
apt-get update
apt-get -y install tor
apt-get -y install deb.torproject.org-keyring
curl https://raw.github.com/kpdyer/fteproxy/master/deployment/tor/torrc.server > /etc/tor/torrc

# download+install fte
cd $TMP_DIR
curl https://fteproxy.org/dist/fteproxy/linux/fteproxy-$FTEPROXY_VERSION-linux-$ARCH.tar.gz > fteproxy-$FTEPROXY_VERSION-linux-$ARCH.tar.gz
tar zxvf fteproxy-$FTEPROXY_VERSION-linux-$ARCH.tar.gz
mkdir -p /usr/local/fteproxy/bin
cp fteproxy-$FTEPROXY_VERSION-linux-$ARCH/{fteproxy,fst*} /usr/local/fteproxy/bin/
cp -rfv fteproxy-$FTEPROXY_VERSION-linux-$ARCH/fte /usr/local/fteproxy/bin/
cp fteproxy-$FTEPROXY_VERSION-linux-$ARCH/{README.md,COPYING} /usr/local/fteproxy/

# restart tor to pickup fte changes
service tor restart
{'fraction_non_alphanumeric': 0.13743882544861338, 'fraction_numerical': 0.02202283849918434, 'mean_word_length': 4.717948717948718, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336146', 'n_tokens_mistral': 974, 'n_tokens_neox': 922, 'n_words': 174}