Skip to content

Instantly share code, notes, and snippets.

@miekg
miekg / learninggo.txt
Last active September 3, 2015 21:37
"Learning Go" in Internet Draft text format
Go R. Gieben
Internet-Draft January 7, 2015
Intended status: Standards Track
Expires: July 11, 2015
# 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 / zbundle
Created February 15, 2015 15:45
zbundle: bundle code and zip to have one unit of deployment
#!/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
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")
110 go func() {
1 if err := s.Run(); err != nil {
2 log.Fatal(err)
3 }
4 }()
@miekg
miekg / gist:5a1db660a4fc23a34428
Created June 7, 2014 07:03
Some caching improvements for SkyDNS
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
@miekg
miekg / 14-add-lockaftersleep-patch
Created March 8, 2014 13:14
add -lockaftersleep to xautolock
Description: Add -lockaftersleep
Lock the moment the machine comes out of sleep.
.
xautolock (1:2.2-4) unstable; urgency=low
.
* debian/control:
- Removed xautolock from Recommends since it was removed from Debian
- Standards-Version: 3.9.4
- Depends: debhelper (>= 9)
* debian/compat: 9
@miekg
miekg / gist:8149674
Created December 27, 2013 17:04
q has regained the ability to look at NSEC3 records. Usable, but rough around the edges. More stuff coming.
% ./q -check -dnssec dsdksldkskd.nl
;+ Secure signature, 7um0qsaocsaqtmhof0hkbk9th6ek5ce9.nl. RRSIG(NSEC3) validates (DNSKEY nl./54171/net)
;+ Secure signature, sk4e8fj94u78smusb40o1n0oltbblu2r.nl. RRSIG(NSEC3) validates (DNSKEY nl./54171/net)
;+ Secure signature, t98kg1p1cjtdoc4ksb7g57jc9vulltcd.nl. RRSIG(NSEC3) validates (DNSKEY nl./54171/net)
;+ Secure signature, nl. RRSIG(SOA) validates (DNSKEY nl./54171/net)
;+ Denial, closest encloser, nl. (sk4e8fj94u78smusb40o1n0oltbblu2r)
;+ Denial, next closer dsdksldkskd.nl. (7um0qsaocsaqtmhof0hkbk9th6ek5ce9.nl.), covered by 7UM22A80THPR89UNASIDE8K6IHNVVAJ7 -> sk4e8fj94u78smusb40o1n0oltbblu2r
;+ Denial, source of synthesis *.nl. (t98kg1p1cjtdoc4ksb7g57jc9vulltcd.nl.), covered by T98MULSKU3E499AGCTTRJK6H0L3E5T92 -> sk4e8fj94u78smusb40o1n0oltbblu2r
;+ Denial, secure authenticated denial of existence proof for name error
Using <http://www.iana.org/domains/root/db> as the definition for country codes, the IANA pages for the registration date and some shell foo, this is the list of ccTLD registration:
arpa: 1985-01-01.
arpa: 1985-01-01.
com: 1985-01-01.
com: 1985-01-01.
mil: 1985-01-01.
net: 1985-01-01.
net: 1985-01-01.
us: 1985-02-15.
@miekg
miekg / gist:6478416
Created September 7, 2013 19:18
Compile libcairo for Ubuntu Raring
http://packages.ubuntu.com/saucy/libcairo2;
#download sources;
sudo apt-get build-dep libcairo2;
dpkg-source -x cairo_1.12.16-0ubuntu1.dsc;
cd cairo-*;
dpkg-buildpackage -rfakeroot -us -uc;
#install debs