Skip to content

Instantly share code, notes, and snippets.

@tracyhatemice
tracyhatemice / Route 53 Updater
Created March 5, 2020 15:13 — forked from hsiboy/Route 53 Updater
BASH Script to keep Route53 updated with your current external IP address
Roll your own dynamic DNS service using Route53
@tracyhatemice
tracyhatemice / hosts
Created June 28, 2018 16:23 — forked from alswl/hosts
hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@tracyhatemice
tracyhatemice / update-rtorrent.sh
Created February 7, 2017 12:10
rTorrent install/update on Ubuntu 14.04
#!/bin/bash
# installs/updates rtorrent from source on Ubuntu
TMPDIR=$(mktemp -d)
mkdir $TMPDIR/logs
install_dependencies () {
apt-get update
apt-get install -y git subversion build-essential automake libtool libcppunit-dev zlib1g-dev libcurl4-openssl-dev libncurses5-dev
@tracyhatemice
tracyhatemice / gist:acb2189c2c5803d8048336639ac43b77
Created January 12, 2017 17:26 — forked from Wysie/gist:7487571
Script to route traffic from home network through VPN selectively.Based off the discussion at http://www.smallnetbuilder.com/forums/showthread.php?t=9311The setup is a Roku box, a Home PC running Plex, and a Synology NAS with a torrent client running a web interface.The aim is to have all traffic from Roku go through the VPN, all traffic from th…
#!/bin/sh
# Script to route traffic from home network through VPN selectively.
# Based off the discussion at http://www.smallnetbuilder.com/forums/showthread.php?t=9311
# The setup is a Roku box, a Home PC running Plex, and a Synology NAS with a torrent client running a web interface.
# The aim is to have all traffic from Roku go through the VPN, all traffic from the Home PC (and all other devices) bypassing the VPN,
# and the Synology NAS using the VPN. There are however some exceptions. Since Plex uses port 32400, Roku has to bypass the VPN when
# using that port. In addition, port 9091 has to bypass the VPN as well in order to access the Synology torrent client.
#
# Requirements: Asuswrt-Merlin with OpenVPN already set up
@tracyhatemice
tracyhatemice / gist:e64bc9cc5a7fcf8146c98927ba1b3d5e
Created December 27, 2016 05:10 — forked from mendelgusmao/gist:5823291
BTSync / BitTorrent Sync behind nginx
# take one
# subdirectory (one server, multiple services)
location /btsync/ {
rewrite ^/btsync/gui(.*) /btsync$1 last;
proxy_pass http://127.0.0.1:8888/gui/;
proxy_redirect /gui/ /btsync/;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@tracyhatemice
tracyhatemice / auth-basic.conf
Created October 5, 2016 17:25 — forked from Thermionix/auth-basic.conf
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@tracyhatemice
tracyhatemice / gfwlist2regex.py
Created July 1, 2016 03:40 — forked from sorz/gfwlist2regex.py
Download and convert GFWList to url regex which compatible with Squid.
#!/usr/bin/env python
#encoding: utf-8
import urllib2
from base64 import b64decode
LIST_URL = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt'
BLACK_FILE = 'gfw.url_regex.lst'
WHITE_FILE = 'cn.url_regex.lst'
@tracyhatemice
tracyhatemice / ocsetup.sh
Created June 1, 2016 08:17 — forked from luginbash/ocsetup.sh
setting up ocserv (open source AnyConnect alternative) on a new Debian, use passwd auth by default
echo "this file isn't supposed to run"
exit 0
# <------------------------------ Enviroment Variables ------------------------------->
FQDN = <Server DNS Name> # can also get from PTR record
ORG_NAME = <Org name>
RELEASE_NAME = $(lsb_release -sc)
# <------------------------------ Network Stack Setups ------------------------------->
# Please edit /etc/default/ufw first
@tracyhatemice
tracyhatemice / squidlog.py
Created May 26, 2016 04:06 — forked from ArthurClune/squidlog.py
Code to read Squid access-log files
#!/usr/bin/env python
"""
Code to read a squid log file
Sample usage:
f = SquidLog('access.log.1.gz')
for l in f:
print l.ts, l.remhost, l.url
@tracyhatemice
tracyhatemice / evertlistener.py
Created May 24, 2016 12:27
for network connectivity check
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import traceroute
import fcntl, sys