Skip to content

Instantly share code, notes, and snippets.

@cokebar
cokebar / generate_chnroute.sh
Last active October 26, 2021 07:44
generate_chnroute
wget -O- 'https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > ./chnroute.txt
wget -O- 'https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv6/ { printf("%s/%d\n", $4, $5) }' > ./chnroute_ipv6.txt
@cokebar
cokebar / install_nginx_with_libressl.sh
Last active September 12, 2024 13:03
A example script to build and install nginx with libressl instead of openssl
#!/bin/bash
set -e -o pipefail
latest_nginx=$(curl -L http://nginx.org/en/download.html | egrep -o "nginx\-[0-9.]+\.tar[.a-z]*" | head -n 1)
latest_libressl=$(curl -L http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ | egrep -o "libressl\-[0-9.]+\.tar\.gz" | tail -n 1)
(curl -fLRO "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${latest_libressl}" && tar -xaf "${latest_libressl}") &
(curl -fLRO "http://nginx.org/download/${latest_nginx}" && tar -xaf "${latest_nginx}") &
wait