Skip to content

Instantly share code, notes, and snippets.

@Varstahl
Varstahl / packer.bat
Created June 5, 2023 15:15
Download the latest x64 iTunes, extract the basic CoreAudio files and packages them for easy use with OBS
@echo off
setlocal
set PATH=%PATH%;C:\Program Files\WinRAR
set FILES=ASL.dll CoreAudioToolbox.dll CoreFoundation.dll icudt62.dll libdispatch.dll libicuin.dll libicuuc.dll objc.dll
set DEST=%~dp0tmp
mkdir "%DEST%"
mkdir "%DEST%\msi"
curl -L https://www.apple.com/itunes/download/win64 -o "%DEST%\iTunes64Setup.exe"
winrar e "%DEST%\iTunes64Setup.exe" "%DEST%"
msiexec /a "%DEST%\iTunes64.msi" /qn TARGETDIR="%DEST%\msi"
@Varstahl
Varstahl / .bashrc
Created March 10, 2023 11:43
Use SSH agent on WSL2 and add OpenSSH keys from the host. We pipe private keys instead of using the files directly because of loose permissions on the host filesystem.
# Activate ssh agent
if [ -z "${SSH_AUTH_SOCK}" ]; then
eval $(ssh-agent -s)
fi
# SSH keys
keys=( $(ssh-add -l | awk '{print $2}') )
if [[ ! ${keys[*]} =~ (^|[[:space:]])"SHA256:…"([[:space:]]|$) ]]; then
echo XYZ key absent, adding it…
ssh-add - < /mnt/…/private_key.pem
@Varstahl
Varstahl / optionsonar-grstack.user.css
Last active April 7, 2021 15:06
Apes like primary colors
/* ==UserStyle==
@name OptionSonar Puts/Calls recolour
@namespace https://gist.github.com/Varstahl/47a6812a28a20a40ac4e07cd04f367d7/raw/optionsonar-grstack.user.css
@version 0.1.2
@description Green/Red Option Stacks
@license BSD-2-Clause
@author Varstahl
==/UserStyle== */
@-moz-document url-prefix("https://www.optionsonar.com/unusual-option-activity/") {
/* ==UserStyle==
@name Nasdaq Dark
@namespace Stylus
@version 0.1.1
@homepageURL https://gist.github.com/Varstahl/c64a8d8d07023c0446eb48786239bd11/raw/nasdaq-dark.user.css
@license BSD-2-Clause
@author Varstahl
==/UserStyle== */
@-moz-document regexp("https://www.nasdaq.com/market-activity/stocks/.+") {
@Varstahl
Varstahl / nicrename.sh
Created January 19, 2021 15:18
This script takes a list of space separated `desiredInterfaceName=HWaddr`, and renames them if necessary after network has been setup. Useful in OpenWRT 18+ and other embedded distros where udev is not available for remapping. Uses `ifconfig`, `awk`, `cut`. and `grep`.
#!/bin/sh /etc/rc.common
# OpenWRT udev-less physical interface renamer
#
# Place in /etc/init.d/ with +x
# /etc/init.d/<scriptname> enable
# /etc/init.d/<scriptname> enabled && echo on
# start after networking and logging
START=13
@Varstahl
Varstahl / centSetup.sh
Created May 29, 2019 13:52
A small CentOS VM post-cloning script to change hostname and regenerate SSH keys
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <hostname>"
exit 1
fi
printf "Starting setup with hostname \033[1;32m$1\033[0m: continue [y/N]? "
while true; do
read -sn1 response
case "$response" in
[yY]) printf '\033[1;32my\033[0m\n'; break;;