This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
KEYDIR=/etc/bind/external/keys | |
DSDIR=/etc/bind/external/ds | |
ZONES="miek.nl atoom.net dnssex.nl dnsex.nl" | |
cd "$1" | |
for z in $ZONES; do | |
if [ -e $z.nsec3 ]; then | |
# sign with NSEC3 | |
/usr/sbin/dnssec-signzone -P $(grep -v '^\#' $z.nsec3) -N \ | |
unixtime -K $KEYDIR -d $DSDIR -o $z -S $z >/dev/null 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shorten path -> /home/miekg/bla -> /h/m/bla | |
function shorten() { | |
full=$(print -P "$1") | |
a=(${(s:/:)full}) | |
if [[ $#a -eq 0 || $#a -eq 1 ]]; then | |
print $1; return | |
fi | |
last=$a[$#a] | |
a[$#a]= # clear last element | |
for i in $a; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In earlier versions of this makefile, the other two directories were | |
# subdirectories of $(TZDIR). However, this led to configuration errors. | |
# For example, with posix_right under the earlier scheme, | |
# TZ='right/Australia/Adelaide' got you localtime with leap seconds, | |
# but gmtime without leap seconds, which led to problems with applications | |
# like sendmail that subtract gmtime from localtime. | |
# Therefore, the other two directories are now siblings of $(TZDIR). | |
# You must replace all of $(TZDIR) to switch from not using leap seconds | |
# to using them, or vice versa. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make() { | |
if [[ -f Makefile || -f GNUMakefile ]]; then | |
command make "$@" | |
return | |
fi | |
go build | |
# if go build failed with exit code 1, the build env wasn't | |
# correct, in that case, try make again | |
if [[ $? -eq 1 ]]; then | |
command make "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fruit Price Advantages | |
----- ----- ---------- | |
Bananas $1.34 built-in wrapper | |
Apples $0.10 cures scurvy | |
Bananas $0.73 scurvy | |
Oranges $2.10 cures scurvy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fruit | Price | Advantages | | |
--------------------------------------- | |
Bananas | $1.34 | built-in wrapper | | |
Apples | $0.10 | cures scurvy | | |
Bananas | $0.73 | scurvy | | |
Oranges | $2.10 | cures scurvy | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# See /usr/share/doc/unbound/examples/unbound.conf for a commented | |
# reference config file. | |
server: | |
# The following line will configure unbound to perform cryptographic | |
# DNSSEC validation using the root trust anchor. | |
auto-trust-anchor-file: "/var/lib/unbound/root.key" | |
do-not-query-localhost: no | |
local-zone: "168.192.in-addr.arpa" transparent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" "$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"github.com/miekg/bitradix" | |
"log" | |
"net" | |
"os" | |
"reflect" | |
) |