Skip to content

Instantly share code, notes, and snippets.

View whi-tw's full-sized avatar
🌐
YAY, STATUS FROM API

whi-tw

🌐
YAY, STATUS FROM API
View GitHub Profile
@whi-tw
whi-tw / font-face.css
Created August 5, 2023 15:12
Fira Code Nerd Font for Blink Shell
This file has been truncated, but you can view the full file.
@font-face {
font-family: "FiraCode Nerd Font Mono";
font-style: normal;
font-weight: 200;
src: url("data:font/ttf;charset=utf-8;base64,AAEAAAASAQAABAAgR0RFRr7qoc8AH4F8AAAB2EdQT1NoLkU8ACBAOAAASMBHU1VCu506wwAfg1QAALziT1MvMoHBkFMAAAGoAAAAYFBmRWQW5NdDACCI+AAAAjhjbWFwgoQ4ogAAWWAAACOoY3Z0IEVKGEcAAIv4AAAAqGZwZ22eNhXSAAB9CAAADhVnYXNwAAAAEAAfgXQAAAAIZ2x5ZrLHi0cAATtAABuZ2GhlYWQVlbEeAAABLAAAADZoaGVh/v4BRQAAAWQAAAAkaG10eEGKNqwAAAIIAABXVmxvY2Fw4D2gAACMoAAArqBtYXhwM4sOngAAAYgAAAAgbmFtZea9wogAHNUYAAAJCXBvc3T9qsMSABzeJAACo1BwcmVwis2cHgAAiyAAAADWAAEAAAAGAIPgudo7Xw889QAXB54AAAAA3c/67gAAAADgomub8iv8GAXICWAAAAAGAAIAAQAAAAAAAQAABwj9qAAABLDyK/7oBcgAAQAAAAAAAAAAAAAAAAAAAAQAAQAAK6cIxwBgAHgACgACAkADeACNAAAEqQHiAAMAAwAEBLABLAAFAAAE9ASSAAAAkgT0BJIAAAKrADIBPgAAAgAACQAAAAAAAOAAAu8SAfn7AgAgOAAAAABDVERCAYAADf//Bwj9qAAABwgCWGAAAJ/f1wAABBoFXgAAACAABgSwAFAAAAAABLAAAASwAAAAAAHfAVwAdACaACIAdQH9AQcBaQBtAJYBowDRAbUAdwCkANQAggB7AKAAsQCwANQAkQCTAcMBngC7AOYAuwDHABkAPADZAJAAugEOAScAaQC6AN8ApQDtASgARQC6AGsBBwBjAOUAagBaAKMAQAAOAE4AQgCi
@whi-tw
whi-tw / README.MD
Last active April 14, 2024 14:54
UTM dynamic resolution fix (workaround)

Steps

  1. mkdir /opt/utm-resolution-fix/
  2. cp watch-and-fix.sh /opt/utm-resolution-fix/watch-and-fix.sh
  3. chmod +x /opt/utm-resolution-fix/watch-and-fix.sh
  4. cp utm-resolution-fix.service /etc/systemd/user/utm-resolution-fix.service
  5. systemctl --user daemon-reload
  6. systemctl --user enable --now utm-resolution-fix.service

Now, resizing the UTM window should actually resize the guest automatically.

@whi-tw
whi-tw / gh.plugin.zsh
Last active February 11, 2022 17:40
zsh plugin to add gh command completion
# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh
# Add completions folder in $ZSH_CACHE_DIR
command mkdir -p "$ZSH_CACHE_DIR/completions"
(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
# If the completion file does not exist, generate it and then source it
# Otherwise, source it and regenerate in the background
if [[ ! -f "$ZSH_CACHE_DIR/completions/_gh" ]]; then
gh completion -s zsh >| "$ZSH_CACHE_DIR/completions/_gh"
source "$ZSH_CACHE_DIR/completions/_gh"
@whi-tw
whi-tw / printer.cfg
Created August 10, 2021 17:26
Klipper config for my ANET A8
# This file contains common pin mappings for Anet A8 printer from 2016
# and 2017. To use this config, the firmware should be compiled for
# the AVR atmega1284p.
# Note that the "make flash" command does not work with Anet boards -
# the boards are typically flashed with this command:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# See docs/Config_Reference.md for a description of parameters.
@whi-tw
whi-tw / mute_tool.sh
Created December 2, 2020 13:04
Mute either USB microphone or internal soundcard, depending on presence.
#!/usr/bin/env bash
USB=false
select_card() {
USB="false" # assume that usb mic is not attached
cards="$(arecord -l | grep card)"
echo "${cards}" | grep -q USB && USB="true" # if a device has USB in the name, usb mic is attached and we probs want to use it
while read -r card; do
# loop through cards. if USB, then pick the first card with USB in the name. else, pick the first card w/o
if [ "${USB}" == "true" ]; then
echo "${card}" | grep -q USB && echo "true" $(echo "${card}" | awk '{print $2}' | cut -d':' -f1) && return
@whi-tw
whi-tw / rpm
Created June 18, 2020 11:15
Cisco Anyconnect cscan compatibility for Arch Linux
#!/usr/bin/env bash
if [ "${1}" == "-q" ] && [[ ${2} == --qf* ]]; then
arch="$(uname -m)"
ver="$(pacman -Q ${@: -1} | awk '{print $2}')"
if [ ! -z "${ver}" ]; then
echo "{\"name\":\"${@: -1}\",\"version\":\"${ver}\",\"arch\":\"${arch}\"}"
else
echo "package ${@: -1} is not installed"
fi
elif [ "${1}" == "-ql" ]; then
@whi-tw
whi-tw / .mykman.yml
Created October 23, 2019 15:07
mykman - a dummy ykman to get 2fa codes from pass
---
some-aws-account: amazon.com/totp
some-github-account: github.com/totp
@whi-tw
whi-tw / keybase.md
Last active October 30, 2019 12:45

Keybase proof

I hereby claim:

  • I am whi-tw on github.
  • I am tnwhitwell (https://keybase.io/tnwhitwell) on keybase.
  • I have a public key ASAASE9bOituZaHlhaqQLEjQVulDI1DnECalWHVMvwtr9Qo

To claim this, I am signing this object:

@whi-tw
whi-tw / jobs.yml
Last active March 22, 2022 05:19
rclone python config wrapper
tasks:
- name: backup_something
local: "/path/to/sync"
remote: "memset_memstore:path/to/remote"
operation: sync
- name: backup_something_else
local: "/another/path/to/sync"
remote: "memset_memstore:another/path/to/remote"
operation: sync