<commit_before>#!/bin/bash
TOKEN=`head -c 30 /dev/urandom | xxd -p`

docker rm  -f  `docker ps -aq`

docker pull dietmarw/notebook

docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
       --name=proxy jupyter/configurable-http-proxy \
       --default-target http://127.0.0.1:9999

docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
       --name=tmpnb \
       -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py \
       --image=dietmarw/notebook

# This adds a reroute to port 80 (needs root privileges)
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 8000<commit_msg>Restrict IPTABLES routing only for destinations for the local host.<commit_after>#!/bin/bash
TOKEN=`head -c 30 /dev/urandom | xxd -p`

docker rm  -f  `docker ps -aq`

docker pull dietmarw/notebook

docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
       --name=proxy jupyter/configurable-http-proxy \
       --default-target http://127.0.0.1:9999

docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
       --name=tmpnb \
       -v /var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py \
       --image=dietmarw/notebook

# This adds a reroute to port 80 (needs root privileges)
iptables -t nat -I PREROUTING -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8000
iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 8000
{'fraction_non_alphanumeric': 0.12926992632283993, 'fraction_numerical': 0.03884795713328868, 'mean_word_length': 2.707196029776675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '2504785', 'n_tokens_mistral': 622, 'n_tokens_neox': 552, 'n_words': 164}