Skip to content

Instantly share code, notes, and snippets.

View zsarge's full-sized avatar

Zack Sargent zsarge

View GitHub Profile
@zsarge
zsarge / Google Apps Script for Spreadsheet.js
Created July 31, 2025 01:14
Scripts I used to plan my 2025 road trip
/**
* The main function to use in your spreadsheet is:
* MAPS_GET_DETAILS(destination, starting_location)
*
* This is not "good code", but it worked for me so I thought I'd share.
*
* If you use this, configure:
* - API_KEY
* - MPG & AVG_PRICE_PER_GAL
*/
@zsarge
zsarge / add-times-to-images-based-on-names.py
Created July 1, 2025 15:13
Update the times on photos based on their names.
"""
When you download photos from Google Photos, the files do not keep the appropriate Modified/Created times.
This script takes a folder path, and loops through the file names of all images from Google Photos.
If the images are images, the EXIF data is updated; Otherwise, we just update the file times.
This script was based on https://github.com/valentin-stamate/photo-date/tree/master
with input from Deepseek V3.
"""
import os
@zsarge
zsarge / README.md
Created June 29, 2025 03:17
Export Google Recorder Recordings With Metadata

Google Recorder Export with metadata

Motivation: Google Recorder currently does not make it easy to export recordings with associated metadata.

I have a significant number of recordings, but if I use the default "share" feature, then only the titles are exported.

Notably, the titles of the recordings do not include the dates by default.

If you want to export all recordings with the dates they were created and Google's speech-to-text, I recommend Google Takeout.

@zsarge
zsarge / create-kml-file.py
Created May 4, 2025 05:28
KML List of all Firetowers in USA
#!/usr/bin/env python3
"""
This script reads from "urls.txt", which is assumed to be the list of
firetowers from http://nhlr.org/.
From there, it parses all of the webpages, and builds up a "firetowers.kml" file,
which contains the points from the urls found.
Estimated runtime: 15 to 30 minutes, depending on the time slept.
@zsarge
zsarge / docker-compose.override.yml
Created April 22, 2025 18:46
STLP Docker Compose
services:
ctfd:
image: ctfd/ctfd
ports:
- "4500:8000"
environment:
- UPLOAD_FOLDER=/var/uploads
- LOG_FOLDER=/var/log/CTFd
- DATABASE_URL=sqlite:///ctfd.db
- WORKERS=1
@zsarge
zsarge / SnipeIt Modified Label.php
Created February 11, 2025 17:02
SnipeIT modified label for Norse IoT. This has the barcode and our text.
<?php
namespace App\Models\Labels\Tapes\Brother;
class TZe_12mm_A extends TZe_12mm
{
// this file lives at /var/www/html/snipeit/app/Models/Labels/Tapes/Brother/TZe_12mm_A.php
private const BARCODE_SIZE = 5.00;
private const BARCODE_MARGIN = 0.60;
private const TEXT_SIZE_MOD = 1.00;
#!/usr/bin/env python3
from pwn import *
realpath = "/home/sarge/Documents/bcctf/challenge/calling_convention"
elf = ELF(realpath)
# create a ropchain
rop = ROP(elf)
@zsarge
zsarge / install_fedora_software.sh
Created April 5, 2024 01:55
Bash script to install all of the software I frequently need on Fedora
#!/bin/bash
# These are all of the things that I install on Fedora linux.
set -e # exit on first error
sudo dnf update --refresh
# install chrome
sudo dnf install fedora-workstation-repositories
#!/bin/bash
set -e
# this script:
# 1. downloads downloads drivers for USB to UART (requires GUI input)
# 2. installs Xcode command line tools with homebrew
# 3. installs Arduino IDE and adds it to the dock
# 4. downloads Arduino CLI
# 5. adds board support for ESP32s
#
@zsarge
zsarge / install_vms.sh
Last active October 31, 2023 03:08
Install OWASP PyGoat and WebGoat VM from OneDrive
#!/bin/bash
set -e
# contains no hidden info, fyi
YOUR_ONEDRIVE_SHARE_LINK="https://mymailnku-my.sharepoint.com/:u:/g/personal/sargentz1_mymail_nku_edu/EVMxZ0hCDfZMnKpeqHpVpZQB-utsXsOBxYgVWtQuhyLUig?e=hPj1Zq&download=1"
install_path="/tmp/install_pygoat"
mkdir -p "$install_path"
cd "$install_path"