Skip to content

Instantly share code, notes, and snippets.

@veltlion
veltlion / mac_to_ipv6.bash
Created January 16, 2023 04:05 — forked from mej/mac_to_ipv6.bash
[BASH] Function to convert MAC address to IPv6 link-local address
mac_to_ipv6() {
local HWADDR="$1" IFACE="$2"
local -a OCTETS
local IPV6ADDR
if [[ -z "$IFACE" ]]; then
IFACE=$(ip route | grep ^default | sed 's/^.* dev //')
fi
OCTETS=( ${HWADDR//:/\ } )
OCTETS[0]=$(printf %02x $((16#${OCTETS[0]}+0x02)))
@veltlion
veltlion / qbittorrent.sh
Last active February 15, 2025 14:24
NATMap 打洞后自动更新 qBittorrent/Transmission 监听端口和 OpenWrt 防火墙规则并推送到 Telegram
#!/bin/sh
protocol=$5
inner_ip=$6
inner_port=$4
outter_ip=$1
outter_port=$2
ip4p=$3
qbv4="10.0.0.123"