Skip to content

Instantly share code, notes, and snippets.

@honwen
honwen / systemd-networkd_google2vpn.sh
Last active June 4, 2021 19:24
systemd-networkd_google2vpn.sh
#!/bin/bash
gw=${1:-123.234.123.234}
curl -skSL https://www.gstatic.com/ipranges/goog.json |
jq -r '.prefixes[] | .ipv4Prefix | select(length > 0)' |
while read cidr; do
cat <<EOF
[Route]
Destination=$cidr
@honwen
honwen / pve-upgradehook
Last active December 11, 2021 11:49
Remove the Proxmox “No Valid Subscription” message popup, Tested OK from 6.0 to 6.2-11
# /etc/apt/apt.conf.d/80upgradehook
DPkg::Post-Invoke { "/usr/local/bin/remove_pve_sub.sh"; };
# PVE 6.0-7.0
@honwen
honwen / add-xiaoyu-c5-support.patch
Created September 24, 2019 18:05
add-xiaoyu-c5-support base openwrt/18.06.4
From 72d5e850c901658e3bcebab11283f92a373ddc45 Mon Sep 17 00:00:00 2001
From: honwen <honwen.chan@gmail.com>
Date: Wed, 25 Sep 2019 00:06:04 +0800
Subject: [PATCH 1/2] add xiaoyu-c5 support
---
.../ramips/base-files/etc/board.d/01_leds | 4 +
.../ramips/base-files/etc/board.d/02_network | 1 +
target/linux/ramips/base-files/lib/ramips.sh | 3 +
.../ramips/base-files/lib/upgrade/platform.sh | 1 +

随机数生成器评估 - 以NIST为标准

小结: 通读NIST的文档,大致明白其中随机性的检测的原理。

NIST

测试项目与原理

  1. Frequency (Monobit) Test:
@honwen
honwen / cross_and_static_compile_shadowsocks-libev.sh
Last active February 28, 2023 22:56 — forked from harv/cross_and_static_compile_shadowsocks-libev.sh
cross & static compile shadowsocks-libev
#!/bin/bash
export http_proxy=http://127.0.0.1:8080
export https_proxy=http://127.0.0.1:8080
export CC=clang
export CXX=clang++
# git init
git config --global user.name 'docker'
package main
import (
"fmt"
"github.com/Comdex/imgo"
"os"
)
func main() {
if len(os.Args) < 3 {
# Shadowrocket: 2017-05-31
[General]
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
dns-server = system, 119.29.29.29, 8.8.8.8
loglevel = notify
ipv6 = false
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,e.crashlytics.com,captive.apple.com
bypass-system = true
allow-wifi-access = false
port 80:81
http://54.148.98.52
http://54.64.187.93
http://54.64.93.120
http://54.69.83.102
http://54.93.172.238
http://54.93.186.254
http://54.93.186.254
http://216.146.38.70
http://216.146.43.70
#!/bin/bash
port=$1
if [ "Z$port" = "Z" ]; then port=443; fi
curl -sSL https://dns.d0wn.biz/ | sed -n 's/^IPv4[^0-9]*//p' | while read dns; do
printf "%-16s # %-5s " $dns $port
tm=$( dig +time=1 +tries=3 -p$port +tcp google.com @$dns 2>/dev/null | sed -n 's/.*time: //p')
if [ "Z$tm" = "Z" ]; then echo -n " : X \t" ; else echo -n " : $tm \t"; fi
if hash ip2loc 2>/dev/null; then ip2loc $dns | sed 's/ N.*//g'; fi
/* Reset */
body { background: #fff; color: #333; font-family: Consolas, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.8; margin: 0; padding-top: 70px; }
a { color: #08c; text-decoration: none; outline: 0; }
a:hover { opacity: .8; }
h1, h2, h3, h4, h5, h6, p, .cbi-map-descr, .cbi-section-descr { color: #666; margin-top: 0; margin-bottom: 10px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
/* Style */
.container { max-width: 900px; margin-left: auto; margin-right: auto; }
.pull-left, .left { float: left; }