Skip to content

Instantly share code, notes, and snippets.

@joviniko
joviniko / pcap_modulo.py
Created August 13, 2019 15:40
Export every n-th packet to a new pcap file. Similar to sFlow https://en.wikipedia.org/wiki/SFlow
import sys
import struct
if len(sys.argv) != 4 or not str.isdigit(sys.argv[3]):
print("Usage: python " + sys.argv[0] + " input.pcap output.pcap 100")
sys.exit("Arguments error. Expected: input.pcap output.pcap packet-modulo-integer")
"""
pcap file format library
2010-01 ZHAW, Martin Renold
@joviniko
joviniko / scores.pl
Last active June 20, 2018 22:07
Funktionale Programmierung scores perlscript WS2013
#!/usr/bin/perl
# vim:set sw=4 sts=4 et smartindent:
# Hier die Anzahl der Aufgaben setzen
my $numOfUe = 8;
use strict;
use File::Basename;
my @files = `ls *.out` or die;