Skip to content

Instantly share code, notes, and snippets.

@tcheneau
tcheneau / tcp-client.c
Last active December 16, 2015 13:49
IPv6 enabled TCP client
/* from the getaddrinfo(3) manual */
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#define BUF_SIZE 500
@tcheneau
tcheneau / license.c
Last active December 16, 2015 10:49
Header for code developed at NIST
/*
* Conditions Of Use
*
* This software was developed by employees of the National Institute of
* Standards and Technology (NIST), and others.
* This software has been contributed to the public domain.
* Pursuant to title 15 United States Code Section 105, works of NIST
* employees are not subject to copyright protection in the United States
* and are considered to be in the public domain.
* As a result, a formal license is not needed to use this software.
@tcheneau
tcheneau / mountchroot.sh
Created April 4, 2013 17:55
Chroot into a Cloonix virtual machine disk image.
#!/bin/sh
losetup /dev/loop1 $1
losetup -o 1048576 /dev/loop2 /dev/loop1
mount /dev/loop2 /media/vm
mount -t proc foo /media/vm/proc
mount -t sysfs foo /media/vm/sys
mount -o bind /dev /media/vm/dev
mount -o bind /selinux /media/vm/selinux
chroot /media/vm
@tcheneau
tcheneau / libnl-3-old-kernel-fix.patch
Created December 11, 2012 16:31
fix for libnl for building libnl3 with old kernel headers
From 25526cfd3af3513ae5fe527cb45688873e06f983 Mon Sep 17 00:00:00 2001
From: Tony Cheneau <tony.cheneau@amnesiak.org>
Date: Mon, 10 Dec 2012 17:22:33 -0500
Subject: [PATCH] Set three constants that are not defined in the old kernel header.
---
lib/netfilter/exp_obj.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/netfilter/exp_obj.c b/lib/netfilter/exp_obj.c