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 | |
# | |
# Originally part of vpnc source code: | |
# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al. | |
# © 2009-2012 David Woodhouse <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
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
import dpkt, pcap | |
pc = pcap.pcap('lo') | |
pc.setfilter('tcp and dst host 127.0.0.1 and port 8080 and tcp[tcpflags] & (tcp-push) != 0') | |
for timestamp, packet in pc: | |
print repr(dpkt.ethernet.Ethernet(packet)) |
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
import time | |
import os | |
import zipfile | |
N = 100000 | |
archive = zipfile.ZipFile('something.zip', 'w') | |
print 'Generating messages' | |
messages = [os.urandom(1024) for i in range(N)] |
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
import time | |
import pika | |
from pika.adapters import SelectConnection | |
N = 10000 | |
channel = None | |
count = 0 | |
start = None |