Skip to content

Instantly share code, notes, and snippets.

View charlesmcchan's full-sized avatar

Charles Chan charlesmcchan

View GitHub Profile
<?
header("Last-Modified: Fri, 18 Mar 2011 05:24:04 GMT ");
srand();
?>
<b><font color="#aa0000">ICN Project 1</font></b><br>
<?
$padding = rand(90,490);
for($i=0; $i<$padding; ++$i){
printf("%s", dechex(rand(0,15)));
}
@charlesmcchan
charlesmcchan / mptcp-test.py
Created February 19, 2014 13:34
MPTCP test environment
#!/usr/bin/python
import sys
from time import sleep
from math import sqrt
import argparse
from subprocess import Popen, PIPE
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.topo import Topo
from mininet.log import lg
#data = [1, 2, 3, 4, 4, 4]
#data = [1, 1, 2, 2, 3, 3]
#data = [5, 6, 9, 7, 7]
data = [1,2,1,2,3,3,3] # special case len(stack==3)
#data = [2,2,3,3,3,3,4,4] # special case len(stack==0)
#data = [1,1,2,2,3,3,4,4] # special case len(stack==0)
stack = []
# O(n)
import httplib
import json
class REST(object):
def __init__(self, server):
self.server = server
def get(self, path):
ret = self.rest_call(path, {}, 'GET')
return json.loads(ret[2])