<commit_before>#!/bin/bash

# Set defaults:
: ${LOCAL_PORT:=7890}
: ${ANDROID_SOCK:=vpntether}

: ${EXT_DEV:=eth0}
: ${TUN_DEV:=tun0}

: ${DNS:=8.8.8.8}

: ${SESSION_NAME:=$USER}  # Useful only for the notification.

: ${MODE:=unix}

case $MODE in
  tcp)
LOCAL_ADDR=$LOCAL_PORT
LOCAL_ADDR_FORWARD=tcp:$LOCAL_PORT
  ;;
  unix)
LOCAL_ADDR="$ANDROID_SOCK"
LOCAL_ADDR_FORWARD=localfilesystem:$LOCAL_ADDR
  ;;
esac

# export ADB=/path/to/sdk/adb for custom adb
ADB="${ADB:-adb} ${SERIAL:+-s $SERIAL}"

MTU=`cat /sys/class/net/$EXT_DEV/mtu`

TUN_IP=10.0.0.2

setup() {
  sudo ip tuntap add dev $TUN_DEV mode tun

  # NAT mode
  sudo sysctl -w net.ipv4.ip_forward=1
  sudo iptables -t nat -F<commit_msg>Default to tcp mode<commit_after>#!/bin/bash

# Set defaults:
: ${LOCAL_PORT:=7890}
: ${ANDROID_SOCK:=vpntether}

: ${EXT_DEV:=eth0}
: ${TUN_DEV:=tun0}

: ${DNS:=8.8.8.8}

: ${SESSION_NAME:=$USER}  # Useful only for the notification.

: ${MODE:=tcp}

case $MODE in
  tcp)
LOCAL_ADDR=$LOCAL_PORT
LOCAL_ADDR_FORWARD=tcp:$LOCAL_PORT
  ;;
  unix)
LOCAL_ADDR="$ANDROID_SOCK"
LOCAL_ADDR_FORWARD=localfilesystem:$LOCAL_ADDR
  ;;
esac

# export ADB=/path/to/sdk/adb for custom adb
ADB="${ADB:-adb} ${SERIAL:+-s $SERIAL}"

MTU=`cat /sys/class/net/$EXT_DEV/mtu`

TUN_IP=10.0.0.2

setup() {
  sudo ip tuntap add dev $TUN_DEV mode tun

  # NAT mode
  sudo sysctl -w net.ipv4.ip_forward=1
  sudo iptables -t nat -F
{'fraction_non_alphanumeric': 0.1732283464566929, 'fraction_numerical': 0.024337866857551897, 'mean_word_length': 4.637096774193548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '2685739', 'n_tokens_mistral': 667, 'n_tokens_neox': 620, 'n_words': 114}