Skip to content

Instantly share code, notes, and snippets.

View hypevhs's full-sized avatar

hypevhs

View GitHub Profile
@hypevhs
hypevhs / vcc-linux.md
Created December 5, 2023 06:02
installing vrchat creator companion on arch linux

today is 2023-12-04

leave a comment if google brought u here :shipit:

Current problem: stuck downloading Webview2

Launch VCC but it shows a white screen, then it pops up another dialog:

Downloading Microsoft Edge Webview2

And then another dialog that's mostly the same except with two funny little unicode boxes

@hypevhs
hypevhs / minecrafting.txt
Created June 3, 2023 21:19
minecrafting
minecraft
grinder
smc = standard machine casing
amc = advanced machine casing
bmf = basic machine frame
grinder =
= 18x smc + 9x amc
= (smc + 6x steel plate + 2x advanced circuit) * 9 + 18x smc
@hypevhs
hypevhs / dict.zsh
Created May 11, 2022 18:25
fun dict tricks
# use dict(1) to find all words or hyphenated terms that have all of 'aeiou' as vowels, only once each, and in that order, then output a table sorted by length descending then alphabetically descending.
dict -sre --formatted -m '^[^ _aeiou]*a[^ _aeiou]*e[^ _aeiou]*i[^ _aeiou]*o[^ _aeiou]*u[^ _aeiou]*$' | grep -Pv '^$' | awk -F$'\t' '{ print length($4) "\t" $4 "\t" $3; }' | sort -r -n | column -t -s$'\t'
# OUTPUT:
# 15 transgressiouns wik
# 15 transgressionum wik
# 14 transtendinous wik
# 14 transgressioun wik
# [ ... ]
# 7 ajeitou wik
# 7 aerious wik
@hypevhs
hypevhs / strikers-actionreplay.md
Last active February 16, 2022 06:47
reverse engineering cheats for Super Mario Strikers

Super Mario Strikers - Truly Infinite Power Ups

Super Mario Strikers. Dolphin Emulator. The goal is to make the in-game "infinite power ups" cheat actually infinite.

Analysis

In Super Mario Strikers, power ups are given in 3 situations:

  1. every time the opposing team attacks your player that wasn't dribbling the ball
  2. every time your player takes a "cool" shot
@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")"
@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 / 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 / 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 / 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 / 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)$