Skip to content

Instantly share code, notes, and snippets.

༼ つ ◕_◕ ༽つ

jsz joshschmelzle

༼ つ ◕_◕ ༽つ
View GitHub Profile
joshschmelzle /
Last active April 28, 2023 21:20
Mac Setup
# create a file on your mac called
# run it from terminal with: sh
# heavily inspired by
# inspired by
# faster dock hiding/showing (run in terminal)
# defaults write autohide-delay -float 0; defaults write autohide-time-modifier -int 0;killall Dock
joshschmelzle /
Created March 1, 2023 21:03 — forked from nymous/
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 /
Created November 4, 2022 02:21 — forked from wtbarnes/
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 ->

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

joshschmelzle /
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


  • 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 /
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+/"
joshschmelzle /
Last active October 6, 2020 14:29
iperf3 server install

installing iperf3 and make it start at boot on a ubuntu server.

install iperf3:

sudo apt-get install iperf3

start iperf3 server at startup

joshschmelzle /
Last active December 15, 2021 16:06
WLAN Pi Tricks

Remote PCAP


  • Windows 10, or newer
  • Wireshark 3.0, or newer (installed with Sshdump component)
  • WLAN Pi or SBC (assumption is rpcapd is setup and running)
  • SSH Client

Can leverage rpcap (remote packet capture) protocol supported by Wireshark to capture raw wireless frames from the WLAN NIC used by the WLAN Pi. This can be leveraged to do a packet capture from a WLAN Pi in a remote location.

joshschmelzle /
Last active February 16, 2020 18:25
Zero Tier Basics

ZeroTier (ZT) is open source and free to use for most cases (commercial/proprietary use makes it not free).

It's a network virtualization platform that lets you connect to your devices with automatic end-to-end encryption. Think of it conceptually like a VPN, SDN, and SD-WAN all in one.

Getting Started

  1. Create and verify an account over at

  2. Create a network

joshschmelzle /
Last active May 15, 2023 07:45
running tftp server on ubuntu

Using tftpd-hpa - HPA's tftp server on Ubuntu 18.04.3 LTS to host a tftp server.

install tftp server

$ sudo apt install tftpd-hpa

configure tftp server

create new directory for tftp.

joshschmelzle /
Last active January 16, 2020 02:05
coding and terminal fonts to consider using

A few fonts for coding or your terminal to consider using:


  • JetBrains Mono - A typeface for developers
  • Hack - A typeface designed for source code
  • FiraCoda - Monospaced font with programming ligatures