Skip to content

Instantly share code, notes, and snippets.

Miek Gieben miekg

Block or report user

Report or block miekg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miekg
miekg / gist:5a1db660a4fc23a34428
Created Jun 7, 2014
Some caching improvements for SkyDNS
View gist:5a1db660a4fc23a34428
master branch:
PASS
BenchmarkDNSSingle 2000 640568 ns/op
BenchmarkDNSWildcard 2000 1184798 ns/op
BenchmarkDNSSECSingle 2000 956796 ns/op
cache branch:
PASS
BenchmarkDNSSingle 5000 716114 ns/op
View gist:4ad2bdeb50ba3a9ef446
110 go func() {
1 if err := s.Run(); err != nil {
2 log.Fatal(err)
3 }
4 }()
View gist:f1b1fe6dba7d6b088eec
diff --git a/parse_test.go b/parse_test.go
index 12de822..5ddb880 100644
--- a/parse_test.go
+++ b/parse_test.go
@@ -1049,7 +1049,7 @@ func TestTXT(t *testing.T) {
}
func TestTypeXXXX(t *testing.T) {
- _, err := NewRR("example.com IN TYPE1234 \\# 4 aabbccdd")
+ _, err := NewRR("example.com IN type1234 \\# 4 aabbccdd")
@miekg
miekg / zbundle
Created Feb 15, 2015
zbundle: bundle code and zip to have one unit of deployment
View zbundle
#!/bin/bash
set -e
getopts "s" show && shift
if [[ $show == "s" ]]; then
while read line; do
hex="$(echo $line | od -N4 -x | head -1)"
byte=(${hex})
if [[ ${byte[1]} == "4b50" && ${byte[2]} == "0403" ]]; then
break
fi
View gist:b8fbbdf58403688bf149
# GIT HOWTO
## Partially Apply Pull Request
#. git checkout -b other-repo-master master
#. git pull https://github.com/other-repo/my-repo-name.git master
#. git checkout master
#. git cherry-pick COMMIT_HASH
## Fetch pull request
@miekg
miekg / learninggo.txt
Last active Sep 3, 2015
"Learning Go" in Internet Draft text format
View learninggo.txt
Go R. Gieben
Internet-Draft January 7, 2015
Intended status: Standards Track
Expires: July 11, 2015
View mmark2rfc.txt
R. Gieben
Atoom
December 10, 2014
Using mmark to create I-Ds and RFCs
@miekg
miekg / gist:921542
Created Apr 15, 2011
example client for async queries in Go DNS
View gist:921542
package main
import (
"dns"
"fmt"
)
func HelloQuery(w dns.RequestWriter, req *dns.Msg, ) {
// client.Attemps = 3
@miekg
miekg / hash.go
Created Jun 11, 2012
Simple hashing and salting algo in Go
View hash.go
package main
import (
"crypto/sha1"
"fmt"
"io"
)
const ITER = 100000
View gist:3075199
package main
import (
"flag"
"fmt"
"github.com/miekg/dns"
"os"
"unbound"
)
You can’t perform that action at this time.