Skip to content

Instantly share code, notes, and snippets.

View whiler's full-sized avatar
🇨🇳

whiler whiler

🇨🇳
View GitHub Profile
@whiler
whiler / gen-cert.sh
Created May 26, 2023 11:07
一行命令生成自签名的 ECC TLS 证书
#!/bin/bash
openssl req \
-new \
-newkey ec \
-pkeyopt ec_paramgen_curve:secp384r1 \
-sha256 \
-days 92 \
-nodes \
-x509 \
@whiler
whiler / 91-use-proxy
Created December 25, 2023 04:25
apt uses socks5 proxy (/etc/apt/apt.conf.d/91-use-proxy)
Acquire::http::proxy "socks5h://127.0.0.1:1080";
Acquire::https::proxy "socks5h://127.0.0.1:1080";
@whiler
whiler / validator.go
Created March 4, 2024 00:45
golang validator simple usage
import "github.com/go-playground/validator/v10"
type Base struct {
Name string `yaml:"name" validate:"required"`
}
type Ext struct {
ID int `yaml:"id" validate:"gte=1,lt=10"`
}