Skip to content

Instantly share code, notes, and snippets.

@d0x2f
d0x2f / .drone.yml
Last active August 17, 2021 22:18
.drone.yml example
workspace:
base: /build
pipeline:
dbnode1:
detach: true
image: mysql/mysql-cluster:7.5
commands:
- sleep 5
@teknoraver
teknoraver / unixhttpc.go
Last active March 21, 2024 11:48
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@cynddl
cynddl / test_cas_client.go
Last active August 29, 2015 14:07
Testing a simple CAS authentication
package main
import (
"net/http"
"net/url"
"io/ioutil"
"log"
"strings"
@laher
laher / loadchain.go
Last active September 25, 2022 04:16
how to load a certificate chain in Go. See how https://github.com succeeds and https://facebook.com fails.
package main
import (
"fmt"
"net/http"
"crypto/tls"
"crypto/x509"
"encoding/pem"
)
var chain=`-----BEGIN CERTIFICATE-----
MIIG5jCCBc6gAwIBAgIQAze5KDR8YKauxa2xIX84YDANBgkqhkiG9w0BAQUFADBs
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 sd@fucksheep.org, salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/
@messense
messense / shadowsocks-on-openwrt.md
Last active June 8, 2023 07:49
shadowsocks on openwrt

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@nictuku
nictuku / sshd.go
Created April 8, 2012 15:43
Go SSH server complete example
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh/terminal"