Skip to content

Instantly share code, notes, and snippets.

@kamranrad1993
kamranrad1993 / kind_static_ips.sh
Created May 11, 2025 11:52 — forked from lixianyang/kind_static_ips.sh
This script assign static IP to all nodes of a kind cluster
#!/bin/bash
set -e
# Workaround for https://github.com/kubernetes-sigs/kind/issues/2045
all_nodes=$(kind get nodes --name "${CLUSTER_NAME}" | tr "\n" " ")
declare -A nodes_table
ip_template="{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}"
echo "Saving original IPs from nodes"
@kamranrad1993
kamranrad1993 / iptables-redsocks.sh
Created November 27, 2022 05:56 — forked from ChronoMonochrome/iptables-redsocks.sh
RedSocks proxy for Linux
#!/bin/bash
# Create new chain
sudo iptables -t nat -N REDSOCKS
# Ignore LANs and some other reserved addresses.
sudo iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
@kamranrad1993
kamranrad1993 / lldb.txt
Created August 3, 2022 19:22 — forked from hotwatermorning/lldb.txt
Step into std::function with lldb of Xcode
(lldb) settings show target.process.thread.step-avoid-regexp
target.process.thread.step-avoid-regexp (regex) = ^std::
(lldb) settings set target.process.thread.step-avoid-regexp ""
http://stackoverflow.com/questions/19413181/step-into-stl-sources-in-xcode-5