Skip to content

Instantly share code, notes, and snippets.

@snail007
snail007 / gist:d4805ba808205cf4ab26562dd944c5db
Created October 16, 2018 10:56 — forked from windwiny/gist:c85dd8c2571b4374f874
Linux 基于策略的路由(Linux Policy Routing)(Linux 多个网卡使用相同网段的IP地址设置)
----
Linux 基于策略的路由(Linux Policy Routing)
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部
ip rule
@snail007
snail007 / cgo.md
Created January 11, 2018 08:21 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@snail007
snail007 / blocked
Last active September 10, 2017 14:32
My cow direct & blocked file for g*f*w
0rz.tw
0to255.com
0zz0.com
1-apple.com.tw
1000dosok.ru
1000giri.net
1024.inc.gs
10conditionsoflove.com
10musume.com
10youtube.com
@snail007
snail007 / client.go
Last active August 18, 2017 03:09 — forked from xjdrew/client.go
golang tls client and server, require and verify certificate in double direction,golang tls 双向验证
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@snail007
snail007 / README.txt
Created August 6, 2017 12:49 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh test@test.com
Run the server in one terminal
go run server.go
@snail007
snail007 / bash.generate.random.alphanumeric.string.sh
Created October 11, 2016 09:46 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1

/etc/udev/rules.d/11-media-by-label-auto-mount.rules

KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"

# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
@snail007
snail007 / gist:ea7a4418dda90f50ba88df2b3a4f1eb7
Created October 2, 2016 05:56 — forked from taoeffect/gist:8855230
DNSChain + DNSCrypt! :-D
dnscrypt-proxy --local-address=127.0.0.1:53 --resolver-address=23.226.227.93:443 --provider-name=2.dnscrypt-cert.okturtles.com --provider-key=1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB
@snail007
snail007 / guide-to-_etc_cron_d.md
Created September 7, 2016 01:20 — forked from snakevil/guide-to-_etc_cron_d.md
/etc/cron.d 攻略

/etc/cron.d 攻略

为什么不用 crontab

crontab 是日常使用最为频繁地定时器工具。它将每个用户的所有定时任务统一记录、统一管理。

@snail007
snail007 / howto-setup-transparent-proxied-router.md
Created September 7, 2016 01:20 — forked from snakevil/howto-setup-transparent-proxied-router.md
如何在路由器中实现透明代理?

如何在路由器中实现透明代理?

0 互联网现状

目前整个互联网环境,被破坏最严重地部分,是 Web 服务体验。当直接破坏难以实现时,就会从流程链的上下游着手,如:DNS 污染。

其它地互联网服务类型,例如:邮件,可能小部分会受到 Web 服务上下游破坏地余震,但整体上基本不受影响。