Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
function load_var {
eval $(cat ${1} <( echo -e '\nset -o posix;set\n') | env - bash --noprofile --norc --posix | sed 's/^/'$2'_/')
if [ -n "$IF_IPSEC6" ]; then
PEER_ENDPOINT=$PEER_ENDPOINT6
SELF_ENDPOINT=$SELF_ENDPOINT6
fi
}
#!/bin/bash
function gen {
dd if=/dev/urandom 2>/dev/null | tr -dc a-f0-9 | fold -w $1 | head -n 1 | sed 's/^/0x/'
}
spi=`gen 8`
reqid=`gen 8`
auth_key=`gen 64`
enc_key=`gen 64`
#!/bin/bash
keyserver=${KEYSERVER:-"hkp://sks.ustclug.org"}
gpghome=/home/mirrors-web-trustdb
if [ -d .git/ ]; then
commit=$(git cat-file commit HEAD | sed '/^gpgsig/,/-----END PGP SIGNATURE-----$/ D')
sig=$(git cat-file commit HEAD | sed -n '/^gpgsig/,/-----END PGP SIGNATURE-----$/ P' | sed 's/^gpgsig//; s/^ //')
if [ -e "$gpghome/trustdb.gpg" ]; then
@shankerwangmiao
shankerwangmiao / nginx-ip-transp.patch
Last active October 11, 2023 04:15
nginx-ip-transp
diff --git a/auto/unix b/auto/unix
index 43d3b25..2b229f7 100644
--- a/auto/unix
+++ b/auto/unix
@@ -312,6 +312,17 @@ ngx_feature_test="cpu_set_t mask;
. auto/feature
+ngx_feature="IP_TRANSPARENT"
+ngx_feature_name="NGX_HAVE_TRANSPARENT"
@shankerwangmiao
shankerwangmiao / 60-stream.conf
Last active September 13, 2018 04:16
nginx-transp-proxy
stream {
log_format main '$remote_addr:$remote_port => $server_addr:$server_port'
' [$time_local] $protocol $status $bytes_sent $bytes_received '
'$session_time "$ssl_preread_server_name" $will_bind_local_addr';
server {
listen 127.0.0.1:3003 transparent;
proxy_pass $real_connect_to;
proxy_bind $will_bind_local_addr;
#!/bin/bash
negative(){
tr '0123456789ABCDEFabcdef' 'FEDCBA9876543210543210'
}
key_derive(){
local mpk="$1"
local asn="$2"
echo "$(echo "$asn" | tdes_enc "$mpk")$(echo "$asn" | negative | tdes_enc "$mpk")"
This file has been truncated, but you can view the full file.
H4sIACnkc1wAA9T2A5RuTdcliKadJ23btm3b9knbtm3b9knbtm3bmX3e76+urq6v/+5bNUbdezvG
M0bsPddaM2astZ7YYWjhYExrZGtjCvC/btD/HazM9P+aGVgZ/svM8q/572BmYmIDYGBiZmJmY2Fi
YftrZ2BgoqcHwKf/X6jpvw5nRycDB3x8AMO/ifi/8/t/sv+/dBDhK5tbOOL//RngW1vYWFgbWOH/
0w4WZs4OBk4Wtjb4phZWJtT4ruYWRub4BlZWtq6O+E7mJvj/5APf2MDE+q+Lky3+P1l0giLCN3R2
wne1sLLCt7F1wjcycHY0wTewcXcyt7Axwzex+vv219fcwM7OxIYWiuivv7yVicFf1MHE1MThH9s/
1Ma2Rs7WJjZO/7G+hc1/XY/mrwXfzsDI0sDMBN/WAV9QQlEYX8XRxIHM8S+VmLOF8V/YBt/cycmO
k47unwhaGxMnV1sHS1ojDzp8078h1rYOJn8p/z5a/wf939//vt9/NP6L0sDG+C+fgbHxP4iDrbPT
P7Odg62TrZGtlSMt1F+jkLmBzV8RTv9Kns1f4e62zv9F0D8BfzcjIUyLL+FE9k9i/yqwMqZx/Uee
s42FvfNfBcZ/92dhamH0LxF/+WxN/4PhP4Kp8Z0dnf8m2/2vPJN/bP8B/yWTkHdh/keZg4mjo8lf
Kf9lMQtjfAYOdloWBloGenpaBq5/JCr/zZqwiYuFkcl/1f5Pnf8pjMHfhP8t9H+/tX8E/82+iaMN
Feb 27 06:44:10 101.6.8.227 4,27584,634001058486,-;WARNING: CPU: 0 PID: 0 at kernel/rcu/tree.c:2792 rcu_process_callbacks+0x4c5/0x500
Feb 27 06:44:10 101.6.8.227 4,27585,634001109697,-;Modules linked in:
Feb 27 06:44:10 101.6.8.227 4,27586,634001127944,c; tcp_diag
Feb 27 06:44:10 101.6.8.227 4,27587,634001140255,c; inet_diag
Feb 27 06:44:10 101.6.8.227 4,27588,634001153602,c; netconsole
Feb 27 06:44:10 101.6.8.227 4,27589,634001169636,c; reiserfs(O)
Feb 27 06:44:10 101.6.8.227 4,27590,634001185881,c; loop
Feb 27 06:44:10 101.6.8.227 4,27591,634001196759,c; ip_vs
Feb 27 06:44:10 101.6.8.227 4,27592,634001210249,c; veth
Feb 27 06:44:10 101.6.8.227 4,27593,634001221265,c; nf_conntrack_netlink
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4O//F9NdADoZSs4dkJsneBz/bNOb8/VIi6mfPJyl4E3R
ZPRcjYWVP8ZadAyWoshi62XKsliYPJ3ZGvuyQYNLzaIm/jpS0gzPRcE5gLB+4tZ4uGlPDpE7k9GZ
pq4A8utK90UGiwuv9fBUm9V7i3VqqeviR3k0gMBMFA9ZaFuE8fgVPumm0RVLqzGsMjjVQKeixvOm
PtLetv0A15UkErykYvsVFqJJr0kqcHNgis9Kbs50SRQKwd02jtw6IUeczWWLH8LeY4xJKaI06VwR
HeQSj01Uq7MfDCXB5TG1fcbmQ8wH0mt0TMpj7hSyB/ftQ3ffs0qJsBlD3H8UD2REt5hz+xDlOmKU
dBbrNzWLgibljkgu6kWIXUDVXfXkLQSIFdY0WkA76QfC//SpIwRV44tdxaLR2FcDIuR9hhN4qn+u
J/of6GZC8VtsSvqAe3QbqMrmDQn7c0kD4xQrm6VAg0KaWsOxE57s0TemWRsm+egHoZdkEIu8BkQV
+ceH8rKKJhHSO0oO3Z7psBdd8lJOPpMulPkC/iwq6xEM96YIPBAmYpJ2nI+ppIyxUX2GCuuEUklH
8wBFkbQkMpK42VGEemXFOIBVC7CXr6HFf+4JdVEqxETB4DCExvMTi4W0ULDIvvLh0gHq6DOPweOs
fB4TpzMlthqCBZ/OXyJviy37nUUgIGSZ+KQNN78e2pMFRDfKY1xk+e+zl14mqklRtTBg0o9EsOPR
@shankerwangmiao
shankerwangmiao / Demo udeb
Last active February 3, 2021 15:13
Demo udeb
We couldn’t find that file to show.