This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/storage/xbin/bash | |
# This script should help forward VPN over any tethered connection on a Android device. Turn on tethering, then enable VPN, then run this script. | |
# Inital variable setup | |
tethering=0 | |
# Setup iptables before forwarding VPN | |
iptables -A POSTROUTING -o tun0 -j MASQUERADE -t nat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import re | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Client side implementation of UDP client-server model | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Server side implementation of UDP client-server model | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net" | |
"sync" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net" | |
"sync" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io/ioutil" | |
"fmt" | |
"sync" | |
"time" | |
"net" | |
"log" | |
"flag" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
container=$1 | |
interface=$2 | |
iflink=$(lxc exec $1 cat /sys/class/net/$2/iflink) | |
veth=$(grep -l $iflink /sys/class/net/veth*/ifindex) | |
veth=$(echo $veth|sed -e 's;^.*net/\(.*\)/ifindex$;\1;') | |
echo $veth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST_PER_NODE=2 | |
SWITCH_NUM=3 | |
FIREWALL_NUM=3 | |
WEBSERVER_NUM=1 | |
HOST_TEMPLATE_NAME="host" | |
SWITCH_TEMPLATE_NAME="ovs" | |
ROUTER_TEMPLATE_NAME="router" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST_PER_NODE=2 | |
SWITCH_NUM=3 | |
FIREWALL_NUM=3 | |
WEBSERVER_NUM=1 | |
HOST_TEMPLATE_NAME="host" | |
SWITCH_TEMPLATE_NAME="ovs" | |
WEBSERVER_TEMPLATE_NAME="webserver" |