Skip to content

Instantly share code, notes, and snippets.

View longbai's full-sized avatar

Bai Loong longbai

  • Qiniu Cloud Storage
  • Shanghai
View GitHub Profile
@longbai
longbai / hosts2dnsmasq
Last active August 29, 2015 14:04
hosts to dnsmasq
awk -F ' ' 'BEGIN{OFS=""}{if ($0 ~ /^#/) {print}else if (length($0)==0){print}else{print "address=/",$2,"/",$1," ",$3}}'
package main
import (
"crypto/tls"
"net"
"net/http"
"time"
"fmt"
"errors"
)