Skip to content

Instantly share code, notes, and snippets.

View hypevhs's full-sized avatar

hypevhs

View GitHub Profile
@hypevhs
hypevhs / wtframe.html
Created November 6, 2019 22:34
Open in firefox with cache enabled. Every time you refresh the page another layer of iframe nesting is added.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<script>
function getContent() {
console.log('getcontent called');
setTimeout(function() {
var iframe = document.getElementById('wst-iframe');
@hypevhs
hypevhs / gist:9bd25f0e3f2dd1780a6f078d5d76473b
Last active March 7, 2025 03:23
how to use xiv character model for vrchat

This is gonna be long and I might not finish it but here's what I got. This shit is so long that if I get it down to a science I might make a program to automate it.

Overview

We will study your character stats, use FFXIV TexTools to export the model parts, Blender to fix it up....

Collecting data

Do you have your character appearance saved? It's not essential but it's very useful to have. It's in the form of a DAT. I hope you backed it up if you created them on an old PC. I'm not sure if you can resave it from an existing character. What I did was use the Shadowbringers Benchmark. I seem to remember there was a way to import your character from the base game but I can't remember. Anyway first you'll need to copy the character DAT to the benchmark folder.

@hypevhs
hypevhs / install-ripgrep-on-ubuntu.sh
Last active July 6, 2021 20:05 — forked from kostaz/install-ripgrep-on-ubuntu.sh
Install ripgrep on Ubuntu
#!/usr/bin/env bash
# Install ripgrep on Ubuntu
# Requires wget(1), curl(1), jq(1)
#
# I'm not responsible for any damages. Tested on WSL Ubuntu 18.04.4 LTS.
# List of changes from upstream:
# - use /usr/bin/env bash
# - set -e for zero error tolerance, and set -x for debugging
# - handle newer ripgrep release directory structure
@hypevhs
hypevhs / yt-dlp-filenames.zsh
Last active October 2, 2021 04:19
yt-dlp check consistent filenames
# DEPRECATED
# in a directory filled with yt-dlp saved items, we want filenames for
# metadata/thumbnails/video/etc to be exactly the same up until the extension.
# sometimes this doesn't happen due to e.g. a change in channel name or video title.
# for each video ID in this dir, print out the video IDs where the filenames (minus extensions) do not match.
find . -maxdepth 1 -type f -regextype grep -regex '.*\[[a-zA-Z0-9_-]\{11\}\]\..*' -printf '%f\n' | grep -Po '(?<= \[).{11}(?=\]\.)' | sort -u | while read f; do if ! for ff in *"${f}"*; do echo "$ff" | sed 's_\.\(\(info\|live\_chat\)\.json\|mkv\|mp4\|webp\|jpg\|[a-z]\{2,3\}\(-[A-Za-z0-9_-]\{2,14\}\)\?\.vtt\)$__'; done | sort -u | wc -l | grep -Eq '^1$'; then echo "$f"; fi; done
# inspect a single ID
for f in *W3_BIZLuXuw*; do echo "$f"; done | sed 's_\.\(\(info\|live\_chat\)\.json\|mkv\|mp4\|webp\|jpg\|[a-z]\{2,3\}\(-[A-Za-z0-9_-]\{2,14\}\)\?\.vtt\)$__'
@hypevhs
hypevhs / yt-dlp-pairs.zsh
Last active October 1, 2021 21:29
yt-dlp check for exactly 1 of video, metadata, etc
# DEPRECATED
# in a directory filled with yt-dlp saved items,
# for every video ID, we want exactly ONE video, ONE metadata json, and ONE thumbnail.
# usually, it's the video that's missing. maybe move the rest to legacy/?
# for each video ID in this dir, print out the video IDs where one of the content types is missing.
find . -maxdepth 1 -type f -regextype grep -regex '.*\[[a-zA-Z0-9_-]\{11\}\]\..*' -printf '%f\n' | grep -Po '(?<= \[).{11}(?=\]\.)' | sort -u | while read f; do EXTS="$(for ff in *"${f}"*; do echo "${ff}"; done | perl -pe 's|(.*?)\.(((info\|live_chat)\.)?json\|mkv\|mp4\|vtt\|webp\|jpg)$|\2|')"; if [[ "$(echo "$EXTS" | grep -Eo '^(mkv|mp4)$' | wc -l)" != "1" || "$(echo "$EXTS" | grep -Eo '^(jpg|webp)$' | wc -l)" != "1" || "$(echo "$EXTS" | grep -Eo '^info\.json$' | wc -l)" != "1" ]]; then echo "$f"; fi; done
# inspect a single ID
echo "00vYncpl0pk" | while read f; do EXTS="$(for ff in *"${f}"*; do echo "${ff}"; done | perl -pe 's|(.*?)\.(((info\|live_chat)\.)?json\|mkv\|mp4\|vtt\|webp\|jpg)$
@hypevhs
hypevhs / route-convert-to-ip.bash
Created October 11, 2021 20:23
Convert /proc/net/route IP from hex to quad-dotted representation
#!/usr/bin/env bash
# not zsh portable
set -euxo pipefail
# Usage: ... | hex_to_ip
# Reads stdin and converts IPs from hex to quad-dotted representation.
function hex_to_ip {
if [[ -n "$1" ]]; then echo "$0: Too many arguments">&2; return 1; fi
# might break on big endian?
@hypevhs
hypevhs / script.sh
Created November 29, 2021 19:15
join lines on long fields in google-calendar-exported vCal (.ics) file
# demonstrate pattern
echo -e 'a:a\n a\nb:bb\nc:c\n c' | perl -0777 -p -e 's/\n //g' | od -c
# input:
# a:a
# a
# b:bb
# c:c
# c
# outputs:
@hypevhs
hypevhs / notes-nix-sensei.md
Last active February 28, 2022 16:03
Haskell sensei is broken on nix! Can we fix it?

Sensei, the haskell test runner, is marked as broken in nixpkgs. The build must be failing. But why?

Build it. It's broken, and because flake registry points to master by default, specify github branch so I don't download an extra 3 GB just getting newer coreutils. The --impure is so nix recognizes the envvar, as it's an "impure" input.

NIXPKGS_ALLOW_BROKEN=1 nix build --impure 'github:nixos/nixpkgs/nixpkgs-unstable#haskellPackages.sensei'

Fails 13 examples. All of them mention posix_spawnp. Example:

test/EventQueueSpec.hs:16:9:

@hypevhs
hypevhs / dfree
Last active February 3, 2022 07:51 — forked from sling00/dfree
dfree for samba that treats ZFS as a special case
#!/usr/bin/env bash
# vim: set et ts=2 sw=2:
# changes: run through shellcheck, fixing several bugs
set -euo pipefail
HERE="$(realpath "$1")"
if findmnt --noheadings --output FSTYPE --target "$HERE" | grep -Pq '^zfs$'; then
echo "dfree: $HERE is zfs" >&2
@hypevhs
hypevhs / zfs-reclaim.bash
Last active February 3, 2022 17:36
estimate space actually used by snapshots of a dataset
#!/usr/bin/env bash
# vim:set et sw=2 ts=2:
# estimate space actually used by snapshots of a dataset
# original by https://www.reddit.com/r/zfs/comments/bzo817/running_out_of_space_easy_way_to_visualize/er0ccbe/
# edits by me
# NO WARRANTY
set -euxo pipefail
here="$(realpath "$1")"