Skip to content

Instantly share code, notes, and snippets.

View swolegoal's full-sized avatar

swolegoal swolegoal

View GitHub Profile
@swolegoal
swolegoal / tap-runner
Last active March 21, 2021 07:34
run your TAP tests with Tappy or with Prove!
#!/usr/bin/env bash
read -d '' _usage <<EOUSAGE
Usage: $0 tappy|prove
EOUSAGE
git_root="$(git rev-parse --show-toplevel)"
export CMOCKA_MESSAGE_OUTPUT='TAP'
_run_test() { "$1"; }
@swolegoal
swolegoal / rp_nowplaying.py
Created March 20, 2021 10:11
Get current Radio Paradise track info and album art
#!/usr/bin/env python3
from os.path import splitext as ext
from sys import stderr as STDERR
import requests as r
from time import sleep
playing = None
last_title = None
while True:
@swolegoal
swolegoal / avc_psp
Last active February 28, 2021 04:48
AVC PSP v0.1
#!/usr/bin/env bash
read -d '' _usage <<'EOUSAGE'
USAGE
avc_psp [OPTION] INPUT_DIRECTORY
avc_psp is a script that utilizes FFmpeg to encode AVC that plays on the PSP's
built-in hardware-accelerated XMB media player in a batch. If running one
instance of this script doesn't fully-saturate all of your CPU threads, you can
safely spawn as many instances of avc_psp are required to fully-saturate all of
@swolegoal
swolegoal / distro.sh
Created December 11, 2019 17:45
Bash Linux Distro Detection
#!/usr/bin/env bash
die() { (echo "$1" >&2); exit 1 ; }
# Convert ARGV or STDIN to lower-case, respectively.
lc() { tr [:upper:] [:lower:] <<<"$@" ; }
LC() { tr [:upper:] [:lower:] ; }
# Internal vars.
rpm_distros="centos rhel fedora"
@swolegoal
swolegoal / tenfour
Created March 6, 2019 21:12
Mac OS X 10.4.11 on Qemu!
#!/usr/bin/env bash
# image creation :
# qemu-img create -f qcow2 -o preallocation=metadata dsk/tenfour.qcow 40G
#qemu-system-x86_64 \
#qemu-system-x86_64 -monitor vc \
qemu-system-ppc -monitor stdio \
-machine type=mac99 \
-display gtk \
@swolegoal
swolegoal / os9+x
Created March 5, 2019 20:48
The script that I use to run Mac OS 10.0.3 and 9.2.2 on Qemu.
#!/usr/bin/env bash
# image creation :
# qemu-img create -f qcow2 -o preallocation=metadata dsk/os9+x.qcow 20G
run_vm() {
#qemu-system-x86_64 \
#qemu-system-x86_64 -monitor vc \
qemu-system-ppc -monitor stdio \
-machine type=mac99 \
@swolegoal
swolegoal / os9
Created March 4, 2019 21:50
Run Mac OS 9 on QEMU
#!/usr/bin/env bash
# image creation :
# qemu-img create -f qcow2 -o preallocation=metadata dsk/os9.qcow 20G
run_vm() {
#qemu-system-x86_64 \
#qemu-system-x86_64 -monitor vc \
qemu-system-ppc -monitor stdio \
-machine type=mac99 \
@swolegoal
swolegoal / record-screen
Created February 20, 2019 17:00
Automatic lossless hevc_nvenc screen recording with FFMPEG!!
#!/usr/bin/env bash
# NAME
# record-screen - script for recording your screen with FFmpeg!
#
# SYNOPSIS
# ./record-screen [FILE]
#
# NOTES
# • This script assumes that you are using a recent NVIDIA GPU and that you
@swolegoal
swolegoal / opnsense
Created February 20, 2019 16:38
A script that allows running your OPNsense router on Qemu/KVM.
#!/bin/bash
# image creation :
# qemu-img create -f qcow2 -o preallocation=metadata big-dsk/opnsense-test.qcow 128G
# Add the following to your /etc/dnsmasq.conf (sans comments):
#interface=wifi_vmbr0
#dhcp-range=10.0.0.50,10.0.0.200,300h
ethernet="enp37s0"