Skip to content

Instantly share code, notes, and snippets.

View andrewmackrodt's full-sized avatar
😴

Andrew Mackrodt andrewmackrodt

😴
View GitHub Profile
import pem from 'pem'
import fs from 'node:fs'
import http from 'node:http'
import https from 'node:https'
import net from 'node:net'
import { parse as parseURL } from 'node:url'
import tls, { SecureContext } from 'tls'
type Scheme = 'http' | 'https'
@andrewmackrodt
andrewmackrodt / convert_x264.sh
Last active July 22, 2023 23:47
Vaudeville Proton Video Fix
#!/bin/bash
# Script to transcode Vaudeville 4K AVC1 media to 1080p X264/Opus so that Proton
# Experimental or Proton GE can play cutscene video and audio.
#
# Move the script to ${steam_library}/steamapps/common/Vaudeville and run. This
# script requires ffmpeg. If ffmpeg crashes with a segfault, re-run the script
# until it succeeds. Files which have successfully been transcoded already will
# be skipped on subsequent runs.
#
@andrewmackrodt
andrewmackrodt / discord-updater.sh
Last active February 15, 2023 20:20
Updates an existing discord installation to the latest version on Ubuntu
#!/bin/bash
echo -n "detecting installed version: "
installed=$(dpkg -l | awk '$1 == "ii" && $2 == "discord" { print $3 }')
if [[ "$installed" == "" ]]; then
echo "error"
exit 1
fi
echo "$installed"
echo -n "detecting latest version: "
@andrewmackrodt
andrewmackrodt / asusctl-builder.sh
Last active March 19, 2024 21:57
Ubuntu 22.04 deb creator for asusctl
#!/bin/bash
set -euo pipefail
cd $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
build_dir=$(mktemp -d)
cleanup() {
if [[ -d "$build_dir" ]]; then
rm -rf "$build_dir"
fi
@andrewmackrodt
andrewmackrodt / portable-secret-decrypt.js
Last active December 22, 2022 16:51
Decrypt Portable Secret messages using command-line (requires Node.js >= 10)
const crypto = require('crypto')
const fs = require('fs')
const readline = require('readline')
const rl = readline.createInterface({ input: process.stdin, output: process.stdout })
const prompt = (query) => new Promise((resolve) => rl.question(query, resolve))
void (async () => {
const args = process.argv.slice(2)
#!/bin/bash
function finish {
if [[ "${rtspContainerId:-}" != "" ]]; then
docker kill "$rtspContainerId"
fi
if [[ "${ffmpegPid:-}" != "" ]]; then
kill "$ffmpegPid"
fi
}
@andrewmackrodt
andrewmackrodt / convert_x264.sh
Last active October 19, 2022 22:44
Persona 4 Arena Ultimax Proton Video Fix
#!/bin/bash
# Script to transcode P4AU Microsoft ASF media to X264/Opus so that Proton Experimental
# or Proton GE can play cutscene video and audio. If there is no audio, go to
# "Options" > "System Options" and disable "Mute when not in focus" from within the game.
#
# Move the script to ${steam_library}/steamapps/common/P4U2 and run. This script requires
# ffmpeg. If ffmpeg crashes with a segfault, re-run the script until it succeeds. Files
# which have successfully been transcoded already will be skipped on subsequent runs.
#
{
"spectrum": {
"show": "false",
"n-points": "100",
"height": "100",
"use-custom-color": "false",
"fill": "true",
"show-bar-border": "true",
"scale": "1",
"exponent": "1",
#!/bin/bash
IFS=$'\n\t'
set -euo pipefail
cd "~/Downloads/series"
function merge() {
jpnSrc="$1"
en1Src="$2"
en2Src="$3"
#!/bin/bash
IFS=$'\n\t'
set -euo pipefail
cd "~/Downloads/series"
for f in $(ls -1 *.mkv); do
mkvpropedit "$f" \
--edit track:s1 --set language=eng --set flag-forced=1 --delete flag-default \
--edit track:s2 --set language=eng --set flag-default=1