Skip to content

Instantly share code, notes, and snippets.

@darkmagician
darkmagician / ipv6-router.sh
Created February 13, 2023 13:44 — forked from w1ndy/ipv6-router.sh
Enable IPv6 passthrough with ebtables and prohibit unwanted incoming connections with iptables
modprobe ip6table_mangle
ebtables -t broute -A BROUTING -p ! ipv6 -j DROP -i eth2.2
brctl addif br0 eth2.2
echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 --state NEW -j DROP
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p udp --dport 6881 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 5000 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 6443 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 8096 --state NEW -j ACCEPT
#!/usr/bin/env bash
APPNAME="k8sdex"
COMMAND="./dex serve config-github.yaml"
BASE="$(readlink -f $(dirname $0))"
. $BASE/services.sh
@darkmagician
darkmagician / nginx-tuning.md
Created October 17, 2017 04:55 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.