Skip to content

Instantly share code, notes, and snippets.

View chrisnc's full-sized avatar

Chris Copeland chrisnc

View GitHub Profile
@chrisnc
chrisnc / rawudp.go
Last active February 9, 2024 15:29
constructing ip/udp packets in go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
@chrisnc
chrisnc / udp_sock_raw.c
Last active July 16, 2018 13:57
UDP over SOCK_RAW
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
@chrisnc
chrisnc / TrollMonoid.hs
Last active August 29, 2015 14:12
Troll Monoid
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Test.QuickCheck
import Data.Monoid
import Data.Word
newtype Troll = Troll Word64
deriving (Eq, Num, Show, Arbitrary)
t :: Troll
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
module Literals
( eval
, env
, expr
, main
) where