Skip to content

Instantly share code, notes, and snippets.

View hkva's full-sized avatar

Hunter Kvalevog hkva

View GitHub Profile

Standalone software:

  • Simple video trimmer/cropper using ffmpeg and SDL_Render
  • National Weather Service watch/warning notifier
  • National Weather Service live radar viewer
  • Wayland-based Linux desktop environment that finally meets the standard of quality we had with Windows 7
  • GUI frontend for lldb

Source engine stuff:

  • Libraries for interacting with Source Engine files that aren't the old and rotted Source 2013 SDK
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../SDL" SDL)
add_executable(vsync "${CMAKE_CURRENT_LIST_DIR}/vsync.cc")
target_link_libraries(vsync PRIVATE SDL3::SDL3)
for %%f in (..\\*.wav) do (
ffmpeg -y -f lavfi -i color=size=1920x1080:rate=25:color=black -i %%f -vf "drawtext=fontfile=GoetheBold.ttf:fontsize=120:fontcolor=red:x=(w-text_w)/2:y=1080/2:text='%%~nf'" -shortest tmp\\%%~nf.mp4
echo file tmp\\%%~nf.mp4 >> list.txt
)
ffmpeg -y -f concat -safe 0 -i list.txt -c copy sounds.mp4
@hkva
hkva / printfcheck.c
Last active July 15, 2022 22:31
Format string vulnerability finder
//
// Format string vulnerability finder
//
// $ gcc printfcheck.c -Wall -O3 -g -shared -lunwind -lunwind-x86_64 -o printfcheck.so
//
// $ gcc printfcheck.c -Wall -O3 -g -shared -m32 -lunwind -lunwind-x86 -o printfcheck.so
//
// $ PRINTFCHECK_TRACE=1 PRINTFCHECK_BACKTRACE=1 LD_PRELOAD=./printfcheck.so ./prog
//
@hkva
hkva / Popfile.sublime-syntax
Created July 6, 2022 01:00
MvM popfile syntax highlighting for Sublime Text
%YAML 1.2
---
# See http://www.sublimetext.com/docs/syntax.html
file_extensions:
- pop
scope: source.example-c
contexts:
main:
# Strings
@hkva
hkva / yt-rip.py
Last active May 21, 2022 03:06
Python script to rip music from YouTube. Includes MP3 metadata, normalizes loudness, and embeds album art
#!/usr/bin/env python3
import json
import math
import os
import sys
import PIL.Image as img
import pyloudnorm as pl
import soundfile as sf