Skip to content

Instantly share code, notes, and snippets.

View jkingsman's full-sized avatar
🇳🇿

Jack Kingsman jkingsman

🇳🇿
View GitHub Profile
@jkingsman
jkingsman / Ubuntu 24 Captive Portal + DHCP.md
Last active September 30, 2024 01:11
Captive Portal and Static File Server on Ubuntu 24 (RaspberryPi Compatible)

Man, I could not find a tutorial for this anywhere. So, how to set up a static file server and captive portal on Ubuntu 24, including on a Raspberry Pi Zero 2W. It serves static files, broadcasts an open wifi network, and uses DNS + DHCP to direct people to a captive portal (both all-DNS method and DHCP option 114).

Package Installation

First, install the packages we'll definitely need.

sudo apt update
sudo apt upgrade -y
sudo apt install -y vim dnsmasq hostapd
@jkingsman
jkingsman / roll-for-shoes.md
Last active December 3, 2023 07:11 — forked from brunobord/roll-for-shoes.md
Roll for shoes
#!/usr/bin/env python
import copy
import multiprocessing
import enchant
MAX_WORD_LEN = 12
LOCALES = ['en_US', 'en_GB']
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Maxthon; MRSPUTNIK 2, 4, 1, 44; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; YTB730; .NET4.0C; .NET4.0E)"
"Mozilla/5.0 (Windows; U; Windows NT 6.1; ja-JP) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16\x5Cx22) AS zFoK WHERE 7847=7847 OR 6009=LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB(3200000000/2))))-- pRGx"
"Mozilla/5.0 (Windows; U; Windows NT 6.1; ja-JP) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16\x5Cx22) AS jVpm WHERE 5036=5036 AND 6829=(SELECT 6829 FROM PG_SLEEP(32))--"
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 YaBrowser/20.2.3.213 Yowser/2.5 Yptp/1.58 Safari/537.36"
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.
@jkingsman
jkingsman / roll.py
Last active August 20, 2020 23:32
Automated dice roller for D&D with optional inclusion of envvars (e.g. DEX = 3; export DEX; ./roll.py 2d6 + DEX)
#!/usr/bin/env python3
import os
import random
import sys
def process_roll_string(roll_string):
roll_components = roll_string.replace(" ", "").split("+")
total_sum = 0
#!/usr/bin/env python3
import re
import requests
thumbnail_url = input("Thumbnail URL: ")
vid_id_regex = re.compile(r'\?wvideo=(.*?)"')
vid_id = vid_id_regex.search(thumbnail_url).groups()[0]
rolled_url = "http://fast.wistia.net/embed/iframe/%s?videoFoam=true" % (vid_id)
Kinesis for Log Processing
  • Kinesis is streaming data management and analytics
    • Ingestion through Kinesis Steams & Kinesis Firehose
    • Analysis through Kinesis Data Analytics
  • Kinesis Streams
    • Stream management system
    • Capacity measured in shards of 1MB/s read and 2MB/s write
    • Producers write data into stream
  • Can be EC2 instance, application, server, IOT, whatever
@jkingsman
jkingsman / pride.sh
Created March 16, 2020 01:04
CLI Pride Flags
#!/bin/bash
###
# Basically, these all loop through an array of xterm colors (https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg)
# and then prints out the block character (█) in that color {1..N} times (aka width) (see printf wizardry explained: https://stackoverflow.com/a/5349842)
###
# philly pride/poc
for c in 232 232 130 130 196 196 202 202 226 226 46 46 021 021 126 126;do printf "\033[38;05;${c}m%0.s█" {1..50};echo;done;echo
#!/bin/sh
# add alias="bash ~/idleLock.sh" to your .bashrc
# thefted from https://apple.stackexchange.com/questions/206942/detect-mouse-move-or-keystroke
# Pause/Interval between checks
checkInt=.1
# Keep track of the idle timer
lastIdle=0
location /dns-query {
proxy_pass https://dns.google/dns-query;
}
VS.
http {
upstream dohproviders {
server dns.google;
# also tried server dns.google:443;