Skip to content

Instantly share code, notes, and snippets.

View iwalton3's full-sized avatar

Izzie Walton iwalton3

View GitHub Profile
@iwalton3
iwalton3 / idx_blob.py
Last active September 6, 2021 01:38
Blob Indexer/Reassembler
#!/usr/bin/env python3
import os
import os.path
import sys
import json
import math
print("Collecting files...")
files = {}
@iwalton3
iwalton3 / c.sh
Created April 22, 2021 16:51
Quick "cd from anywhere" alias
function c {
while read -r _ dir
do
if [[ -e "$dir" ]]
then
echo "$dir"
cd "$dir"
break
fi
done < <(cat ~/.full_history | tail -n 10000 \
@iwalton3
iwalton3 / pmpapi.md
Last active April 3, 2021 23:22
Plex Media Player QWebChannel API

To connect to the API:

  <script src="qrc:///qtwebchannel/qwebchannel.js"></script>
  <script>
      new QWebChannel(window.qt.webChannelTransport, function(channel) {
          // Called when API is ready
          window.channel = channel;
      });
 
@iwalton3
iwalton3 / jellyfin_extract_sub.py
Created March 27, 2021 04:15
Jellyfin Extract Subtitles
#!/usr/bin/env python3
# Based on https://github.com/EraYaN/jellyfin-stats
# pip3 install requests tqdm
URL = ""
API_KEY = ""
from re import sub
import requests
from tqdm import tqdm
@iwalton3
iwalton3 / xrandr.lua
Last active August 15, 2020 20:53
MPV Xrandr Custom Modes - Allows auto-setting framerates like 48 fps with MPV/SVP.
-- use xrandr command to set output to best fitting fps rate
-- when playing videos with mpv.
-- From https://gitlab.com/lvml/mpv-plugin-xrandr/-/blob/master/xrandr.lua
-- Available under the terms of the GPLv2
-- You need to customize this and also install custom modes. See line 241.
utils = require 'mp.utils'
-- if you want your display output switched to a certain mode during playback,
@iwalton3
iwalton3 / IPD_Adjust.py
Created July 5, 2020 13:23
Allows rapid adjustment of SteamVR IPD setting for people out of the design range of VR headsets. Just add an entry under "presets" for each user.
# IPD Adjust
# Allows rapid adjustment of SteamVR IPD setting for people out
# of the design range of VR headsets.
import json
import time
config = r"C:\Program Files (x86)\Steam\config\steamvr.vrsettings"
# Units for IPD adjustment are in mm.
presets = [
@iwalton3
iwalton3 / fingerprint-compare2.py
Last active May 20, 2020 22:03
Chromaprint Duplicate Finder (License: MIT)
#!/usr/bin/env python3
import numpy as np
import numba
import json
@numba.jit(nopython=True)
def dist(listx: numba.types.uint32[:], listy: numba.types.uint32[:]):
covariance = 0
xlen = min(len(listx),len(listy))
if xlen < 50:
@iwalton3
iwalton3 / nvenc-yuv420p10le.md
Last active April 15, 2020 13:07
Patch in Nvenc yuv420p10le on latest ffmpeg.

These instructions will allow you to encode yuv420p10le with ffmpeg while using nvenc. Note that other pixel formats have not been tested and may be broken. I do not suggest using this as your main ffmpeg installation. You also need to install the nv-codec-headers and other dependencies as required by ./configure when building.

git clone https://github.com/FFmpeg/FFmpeg
cd FFmpeg
git apply nvenc-yuv420p10le.patch
./configure pkg_config='pkg-config --static' --prefix=/usr/local --extra-version=ntd_20150126 --disable-shared --enable-static --enable-gpl --enable-pthreads --enable-nonfree --enable-fontconfig --enable-libfreetype --enable-libass --enable-libfdk-aac  --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-filters --enable-runtime-cpudetect
make -j8
# Do not run sudo make install, just use the ffmpeg as-is.
@iwalton3
iwalton3 / introzapper.sh
Last active January 3, 2023 20:53
Introzapper - Remove intros from videos without a full re-encode. Note by default only 24 seconds can be removed. (License: MIT License)
#!/bin/bash
#[file] [-d detectOnly]
alias ffmpeg="ffmpeg -nostdin"
function shortenVideo {
#[file] [shorten-by] [-d do nothing]
if [[ "$3" == "-d" ]]
then
return
@iwalton3
iwalton3 / gpaeq-print.py
Created April 3, 2020 23:49
gpaeq pulseaudio-equalizer, but it is patched to print how many dB you adjust each slider. From: https://github.com/pulseaudio/pulseaudio/blob/master/src/utils/qpaeq
#!/usr/bin/env python3
# qpaeq is a equalizer interface for pulseaudio's equalizer sinks
# Copyright (C) 2009 Jason Newton <[email protected]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,