Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
༼ つ ◕_◕ ༽つ

jsz joshschmelzle

👾
༼ つ ◕_◕ ༽つ
View GitHub Profile
@joshschmelzle
joshschmelzle / setup.sh
Last active April 28, 2023 21:20
Mac Setup
View setup.sh
# 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)
View README.md

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
View push-to-someone-elses-pr.md

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
View iperf3.md

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
View cisco-scrypt-generator.py
import base64
import scrypt
import os
import random
# password
password = "hashcat"
# translation table
base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
@joshschmelzle
joshschmelzle / iperf3-server-on-ubuntu.md
Last active October 6, 2020 14:29
iperf3 server install
View iperf3-server-on-ubuntu.md

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
joshschmelzle / Remote-PCAP-Daemon.md
Last active December 15, 2021 16:06
WLAN Pi Tricks
View Remote-PCAP-Daemon.md

Remote PCAP

Requirements:

  • 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
joshschmelzle / zerotier-basics.md
Last active February 16, 2020 18:25
Zero Tier Basics
View zerotier-basics.md

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 https://my.zerotier.com/

  2. Create a network https://my.zerotier.com/network

@joshschmelzle
joshschmelzle / tftp-server-installation.md
Last active May 15, 2023 07:45
running tftp server on ubuntu
View tftp-server-installation.md

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
joshschmelzle / fonts.md
Last active January 16, 2020 02:05
coding and terminal fonts to consider using
View fonts.md

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

Fonts:

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

Resources: