This file contains hidden or 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/sh | |
A='192.168.10.184' | |
B='192.168.10.158' | |
C='192.168.10.142' | |
R='192.168.20.2' | |
S='192.168.20.1' | |
echo "usage on machine A: sh pingall.sh 'A'" | |
me=$1 |
This file contains hidden or 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
{ | |
"metadata": { | |
"name": "FlowQoS_evaluation" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains hidden or 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
#opkg install ip tc kmod-sched | |
INTERFACE=$1 | |
RATELIMIT=$2 | |
RATECEIL=$3 | |
#insmod sch_netem | |
#insmod sch_tbf | |
#insmod sch_htb | |
#insmod sch_prio |
This file contains hidden or 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
from __future__ import division | |
import pandas as pd | |
import decimal | |
data = {'x': [27, 32, 32, 42, 42, 42, 47, 47,47,47,47, 51, 57,57,57,57,57, 62,62,62,62,62,62,62,62], | |
'y': [48, 62, 36.7, 60, 38.4, 67, 62.4, 12.5, 54, 62, 105.9, NaN, 63.8, 66, 66.2, 58.6, 112.3, 50, 91, 49.9, 62.3, 71.6, 104.6, 122.6, 110.1]} | |
df = pd.DataFrame(data) | |
tick = ['26-30', '31-35', '40-45', '46-50', '51-55', '56-60', '61-65'] |
This file contains hidden or 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
def process_wtf(scene, datapath, outputpath): | |
link = scene[-6:-4] | |
if link != 'no': | |
srcip = ip[link[0]] | |
if scene[-1] != '/': | |
scene = scene + '/' | |
if not os.path.exists(outputpath + scene + "processed"): | |
os.makedirs(outputpath + scene + "processed") |
This file contains hidden or 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
def process_wtf(scene, datapath, outputpath): | |
link = scene[-6:-4] | |
if link != 'no': | |
srcip = ip[link[0]] | |
if scene[-1] != '/': | |
scene = scene + '/' | |
if not os.path.exists(outputpath + scene + "processed"): | |
os.makedirs(outputpath + scene + "processed") |
This file contains hidden or 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
uci add firewall rule | |
uci set firewall.@rule[-1].src=wan | |
uci set firewall.@rule[-1].target=ACCEPT | |
uci set firewall.@rule[-1].proto=tcp | |
uci set firewall.@rule[-1].dest_port=22 | |
uci commit firewall | |
/etc/init.d/firewall restart |
This file contains hidden or 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
interface=$1 | |
down_rate=$2 # "mbps", Megabytes per second | |
#HZ=$(grep 'CONFIG_HZ=' /boot/config-$(uname -r) | sed 's/CONFIG_HZ=//') | |
HZ=100 #not sure | |
down_burst=$(((($down_rate * 1000000) / $HZ)/1000)) # "kb", Kilobytes ; a minimum value should be _at least_ one packet, ~2kb, though it is safer with 10kb | |
down_limit=$(((($down_rate * 1000000) / $HZ)/1000)) # "kb", Kilobytes ; a minimum value should be _at least_ one packet, ~2kb, though it issafer with 10kb | |
# first | |
tc qdisc del dev $interface root | |
# add as queueing discipline on eth0 at root | |
# the qdisc is prio (man tc-prio) with two different priority (bands) labeled from 0 to 1 (from 0 to ["bands #" - 1]) |
This file contains hidden or 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
sudo -i | |
groupadd pcap | |
usermod -a -G pcap gtnoise | |
chgrp pcap /usr/sbin/tcpdump | |
chmod 750 /usr/sbin/tcpdump | |
setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump | |
ln -s /usr/sbin/tcpdump /usr/local/bin/tcpdump | |
echo "file_caps=1" >> /boot/grub/menu.lst |
This file contains hidden or 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
clients [192.168.10.*] -- [192.168.10.1] gateway [10.0.2.2] -- [10.0.2.1] magellan [10.0.1.2] -- [10.0.1.1] router [10.0.0.2] -- [10.0.0.1] server [130.207.97.74] -- [*] Internet | |
magellan:/etc/network/interfaces | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback |