Skip to content

Instantly share code, notes, and snippets.

View tom-henderson's full-sized avatar
🇳🇿

Tom Henderson tom-henderson

🇳🇿
View GitHub Profile
@tom-henderson
tom-henderson / Edgerouter Bonjour Forwarding
Created November 27, 2016 04:38
Repeat Bonjour packets across both interfaces.
configure
set service mdns repeater interface eth1
set service mdns repeater interface eth2
commit
save
# Set proxy for all users
# See:
# https://www.securelink.be/windows-proxy-settings-explained/
# https://technet.microsoft.com/en-us/library/cc770473(v=ws.11).aspx
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa362813(v=vs.85).aspx
$domain_name='example.com'
$proxy='proxy.foo.com'
$port=8080
$bypass = "10.*.*.*;"
#!/usr/bin/env python3
import os
import sys
import json
import requests
import argparse
import re
SLACK_WEBHOOK_URL = os.environ.get("SLACK_WEBHOOK_URL")
#!/usr/bin/env python3
# https://grafana.com/docs/http_api/annotations/
import os
import sys
import json
import requests
import argparse
import datetime
#!/bin/bash
totals=()
while read -r item; do
cal=$((cal + item))
if [ -z "$item" ]; then
totals+=($cal)
cal=0
fi
done < input
set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username <username> password <password>
set vpn l2tp remote-access client-ip-pool start 10.0.3.10
set vpn l2tp remote-access client-ip-pool stop 10.0.3.20
set vpn l2tp remote-access dns-servers server-1 10.0.0.1
set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret <secret>
set vpn l2tp remote-access ipsec-settings ike-lifetime 3600
@tom-henderson
tom-henderson / unifi-auth.py
Last active January 11, 2021 14:24
Authenticating unifi wireless guest users.
import json
import ssl
import requests
from requests_toolbelt import SSLAdapter
# URL or IP Address of the unifi controller:
PORTAL_URL = 'https://ubiquiti.example.com/'
# Username and password for the unifi controller:
PORTAL_LOGIN_PARAMS = {
#!/bin/bash -e
# Write out prometheus metrics for docker volume size.
while read -r container_id; do
container=$(docker inspect "$container_id")
state=$(jq --raw-output .[].State.Status <(echo "$container"))
if [[ $state = 'running' ]]; then
# Create the Azure end of an Azure Site to Site VPN
$subscription = 'Visual Studio Enterprise'
$location = 'Australia East'
$resourceGroup = 'RG-Network'
$networkName = 'VN-Azure'
$networkPrefix = '10.20.0.0/16'
code country
1 United States
20 Egypt
27 South Africa
30 Greece
31 Netherlands
32 Belgium
33 France
34 Spain
36 Hungary