This file contains 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
# create container, important bit is "--net=none" | |
CID=$(docker run -d --net=none ubuntu-upstart /sbin/init) | |
# get pid of main proccess | |
PID=$(docker inspect -f '{{.State.Pid}}' $CID) | |
# what ip we want for container | |
IP="192.168.20.167/24 broadcast 192.168.20.255" | |
# what gateway we shoud use | |
GATEWAY="192.168.20.1" | |
# main magic |
This file contains 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 ( | |
zmq "github.com/pebbe/zmq4" | |
"log" | |
) | |
func main() { | |
subscriber, _ := zmq.NewSocket(zmq.SUB) | |
subscriber.Connect("localhost:1234") |
This file contains 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 | |
// Inspired by https://github.com/tianon/rawdns | |
import ( | |
"flag" | |
"log" | |
"net" | |
"os" | |
"os/signal" |
This file contains 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 ( | |
"fmt" | |
"time" | |
"runtime" | |
"compress/zlib" | |
"io" | |
"os" | |
"os/signal" |