Skip to content

Instantly share code, notes, and snippets.

View mx2x's full-sized avatar

michael pap mx2x

View GitHub Profile
@mx2x
mx2x / install.sh
Created December 20, 2017 13:25
VPS install bash script for Ubuntu 16.04
# =================== YOUR DATA ========================
SERVER_NAME="some-server-name"
SERVER_IP="111.111.11.11"
USER="someuser"
SUDO_PASSWORD="secret-password-one"
MYSQL_ROOT_PASSWORD="secret-password-two"
@mx2x
mx2x / iptables
Created November 16, 2017 10:40 — forked from m4ce/iptables
Transparent proxy with Squid and IPTables
# Rules for transparent proxying
iptables -N NO_PROXY -t nat
iptables -A NO_PROXY -t nat -d 0.0.0.0/8 -j ACCEPT
iptables -A NO_PROXY -t nat -d 10.0.0.0/8 -j ACCEPT
iptables -A NO_PROXY -t nat -d 127.0.0.0/8 -j ACCEPT
iptables -A NO_PROXY -t nat -d 169.254.0.0/16 -j ACCEPT
iptables -A NO_PROXY -t nat -d 172.16.0.0/12 -j ACCEPT
iptables -A NO_PROXY -t nat -d 192.168.0.0/16 -j ACCEPT
iptables -A NO_PROXY -t nat -d 224.0.0.0/4 -j ACCEPT
iptables -A NO_PROXY -t nat -d 240.0.0.0/4 -j ACCEPT
@mx2x
mx2x / public-stun-list.txt
Created October 23, 2017 18:41 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@mx2x
mx2x / public-stun-list.txt
Created October 23, 2017 18:41 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@mx2x
mx2x / TorDetector.php
Created August 22, 2017 05:34 — forked from jeroenvisser101/TorDetector.php
Detecting people that use Tor
<?php
/**
* Class TorDetector
*
* Helps to detect if visitors are using a Tor browser to surf the website.
*
* Thanks to https://trac.torproject.org/projects/tor/wiki/doc/TorDNSExitList
*/
class TorDetector
@mx2x
mx2x / firewall.sh
Created June 21, 2017 21:25 — forked from mshroyer/firewall.sh
iptables firewall script for buildserv
#!/bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: iptables firewall
# Description: Custom iptables firewall
@mx2x
mx2x / setup_mac.sh
Created June 13, 2017 10:04 — forked from DamianZaremba/setup_mac.sh
Commands to add an OSX machine to an AD environment so users can authenticate
# Assumes the following:
# Hostname: TEST1
# Domain: EXAMPLE.COM (you probably don't want to use your public domain for your AD domain... but that's out of scope for this example)
# Admin user: setupuser
# Admin pass: He11oW0rld!
# Machine will go into the default computers ou (root)
# Domain admins will get local admin rights on login
# All users will get mobile accounts (offline login)
# All data will be stored locally (no UNC home dir)
# Default shell will be bash
@mx2x
mx2x / install_ocserv.sh
Created March 6, 2017 11:42 — forked from lj0014/install_ocserv.sh
install ocserv in ubuntu
#install deps
apt-get update
apt-get install -y gnutls-bin iptables libnl-route-3-200 libseccomp2 libwrap0 openssl curl --no-install-recommends
buildDeps=" \
autoconf \
autogen \
ca-certificates \
gcc \
gperf \
libgnutls28-dev \
@mx2x
mx2x / list-manually-installed-packages.sh
Created October 27, 2016 07:21 — forked from UniIsland/list-manually-installed-packages.sh
List all manually installed packages on a debian/ubuntu system
#!/bin/bash
## List all manually installed packages on a debian/ubuntu system
## manually installed means:
## 1. not pre-installed with the system
## 2. not marked auto-installed by apt (not dependencies of other
## packages)
## Note: pre-installed packages that got updated still needs to be
## filtered out.