Skip to content

Instantly share code, notes, and snippets.

@guddl
guddl / pas.py
Last active June 2, 2021 18:19
OpenVPN Access Server // pas.py to disable different operating systems
# Example Access Server Post-Auth script demonstrates three features:
#
# 1. How to set a connecting user's Access Server group based on LDAP
# group settings for the user.
# 2. How to verify that a given Access Server user only logs in using
# a known client machine.
# 3. How to verify that client machine contains up-to-date applications
# (such as virus checker) before allowing it to connect to the server.
#
# https://docs.openvpn.net/docs/access-server/openvpn-access-server-post-auth-scripting.html
@guddl
guddl / traffic-shaper-script.sh
Created June 30, 2016 08:00
Simple traffic shaper script for Linux
#! /bin/bash
NETCARD=eth0
MAXBANDWIDTH=100000
# reinit
tc qdisc del dev $NETCARD root handle 1
tc qdisc add dev $NETCARD root handle 1: htb default 9999
# create the default class
tc class add dev $NETCARD parent 1:0 classid 1:9999 htb rate $(( $MAXBANDWIDTH ))kbit ceil $(( $MAXBANDWIDTH ))kbit burst 5k prio 9999
@guddl
guddl / fwstop.sh
Last active June 29, 2016 19:27
Flushed all iptables rules on a Linux system
#!/bin/bash
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT