This file contains 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 dgram from 'dgram'; | |
const PCAP_HEADER_PREFIX = Buffer.from("d4c3b2a1020004000000000000000000", "hex"); | |
let ret = { offset: 0 }; | |
const socket = dgram.createSocket({ type: 'udp4', reuseAddr: true }); | |
socket.bind(1234); | |
socket.on('message', (msg, rinfo) => { | |
if ((msg.length === 24) && |
This file contains 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
#!/usr/bin/env python3 | |
import os | |
import sys | |
import json | |
from dateutil import parser | |
import xml.etree.cElementTree as ET | |
from xml.dom import minidom | |
def dt_to_ms(ds): |
This file contains 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
#!/usr/bin/env python3 | |
import json | |
import uuid | |
import sqlite3 | |
import os | |
import sys | |
from datetime import datetime | |
def ms_to_tstamp(ms): | |
dt = datetime.fromtimestamp(ms / 1000.0) |