Skip to content

Instantly share code, notes, and snippets.

View bgrewell's full-sized avatar

Ben Grewell bgrewell

View GitHub Profile
@bgrewell
bgrewell / go-scan.go
Last active March 6, 2022 16:44
Quick and dirty port scanner for Go. Mainly designed as a quick way to do a scan on Windows without any external dependencies or any permissions.
package main
import (
"flag"
"fmt"
"net"
"os"
"strconv"
"strings"
"sync"
@bgrewell
bgrewell / iperf-3.11-output.md
Last active February 15, 2022 20:59
Example output from various iperf3 clients/servers

IPerf3 Sample Output

Below is sample output from iperf3 version 3.11 on various operating systems. This data is used for validating the parsers in the go-iperf project.

OS X

Client - Standard Output

@bgrewell
bgrewell / udm-pro-he-ipv6-setup.md
Last active April 6, 2024 14:59
This gist describes how to setup a hurricane electric (TunnelBroker) IPv6 tunnel on a Ubiquiti Unifi Dream Machine Pro

Setup IPv6 Tunnel on Unifi Dream Machine Pro

Enable SSH

TODO

Configure To Dream Machine Over SSH

SSH to your UDM

@bgrewell
bgrewell / setup_for_windows_10_driver_development.md
Last active February 23, 2020 18:01
Instructions for installing all the tooling needed to do Windows 10 1903 device driver development (Assuming Visual Studio is already installed). It also includes steps to get up and running with the 'inspect' sample for WFP Callout driver development.

Installing Toolchain For Driver Development

In addition to getting the tooling installed for driver development on Windows 10 1903 I have also included instructions for getting up and running with the Windows Filtering Platform sample Inspect which is a sample callout driver for doing packet inspection.

Install the Windows 10 SDK

The first step is to install the Windows 10 SDK. This is required to build the drivers and needs to match the version of the WDK that you will install in the next step.

  1. Navigate to Windows 10 SDK Download Page
  2. Click on Download The Installer

Keybase proof

I hereby claim:

  • I am bgrewell on github.
  • I am bgrewell (https://keybase.io/bgrewell) on keybase.
  • I have a public key ASDBwYR_X1-oN-4crtW0ymT-ce9HZpc9gK_oNzB3WF_fvwo

To claim this, I am signing this object:

@bgrewell
bgrewell / netem_crandom_insights.md
Last active January 30, 2020 18:19
Results from some tracing into the calls to get_crandom in sch_netem.c

Insights

The function below is responsible for returning the delay value that is used by the qdisc. If no distribution is specified it is uniform, this is why I didn't see a uniform.dist file in /usr/lib/tc where the other distribution tables are.

mu == latency

sigma == jitter

You can see from the code below that if you don't specify a distribution then it uses the uniform one by default. return ((rnd % (2 * sigma)) + mu) - sigma; in this case rnd is our correlated random number from get_crandom so we take the jitter value sigma and multiply it by 2, then we modulo rnd by this value and add mu our base latency and then subtract sigma to center the jitter

@bgrewell
bgrewell / setup-powerline.sh
Last active January 16, 2020 15:52
Simple script to setup powerline
python3 -m pip install git+git://github.com/powerline/powerline
[ -d "~/.local/share/fonts" ] || mkdir -p ~/.local/share/fonts
wget -O ~/.local/share/fonts/PowerlineSymbols.otf https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
fc-cache -vf ~/.local/share/fonts/
[ -d "~/.config/fontconfig/conf.d" ] || mkdir -p ~/.config/fontconfig/conf.d/
wget -O ~/.config/fontconfig/conf.d/10-powerline-symbols.conf https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
sudo apt install -y fontconfig
sudo apt install -y fonts-powerline
sudo apt install -y powerline-gitstatus
[ -d "~/.config/powerline" ] || mkdir -p "~/.config/powerline"
@bgrewell
bgrewell / timing-loop.js
Last active January 9, 2020 21:59
Example for getting performance timing from chrome
const puppeteer = require('puppeteer');
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function requestPageTiming(url) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://www.amazon.com");

Usage Examples for WEMO REST API version 1

Overview

Conventions

  1. REST calls follow standard convention.
REQUEST TYPE  ACTION
@bgrewell
bgrewell / msf.lnk.hex
Last active October 23, 2018 20:52
msf.lnk file in hex view
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
=====================================================
000 | 4C 00 00 00 01 14 02 00 00 00 00 00 C0 00 00 00
010 | 00 00 00 46 81 00 00 00 00 00 00 00 00 00 00 00
020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
040 | 00 00 00 00 00 00 00 00 00 00 00 00 80 00 14 00
050 | 1F 00 E0 4F D0 20 EA 3A 69 10 A2 D8 08 00 2B 30
060 | 30 9D 14 00 2E 1E 20 20 EC 21 EA 3A 69 10 A2 DD
070 | 08 00 2B 30 30 9D 56 00 00 00 00 00 00 00 00 00