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
transport := &http.Transport{ | |
Proxy: http.ProxyFromEnvironment, | |
DialContext: (&net.Dialer{ | |
Timeout: 5 * time.Second, | |
KeepAlive: 30 * time.Second, | |
}).DialContext, | |
TLSHandshakeTimeout: 5 * time.Second, | |
ExpectContinueTimeout: 5 * time.Second, | |
ResponseHeaderTimeout: 7 * time.Second, | |
IdleConnTimeout: 5 * time.Second, |
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 | |
LUAVER=5.4.0 | |
LIBSLZVER=ff537154e7f5f2fffdbef1cd8c52b564c1b00067 | |
PCRE2VER=10.35 | |
OPENSSLVER=1.1.1g | |
HAPROXYVER=2.2.2 | |
PREFIX=/tmp/opt | |
CURDIR=${PWD} |
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
FROM centos:7 | |
ENV container docker | |
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | |
rm -f /lib/systemd/system/multi-user.target.wants/*; \ | |
rm -f /etc/systemd/system/*.wants/*; \ | |
rm -f /lib/systemd/system/local-fs.target.wants/*; \ | |
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | |
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ |
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
ca-bundle.crt: mk-ca-bundle.pl | |
perl mk-ca-bundle.pl -f -u -q | |
mk-ca-bundle.pl: | |
curl -LOs https://github.com/curl/curl/raw/master/lib/mk-ca-bundle.pl |
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 ( | |
"bytes" | |
"crypto/tls" | |
"io" | |
"net" | |
"time" | |
) |
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
// Ref. https://medium.com/capital-one-tech/learning-to-use-go-reflection-822a0aed74b7 | |
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
type CustomType struct { |
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 ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"net/http/cgi" | |
"os" | |
"path" |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# open utun device in OS X | |
# Refs: | |
# - https://github.com/python/cpython/blob/master/Modules/socketmodule.c | |
# - https://opensource.apple.com/source/xnu/xnu-4570.31.3/bsd/sys/kern_control.h.auto.html | |
# - https://opensource.apple.com/source/xnu/xnu-344.49/bsd/sys/sys_domain.h.auto.html | |
# - https://opensource.apple.com/source/xnu/xnu-2782.20.48/bsd/net/if_utun.h.auto.html | |
# |
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
escape() { | |
sed -e 's/[]\/$*.^[]/\\&/g' <<<"${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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"net/http" |