Skip to content

Instantly share code, notes, and snippets.

View Aldaviva's full-sized avatar
🆒
This user is COOL

Ben Hutchison Aldaviva

🆒
This user is COOL
View GitHub Profile
@Aldaviva
Aldaviva / Retrospect.md
Last active May 14, 2022 03:27
Retrospect is annoying, slow, and broken, but I know how to use it

Extract backed-up registry to files, not to a live system

  1. Restore
  2. Advanced Mode
  3. Restore an entire volume
  4. Pick the Source snapshot and wait for it to finish matching
  5. For the Destination, pick any drive (it won't be overwritten) and create a new Subvolume in it (it's just a new subdirectory which will contain the restored files)
  6. Change the restore method to Restore Missing Files Only
  7. In Files Chosen, deselect the root drive so that there are 0 files chosen
  8. In Options → More Choices → Windows → System, ensure Restore System State is checked. I also disabled Restore Security Information because registry hive files have very restrictive permissions by default, which makes them harder to work with while restoring.
  9. Restore
import xapi from 'xapi';
const cameraBrightnessCheckboxWidgetId = "camera_brightness_checkbox";
const brightnessModeConfiguration = xapi.Config.Cameras.Camera["1"].Brightness.Mode;
brightnessModeConfiguration.on(renderBrightnessCheckbox);
render();
async function render(){
return renderBrightnessCheckbox(await brightnessModeConfiguration.get());
@Aldaviva
Aldaviva / install-dotnet
Last active June 15, 2022 15:51
Install the ASP.NET Core runtime machine-wide on a Raspberry Pi, where packages are unavailable and you normally have to fuck around with arguments and symlinks
#!/bin/sh
SCRIPT_FILE=/root/dotnet-install.sh
INSTALLATION_DIR=/usr/share/dotnet
sudo rm -f $SCRIPT_FILE
echo Downloading installation script
sudo wget -q https://dot.net/v1/dotnet-install.sh -O $SCRIPT_FILE
sudo chmod o+x $SCRIPT_FILE
@Aldaviva
Aldaviva / lines-of-code.sh
Created January 18, 2023 09:36
Count non-whitespace lines of code in a directory
grep --include '*.js' --recursive --invert-match --line-regexp --count --exclude-dir='lib' --exclude-dir='thirdparty' --exclude-dir='vendor' '\s*' . | awk -F : '{ sum += $2 } END { print sum }'
@Aldaviva
Aldaviva / wmp_h.265_hevc.md
Last active June 1, 2025 01:29
Play H.265/HEVC videos in Windows Media Player (Classic) without a third-party codec pack or media player. Tested using Microsoft.HEVCVideoExtension_2.0.60091.0_x64__8wekyb3d8bbwe with WMP 12.0.20348.1311 on Windows Server 2022 21H2 and 12.0.22621.1105 on Windows 11 22H2.

Download

  1. Go to https://store.rg-adguard.net.
  2. Search for the HEVC Video Extensions from Device Manufacturer (Microsoft.HEVCVideoExtension) app by entering the following store URL into the search box and clicking the button.
    https://www.microsoft.com/en-us/p/hevc-video-extensions-from-device-manufacturer/9n4wgh0z6vhq
    
    • Do not use the normal HEVC Video Extensions app URL, because that can't play HEVC videos in Windows Media Player for some inscrutable reason.
  3. Download the AppxBundle file.
    • You may have to right click › Save Link As because the URL scheme is http, not https, if your browser is set to enforce HTTPS-only mode.
  • If it tries to save as a filename that's just a GUID, you may copy the correct .AppxBundle filename and save it as that instead.
@Aldaviva
Aldaviva / samba.sh
Created August 1, 2023 01:10
Samba SMB CIFS mount share in Linux
sudo mkdir -p /mnt/aegir
sudo mount -t cifs -o username=ben,uid=ben //aegir.aldaviva.com/Ben /mnt/aegir
@Aldaviva
Aldaviva / cipher-suites.md
Last active August 21, 2024 07:12
Windows Server TLS cipher suites for A ranking on Qualys SSL Labs SSL Test

SSL Cipher Suite Order

📃 Edit using gpedit.msc › Computer Configuration > Administrative Templates › Network > SSL Configuration Settings > SSL Cipher Suite Order.

🅰 These cipher suites will grant you an A+ ranking on Qualys SSL Labs SSL Server Test and testssl.sh.

⚡ Changes require a reboot to take effect.

⚠️ Using the Server 2019 cipher suite order on Server 2022 will result in Windows Update failures with the error message "we couldn't connect to the update service." Before upgrading from Server 2019 to Server 2022, make sure to disable this policy or set its value to the Server 2022 value below.

🍦 Default cipher suite orders are listed on Microsoft Learn for Server 2019, [Server 2022](https://learn.microsoft.com/en-us/windows/win32/secauthn/tls-cipher-suites-in-wi

@Aldaviva
Aldaviva / oath-totp-google-authenticator-export-keepass-import.md
Last active June 7, 2025 00:33
Export one-time passwords from Google Authenticator and import them into KeePass

Import TOTP from Google Authenticator into Keepass

  1. Export a QR code from Google Authenticator
    1. Open the Google Authenticator Android app
    2. Tap ☰ › Transfer accounts › Export accounts
    3. Laboriously deselect all accounts except the one you want to export
    4. Tap Next
  2. Decode the otpauth-migration URI from the QR code
    1. Take a screenshot of the QR code on the screen by holding Power+Volume Down
  3. Open the screenshot in Google Photos or another app that can decode QR codes
@Aldaviva
Aldaviva / linux-autoupdate.md
Last active April 15, 2025 15:54
Enable automatic updates in Fedora and Debian
@Aldaviva
Aldaviva / fish-setup.sh
Last active May 3, 2025 11:49
Fish setup
sudo apt install fish
# sudo dnf install fish
chsh -s $(which fish) $(whoami)
fish
set -U fish_greeting
set -Ux EDITOR (which emacs)
set --show EDITOR
# you'll probably need to log out for these to take effect; until then they will be shadowed by other values like nano