Skip to content

Instantly share code, notes, and snippets.

View clayfreeman's full-sized avatar

Clay Freeman clayfreeman

  • Library Solutions, LLC
  • United States
View GitHub Profile
@clayfreeman
clayfreeman / udpsink.c
Last active February 21, 2026 04:01
Puts a synthetic upstream load on your internet connection at the specified bitrate
/**
* @file
* Put a synthetic upstream load on your internet at the specified bitrate.
*
* Compile with your preferred TARGET_HOSTNAME and TARGET_PORT:
* - cl /DTARGET_HOSTNAME=\"example.internal\" /DTARGET_PORT=62724 udpsink.c
* - x86_64-w64-mingw32-gcc -DTARGET_HOSTNAME=\"example.internal\" -DTARGET_PORT=62724 udpsink.c -o udpsink.exe -lws2_32
*/
#include <stdint.h>
@clayfreeman
clayfreeman / random_in6_addr_connect.c
Last active April 17, 2025 22:26
Bind to a random source address before connecting to a remote host via IPv6
/**
* @file
* Bind to a random source address before connecting to a remote host via IPv6.
*
* 1. Install dependencies: `libcap-dev libnl-3-dev libnl-route-3-dev`
* 2. Compile with:
* ```
* gcc -shared -fPIC -Wall -I /usr/include/libnl3 ... -lcap -lnl-3 -lnl-route-3
* ```
*
@clayfreeman
clayfreeman / twitch-playback-fix.js
Last active January 16, 2025 01:15
Automatically restart video playback when buffering
// ==UserScript==
// @name Twitch Playback Fix
// @version 2024-11-20
// @description Automatically restart video playback when buffering.
// @author Clay Freeman
// @match http*://*.twitch.tv/*
// @grant none
// ==/UserScript==
(function () {
@clayfreeman
clayfreeman / open-proxy-client.php
Last active May 12, 2023 16:14
Stream socket client in PHP using a HTTP CONNECT proxy
<?php
// Specify the hostname and port to which you wish to connect via HTTP proxy.
$target_hostname = 'www.google.com';
$target_port = 443;
// Specify whether the proxied connection should use TLS.
$target_crypto = TRUE;
// Specify the address of the HTTP proxy to use.