Skip to content

Instantly share code, notes, and snippets.

@miekg
miekg / learninggo-2.txt
Created August 27, 2018 08:32
Learning Go in RFC 7749 format
Go Working Group R. Gieben
Internet-Draft August 25, 2018
Intended status: Informational
Expires: February 26, 2019
@miekg
miekg / learninggo-2.txt
Created August 27, 2018 08:28
Learning Go (rfc 7749 output)
Go Working Group R. Gieben
Internet-Draft August 25, 2018
Intended status: Informational
Expires: February 26, 2019
Go Working Group R. Gieben
Internet-Draft 25 August 2018
Intended status: Informational
Expires: 26 February 2019
Network Working Group S. Bellovin
Internet-Draft AT&T Labs Research
Expires: 3 October 2018 1 April 2018
The Security Flag in the IPv4 Header
@miekg
miekg / main.go
Created March 17, 2018 15:32
DNS over HTTP/2
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/miekg/dns"
# Makefile for building our Docker containers
#
# You can override ARCH and REGISTRY, the default to "amd64 arm arm64 ppc64le s390x" and "miek"
# If you need to get an asset before building use the asset rule. The asset needs to be copied
# to $(arch):
#
# asset:
# cp $(COREDNS)/coredns $(arch)/coredns
ifeq (, $(shell which manifest-tool))
@miekg
miekg / coredns.yaml
Created January 13, 2018 10:31
CoreDNS kubernetes deployment yaml
apiVersion: v1
kind: Service
metadata:
name: coredns
spec:
ports:
- name: coredns
port: 53
protocol: UDP
targetPort: 53
# Makefile for building our Docker containers
# You can override ARCH and REGISTRY, the default to "amd64 arm arm64 ppc64le s390x" and "miek"
# If you need to get an asset before building use the asset rule. The asset needs to be copied
# to $(arch):
#
# asset:
# cp $(COREDNS)/coredns $(arch)/coredns
ifeq (, $(shell which manifest-tool))
$(error No manifest-tool in $$PATH, install with: "go get github.com/estesp/manifest-tool")
@miekg
miekg / log.diff
Created October 15, 2017 08:33
autopath logging patch
diff --git a/plugin/autopath/autopath.go b/plugin/autopath/autopath.go
index aa3d44e6..f52ee516 100644
--- a/plugin/autopath/autopath.go
+++ b/plugin/autopath/autopath.go
@@ -104,6 +104,8 @@ func (a *AutoPath) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms
ar.Question[0].Name = newQName
nw := nonwriter.New(w)
+ log.Printf("[INFO] Querying %s", newQName)
+
@miekg
miekg / udpserv.c
Created May 10, 2017 10:33
udp server in C
/*
* udpserver.c - A simple UDP echo server
* usage: udpserver <port>
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>