Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
DEFAULT_REPEAT = '10'
DEFAULT_CHARS = 16
TEMPLATE_NUMBER = '0123456789'
TEMPLATE_SHORT = TEMPLATE_NUMBER + 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
TEMPLATE_LONG = TEMPLATE_SHORT + '!@#$%^&*()_+|~`\={}[];:<>,./?"\''
$template = TEMPLATE_SHORT
$chars = DEFAULT_CHARS
@oro350
oro350 / 1722-MPEG2-TS.lua
Created January 8, 2014 18:10
Wireshark Dissactor plug-in IEEE1722 (AVTP) IEC61883/IIDC Subtype MPEG2-TS
-- =================================================
-- IEEE1722 for 61883_IIDC_SUBTYPE, MPEG2-TS
-- =================================================
function addfielditem(tree, range, value, table)
for i, fmt in ipairs(table) do
tree:add(fmt, range, value)
end
return range:len()
end
@oro350
oro350 / pcapbpfc.c
Created January 5, 2014 17:16
BPF compiler using libpcap
#include <pcap.h>
#include <unistd.h>
int main(int argc, char **argv)
{
struct bpf_program bpfprog;
int dflag = 0;
int c;
while ((c = getopt(argc, argv, "d")) != -1) {
@oro350
oro350 / rawfilter.c
Created January 5, 2014 15:46
SO_ATTACH_FILTER usage
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <netpacket/packet.h>