Skip to content

Instantly share code, notes, and snippets.

View hsupu's full-sized avatar
🌏
Inside

Hsu Pu hsupu

🌏
Inside
View GitHub Profile
@hsupu
hsupu / nat6-and-port-forwarding.sh
Last active May 14, 2023 14:52
OpenWRT: iptables rules: NAT6 and Port Forwarding
LAN_IF=br-lan
WAN_IF=eth2
# nat6
ip6tables -t nat -I POSTROUTING -o $WAN_IF -j MASQUERADE
function forward6() {
PROTO=$1
ROUTER_PORT=$2
HOST_IP=$3
@hsupu
hsupu / httpclient-demo.ps1
Last active March 23, 2021 00:17
PowerShell HttpClient ServerCertificateCustomValidationCallback demo
$cscode = @"
using System;
using System.Net.Http;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
public class My {