<commit_before>###################################################################
## seedbox-installer.sh
## A simple script created by <NAME> to create a fully
## functional seedbox for getting and sharing torrented files
## from a base Ubuntu install.
## Installs transmission, csf, and flexget
## Does configuration so that transmission/flexget can communicate
## and keeps csf from getting in the way.
###################################################################
#!/bin/bash

## Please personalize the following three values!
TRANSMISSION_USERNAME=swarm_user
TRANSMISSION_PASSWORD=<PASSWORD>
TRANSMISSION_PORT=9091

## If you appreciate a low-fi monitoring setup change these values.
ADD_SNMPD=false
SNMPD_COMMUNITY=public
SNMPD_REMOTE_IP=localhost

# Update to current.
apt-get update -y
apt-get upgrade -y

# Start install for transmission.
aptitude install python-software-properties -y
apt-get install software-properties-common -y
add-apt-repository ppa:transmissionbt -y

aptitude update
aptitude install transmission-daemon -y
perl -pi -e 's/"rpc-whitelist-enabled": true,/"rpc-whitelist-enabled": false,/' /etc/transmission-daemon/settings.json
perl -pi -e "s/\"rpc-port\": 9091,/\"rpc-port\": $TRANSMISSION_PORT,/" /etc/transmission-daemon/settings.json
perl -pi -e "s/\"rpc-username(.)+/\"rpc-username\": \"$TRANSMISSION_USERNAME\",/g" /etc/transmission-daemon/settings.json
perl -pi -e "s/\"rpc-password(.)+/\"rpc-password\": \"$<PASSWORD>\",/g" /etc/transmission-daemon/settings.json
perl -pi -e 's/"trash-original-torrent-files": false, /"trash-original-torrent-files": true,/' /etc/transmission-daemon/settings.json
# Add lines to keep and eye on the watch directory.
perl -pi -e 's/"utp-enabled": true/"utp-enabled": true,/' /etc/transmission-daemon/settings.json
sed -i "s#}# \"watch-dir\": \"/var/lib/transmission-daemon/watch/\",\n}#" settings.json
sed -i "s#}# \"watch-dir-enabled\": true\n}#" settings.json

# restart transmission with the new settings this way, or settings
# will be reverted to their previous state
pkill -HUP transmission-da

# Install and configure flexget.
cd ~/
python -V
apt-get install python-pip -y
pip install flexget
which flexget
pwd
mkdir .flexget/909
cd .flexget
vi config.yml
which flexget

# Create a directory to hold our flexgotten torrent files.
mkdir /var/lib/transmission-daemon/watch
chmod 777 /var/lib/transmission-daemon/watch

crontab -l | { cat; echo "* * * * * /usr/local/bin/flexget execute --cron"; } | crontab -

# Install csf firewall, from http://www.configserver.com/free/csf/install.txt file.
mkdir ~/csf-install
cd ~/csf-install
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
<commit_msg>Realized that if we are installing SNMPD, might as well tell the firewall to give the monitoring IP access on default.<commit_after>###################################################################
## seedbox-installer.sh
## A simple script created by <NAME> to create a fully
## functional seedbox for getting and sharing torrented files
## from a base Ubuntu install.
## Installs transmission, csf, and flexget
## Does configuration so that transmission/flexget can communicate
## and keeps csf from getting in the way.
###################################################################
#!/bin/bash

## Please personalize the following three values!
TRANSMISSION_USERNAME=swarm_user
TRANSMISSION_PASSWORD=<PASSWORD>
TRANSMISSION_PORT=9091

## If you appreciate a low-fi monitoring setup change these values.
ADD_SNMPD=false
SNMPD_COMMUNITY=public
SNMPD_REMOTE_IP=localhost

# Update to current.
apt-get update -y
apt-get upgrade -y

# Start install for transmission.
aptitude install python-software-properties -y
apt-get install software-properties-common -y
add-apt-repository ppa:transmissionbt -y

aptitude update
aptitude install transmission-daemon -y
perl -pi -e 's/"rpc-whitelist-enabled": true,/"rpc-whitelist-enabled": false,/' /etc/transmission-daemon/settings.json
perl -pi -e "s/\"rpc-port\": 9091,/\"rpc-port\": $TRANSMISSION_PORT,/" /etc/transmission-daemon/settings.json
perl -pi -e "s/\"rpc-username(.)+/\"rpc-username\": \"$TRANSMISSION_USERNAME\",/g" /etc/transmission-daemon/settings.json
perl -pi -e "s/\"rpc-password(.)+/\"rpc-password\": \"$<PASSWORD>\",/g" /etc/transmission-daemon/settings.json
perl -pi -e 's/"trash-original-torrent-files": false, /"trash-original-torrent-files": true,/' /etc/transmission-daemon/settings.json
# Add lines to keep and eye on the watch directory.
perl -pi -e 's/"utp-enabled": true/"utp-enabled": true,/' /etc/transmission-daemon/settings.json
sed -i "s#}# \"watch-dir\": \"/var/lib/transmission-daemon/watch/\",\n}#" settings.json
sed -i "s#}# \"watch-dir-enabled\": true\n}#" settings.json

# restart transmission with the new settings this way, or settings
# will be reverted to their previous state
pkill -HUP transmission-da

# Install and configure flexget.
cd ~/
python -V
apt-get install python-pip -y
pip install flexget
which flexget
pwd
mkdir .flexget/909
cd .flexget
vi config.yml
which flexget

# Create a directory to hold our flexgotten torrent files.
mkdir /var/lib/transmission-daemon/watch
chmod 777 /var/lib/transmission-daemon/watch

crontab -l | { cat; echo "* * * * * /usr/local/bin/flexget execute --cron"; } | crontab -

# Install csf firewall, from http://www.configserver.com/free/csf/install.txt file.
mkdir ~/csf-install
cd ~/csf-install
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
# If they specified an SNMPD server, allow it through the firewall
{'fraction_non_alphanumeric': 0.17498658078368223, 'fraction_numerical': 0.0050098407586330294, 'mean_word_length': 4.595595595595595, 'pattern_counts': {'":': 24, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '3058587', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1771, 'n_words': 525}