Skip to content

Instantly share code, notes, and snippets.

@SeeFlowerX
SeeFlowerX / iptables.sh
Created December 4, 2023 05:48
iptables + clash透明代理
#!/system/bin/sh
set -ex
# ENABLE ipv4 forward
sysctl -w net.ipv4.ip_forward=1
# DISABLE ipv6
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
@liuran001
liuran001 / config.yaml
Last active April 19, 2025 16:12
mihomo (Clash Meta) 懒人配置
# mihomo (Clash Meta) 懒人配置
# 版本 V1.19-250408
# https://gist.github.com/liuran001/5ca84f7def53c70b554d3f765ff86a33
# https://obdo.cc/meta
# 作者: 笨蛋ovo (bdovo.cc)
# Telegram: https://t.me/baka_not_baka
# 关注我的 Telegram 频道谢谢喵 https://t.me/s/BDovo_Channel
# 修改自官方示例规则 https://wiki.metacubex.one/example/#meta
# 转载请保留此注释
# 尽量添加了较为详尽的注释,不理解的地方建议对照 虚空终端 (Clash Meta) Docs 进行理解
@Strykar
Strykar / server_nftables.sh
Last active May 20, 2022 09:09
Server firewall using nftables
#!/usr/sbin/nft -f
## vim: ft=pf
flush ruleset
define wan = eth0
define cjd = tun0
define wg_int = wg0
define vpn_gw = 192.168.10.1
define vpn_net = 192.168.10.0/24
define proto_allow = { ah, esp, igmp, ipv6 }
@breakertt
breakertt / clashredir.sh
Last active October 31, 2024 04:14
clash-redir.sh
# clash
iptables -t nat -N clash
iptables -t nat -A clash -p tcp -m multiport --sports 21,22,80,443,445,3389,5201,5900,5901,5902 -j RETURN
iptables -t nat -A clash -d 0.0.0.0/8 -j RETURN
iptables -t nat -A clash -d 10.0.0.0/8 -j RETURN
iptables -t nat -A clash -d 127.0.0.0/8 -j RETURN
iptables -t nat -A clash -d 169.254.0.0/16 -j RETURN
iptables -t nat -A clash -d 172.16.0.0/12 -j RETURN
iptables -t nat -A clash -d 192.168.0.0/16 -j RETURN
iptables -t nat -A clash -d 224.0.0.0/4 -j RETURN
@codehz
codehz / iprule.sh
Last active January 6, 2025 13:09
nftables for redir proxy
ip rule add fwmark 0x233 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 19, 2025 05:12
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@miguelmota
miguelmota / example-app.spec
Last active March 15, 2021 14:25
Golang binary RPM spec
# https://fedoraproject.org/wiki/PackagingDrafts/Go
%global commit 63fe64c471e7d76be96a625350468dfc65c06c31
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: example-app
Version: 1.0.0
Release: 6%{?dist}
Summary: This application is an example for the golang binary RPM spec
License: ASL 2.0
URL: http://www.example-app.io
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 5, 2025 21:07
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@harv
harv / cross_and_static_compile_shadowsocks-libev.sh
Last active February 18, 2024 12:05
cross & static compile shadowsocks-libev
#!/bin/sh
# cross & static compile shadowsocks-libev
PCRE_VER=8.41
PCRE_FILE="http://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$PCRE_VER.tar.gz"
MBEDTLS_VER=2.6.0
MBEDTLS_FILE="https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz"
@JamesOBenson
JamesOBenson / Generating a secure SSH Key and commands
Last active October 16, 2023 06:45
SSH Generation and commands.
ssh-keygen
-t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored)
-t rsa - for greatest portability (key needs to be greater than 4096 bits)
-t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521)
-t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+
-t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1)
-b 4096 bit size
-a 500 rounds (should be no smaller than 64, result in slower passphrase verification and increased resistance to brute-force password cracking)
-C "[email protected]" comment..