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: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"
)
@miekg
miekg / ztot.go
Created Jul 11, 2012
Create trace from zonefile
View ztot.go
package main
import (
"github.com/miekg/dns"
"flag"
"github.com/miekg/pcap"
"os"
)
@miekg
miekg / query.go
Created Oct 19, 2012
try to query a domain
View query.go
package main
import (
"fmt"
"github.com/miekg/dns"
"math/rand"
"os"
"time"
)
View getrfc
#!/bin/zsh
# Retrieve RFC and/or drafts. By Miek Gieben (c) 2012, licensed under the GPL v2.
# RFC urls
# http://tools.ietf.org/pdf/rfc5737
# http://tools.ietf.org/rfc/rfc5737.txt
# Draft urls
# http://tools.ietf.org/id/draft-gieben-auth-denial-of-existence-dns-00.txt
# http://tools.ietf.org/pdf/draft-gieben-auth-denial-of-existence-dns-00.txt
@miekg
miekg / gist:4078673
Created Nov 15, 2012
% ./q nul\\000gap.test.globnix.net
View gist:4078673
% ./q nul\\000gap.test.globnix.net
;; opcode: QUERY, status: NOERROR, id: 4386
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 6
;; QUESTION SECTION:
;nul\000gap.test.globnix.net. IN A
;; ANSWER SECTION:
nul\000gap.test.globnix.net. 60 IN A 192.0.2.10
@miekg
miekg / gist:4466456
Created Jan 6, 2013
run go test, when the file end in _test.go otherwise go build. Use in vim: autocmd Filetype go set makeprg=gobuildtest\ %
View gist:4466456
#!/bin/zsh
filename=$1;shift
case $filename in
*_test.go) go test "$@";;
*) go build "$@";;
esac
View asn.go
package main
import (
"encoding/json"
"github.com/miekg/bitradix"
"log"
"net"
"os"
"reflect"
)
@miekg
miekg / x
Created Feb 6, 2013
tld-dnssec-check
View x
for tld in $(awk ' { print $1 }' root-zone | egrep '^[a-z0-9-]+\.$' | sort -u); do
echo -n $tld:
if dig +dnssec DNSKEY $tld | grep -q RRSIG; then
echo -n DNSSEC:
else
echo -n dnssec:
fi
echo $(dig +noall +answer ${tld}cc.jpmens.net txt | awk ' { print $5" "$6" "$7" "$
You can’t perform that action at this time.