Skip to content

Instantly share code, notes, and snippets.

View thepacketgeek's full-sized avatar

Mat Wood thepacketgeek

View GitHub Profile

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@thepacketgeek
thepacketgeek / cleanScapyPacket.py
Created October 4, 2013 16:34
Clean up a scapy packet summary
def cleanPayload(p):
p = str(p)
# Clean up packet payload from scapy output
return p.split('Raw')[0].split("Padding")[0].replace('|','\n').strip('<')\
.strip('bound method Ether.show of ').replace('>','').replace('[<','[')\
.replace('\n<','<').replace('<','\n');
@thepacketgeek
thepacketgeek / python-post-json.py
Last active July 7, 2021 06:51
POST JSON from Python with Requests
import requests
url = "http://localhost:8080"
data = {'sender': 'Alice', 'receiver': 'Bob', 'message': 'We did it!'}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data=json.dumps(data), headers=headers)