Skip to content

Instantly share code, notes, and snippets.

View a180285's full-sized avatar

HuangWei a180285

  • 01:12 (UTC +08:00)
View GitHub Profile
@iximiuz
iximiuz / net_lab_broadcast_domains.sh
Last active January 13, 2024 22:17
A bunch of helper functions to create Linux bridges, network namespaces, and interconnect everything using veth pairs.
#!/usr/bin/env bash
set -xeuo pipefail
create_bridge() {
local nsname="$1"
local ifname="$2"
echo "Creating bridge ${nsname}/${ifname}"
@theriley106
theriley106 / main.py
Last active November 4, 2023 12:06
Windows Python Text-To-Speech
import os
# Be sure to import os into your script
'''
If you run the following command in the terminal, it will speak the words "testing to see if this works properly"
PowerShell -Command "Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('testing to see if this works properly');"
This python script generates this command with whatever text is passed to the speak function
'''
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个