Skip to content

Instantly share code, notes, and snippets.

View joshschmelzle's full-sized avatar
👻
༼ つ ◕_◕ ༽つ🛜

jsz joshschmelzle

👻
༼ つ ◕_◕ ༽つ🛜
View GitHub Profile
@joshschmelzle
joshschmelzle / gl-inet-openwrt-cli-notes.md
Last active April 23, 2025 17:08
Some quick notes on command discovery when playing with the GL iNet OpenWrt based BE3600

GL iNet OpenWrt raw CLI notes

Some quick notes on command discovery when playing with the GL iNet OpenWrt GL-BE3600.

linux stuff:

iwinfo
iwinfo wlan0 info
iwconfig wlan0
@joshschmelzle
joshschmelzle / wpa-enterprise-no-cert-workaround.md
Last active April 22, 2025 20:19
Configuring WPA enterprise without certificates: OpenSSL and wpa_supplicant workaround

Connecting to WPA[1,2,3] Enterprise without certificates

This method assumes EAP-PEAP MSCHAPv2.

Should you do this?

You should not be doing this, but if you want to... here is how you can use wpa_supplicant and OpenSSL for enterprise connections with no certs. This is a bad idea. You should be setting up certs and a proper PKI, but here we go...

Edit /etc/ssl/openssl.cnf

@joshschmelzle
joshschmelzle / get-output-from-docker.yml
Created November 7, 2024 21:23
Get and use output from docker in GHA
name: Get Output from Docker
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest

macOS/BSD specific

Thanks @seldo and @NurmiWilliam

sudo lsof -iTCP -sTCP:LISTEN -n -P | awk 'NR>1 {print $9, $1, $2}' | sed 's/.*://' | sort -u | while read port process pid; do echo "Port $port: $(ps -p $pid -o command= | sed 's/^-//') (PID: $pid)"; done | sort -n

git-sweep.sh

@joshschmelzle
joshschmelzle / gist:b03964a543e3aa0499a9ec360298878b
Last active November 27, 2023 16:20
Fix flash drive for Windows installation media

Thanks to cereberus on tenforums.com.

Do you have a flash drive that you previously used for a Linux install and now want to use it for a Windows install? Does the flash drive not show up for the Windows installation media? Follow the steps below to wipe the USB flash drive and stage it for Windows.

Open a command prompt/terminal with admin rights and type the following:

diskpart
@joshschmelzle
joshschmelzle / setup.sh
Last active April 28, 2023 21:20
Mac Setup
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
# heavily inspired by https://twitter.com/damcclean
# https://github.com/damcclean/dotfiles/blob/master/install.sh
# inspired by https://gist.github.com/chris-sev/45a92f4356eaf4d68519d396ef42dd99
# faster dock hiding/showing (run in terminal)
# defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
@joshschmelzle
joshschmelzle / README.md
Created March 1, 2023 21:03 — forked from nymous/README.md
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)

Logging setup for FastAPI

This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.

Then, you can use Structlog loggers or standard logging loggers, and they both will be processed by the Structlog pipeline (see the hello() endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!

Requests are assigned a correlation ID with the asgi-correlation-id middleware (either captured from incoming request or generated on the fly). All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented. This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog. You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom

@joshschmelzle
joshschmelzle / push-to-someone-elses-pr.md
Created November 4, 2022 02:21 — forked from wtbarnes/push-to-someone-elses-pr.md
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

@joshschmelzle
joshschmelzle / iperf3.md
Created September 20, 2022 01:54
iPerf3 systemd.unit

iPerf3 service with systemd

  • Create file at /etc/systemd/system/iperf3.service with contents from iperf3.service

systemctl

  • To start a service at boot, use the enable command: sudo systemctl enable iperf3.service
  • To view the service status, use the status command: sudo systemctl status iperf3.service
  • To start the service, use the start command: sudo systemctl start iperf3.service
  • To stop the service, use the stop command: sudo systemctl stop iperf3.service
@joshschmelzle
joshschmelzle / cisco-scrypt-generator.py
Last active April 1, 2021 12:01
Cisco Scrypt Secret 9 Generator Attempt - YMMV
import base64
import scrypt
import os
import random
# password
password = "hashcat"
# translation table
base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"