Skip to content

Instantly share code, notes, and snippets.

View minhtt159's full-sized avatar

Minh Trần minhtt159

View GitHub Profile
@comex
comex / wormdump.c
Created April 9, 2015 06:07
Some old broken code in case it helps anyone
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/kern_event.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <net/ethernet.h>
@amorton
amorton / gist:1024636
Created June 14, 2011 10:17
Diff the files in a directory using Python
#used as part of a unit test
def _compare_directories(self, expected_dir, actual_dir, header=None):
"""Compares two directories and diffs any different files.
The file list of both directories must match and the files must match.
Sub directories are not considered as I don't need to in my case.
The diff will not show that a file was deleted from one side. It shows
that all the lines were removed.