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
View Makefile.inc
# 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 Oct 15, 2017
autopath logging patch
View log.diff
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
udp server in C
View udpserv.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>
@miekg
miekg / udpserv.go
Created May 10, 2017
Simple udp server in Go
View udpserv.go
package main
import (
"log"
"net"
)
func main() {
// listen to incoming udp packets
pc, err := net.ListenPacket("udp", ":1053")
View gist:e80d2eadfea48422178cdbaaf9f8a33f
diff --git a/udp_linux.go b/udp_linux.go
index 033df42..e1f9be8 100644
--- a/udp_linux.go
+++ b/udp_linux.go
@@ -44,18 +44,25 @@ func setUDPSocketOptions4(conn *net.UDPConn) error {
if err != nil {
return err
}
+ defer file.Close()
+
View gist:9d3ee284720586aea8fbe079bfb63fed
Apr 06 10:16:00 kube kubelet[4369]: W0406 10:16:00.202137 4369 container_manager_linux.go:218] Running with swap on is not supported, please disable swap! This will be a fatal error by default starting in K8s v1.6! In the meantime, you can opt-in to making this a fatal error by enabling --experimental-fail-swap-on.
Apr 06 10:16:40 kube kubelet[5117]: error: failed to run Kubelet: invalid kubeconfig: stat /etc/kubernetes/kubelet.conf: no such file or directory
Apr 06 10:16:51 kube kubelet[5148]: W0406 10:16:51.106208 5148 container_manager_linux.go:218] Running with swap on is not supported, please disable swap! This will be a fatal error by default starting in K8s v1.6! In the meantime, you can opt-in to making this a fatal error by enabling --experimental-fail-swap-on.
Apr 06 11:18:59 kube kubelet[6108]: error: failed to run Kubelet: invalid kubeconfig: stat /etc/kubernetes/kubelet.conf: no such file or directory
Apr 06 11:19:09 kube kubelet[6144]: W0406 11:19:09.575408 6144 container_manager_linux.
View gist:1820606d16444ab92c8fee84fb271b1f
Apr 06 10:16:00 kube kubelet[4369]: W0406 10:16:00.202137 4369 container_manager_linux.go:218] Running with swap on is not supported, please disable swap! This will be a fatal error by default starting in K8s v1.6! In the meantime, you can opt-in to making this a fatal error by enabling --experimental-fail-swap-on.
Apr 06 10:16:40 kube kubelet[5117]: error: failed to run Kubelet: invalid kubeconfig: stat /etc/kubernetes/kubelet.conf: no such file or directory
Apr 06 10:16:51 kube kubelet[5148]: W0406 10:16:51.106208 5148 container_manager_linux.go:218] Running with swap on is not supported, please disable swap! This will be a fatal error by default starting in K8s v1.6! In the meantime, you can opt-in to making this a fatal error by enabling --experimental-fail-swap-on.
Apr 06 11:18:59 kube kubelet[6108]: error: failed to run Kubelet: invalid kubeconfig: stat /etc/kubernetes/kubelet.conf: no such file or directory
Apr 06 11:19:09 kube kubelet[6144]: W0406 11:19:09.575408 6144 container_manager_linux.
View gist:f15566630ce752cc3d4ad3c563bce2f9
Colleague1: We should just quit and start a farm.
Me: Oh yeah, just some animals and nothing else.
Colleague2: Yes, sounds great.
Me: But, you know how it goes. Soon you'll buy a laptop.
Next, you'll fix the WiFi. Before you're know it, you're doing the same shit.
C2: Yes, you're doing the same shit *and* you have to take care of these fucking animals as well!
View coredns_proxy.md

CoreDNS Proxy

This Corefile allows most names to be proxied to Google using https/json, but some local names used in my network are forwarded to my router. Yes, for some reason my local DNS does not use a proper domain, but default to root. I've also haven't found a way to change this...

. {
	proxy . 8.8.8.8:53 {
    except raspberrypi higgs libreelec gluon brik flo
@miekg
miekg / parseSRV.go
Created Dec 23, 2016
parse server records
View parseSRV.go
package main
import (
"fmt"
"github.com/miekg/dns"
)
func main() {
fmt.Println("vim-go")
You can’t perform that action at this time.