Skip to content

Instantly share code, notes, and snippets.

View gpshead's full-sized avatar

Gregory P. Smith gpshead

  • SF Bay Area, CA
  • 20:23 (UTC -07:00)
View GitHub Profile
@LaurEars
LaurEars / main.yml
Created July 22, 2024 18:36
LaTeX resume builder GitHub actions file
name: Build latex
# Controls when the action will run. Triggers the workflow on push
on:
push
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build-latex"
build-latex:
#!/bin/bash
set -e -o errexit -o pipefail -o nounset
###################################
# This script can be used by itself, but it's recommended that you read
# a tutorial on Proxmox forum first: https://forum.proxmox.com/threads/hey-proxmox-community-lets-talk-about-resources-isolation.124256/
###################################
# Do not modify these variables (set by Proxmox when calling the script)
vmId="$1"
@CAM-Gerlach
CAM-Gerlach / ffmpeg_splicer.py
Created August 17, 2022 08:33
FFMPEG Media Editing Script/Module
#!/usr/bin/env python3
import argparse
import datetime
from pathlib import Path
import subprocess
import tempfile
TIME_PRECISION = 2
@justinschuldt
justinschuldt / raspberry-pi-zero_as_webcam.md
Last active November 26, 2024 19:18
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@marcan
marcan / rpi_cam_auth.py
Created January 25, 2019 07:48
Raspberry Pi Camera V2 DRM authentication example
import hmac, hashlib
# Data from I²C trace at https://hackaday.io/project/19480-raspberry-pi-camera-v21-reversed/log/52547-i2c-logic-analyzer-trace
# Secret key from VideoCore blob
# serial[8], serial[7:4], serial[3:0]
serial = bytes.fromhex("EE8C196D8301230B59")
# rPi -> camera random number
numIn = bytes.fromhex("5805F3C898C3133154498E082F2E703516F2DBD1")
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active March 15, 2025 09:58
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) [email protected]
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@TrentSPalmer
TrentSPalmer / 2018-02-13-051950_722x452_scrot.png
Last active May 26, 2024 18:52
Arch Headless Virt Install
2018-02-13-051950_722x452_scrot.png
@stecman
stecman / _readme.md
Last active January 18, 2025 14:31
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 22, 2025 01:00
Swift Concurrency Manifesto
@knowsuchagency
knowsuchagency / typecheck.py
Last active December 23, 2024 06:09
A cell magic to enable the use of mypy within jupyter notebooks
"""
Add mypy type-checking cell magic to jupyter/ipython.
Save this script to your ipython profile's startup directory.
IPython's directories can be found via `ipython locate [profile]` to find the current ipython directory and ipython profile directory, respectively.
For example, this file could exist on a path like this on mac:
/Users/yourusername/.ipython/profile_default/startup/typecheck.py