Skip to content

Instantly share code, notes, and snippets.

View 128keaton's full-sized avatar

Keaton Burleson 128keaton

View GitHub Profile
@128keaton
128keaton / update-app.sh
Last active January 17, 2023 09:25
Simple script to update a SPA
#!/bin/bash
# Spinner code stolen from https://willcarh.art/blog/how-to-write-better-bash-spinners
trap stop_spinner EXIT
function start_spinner {
set +m
echo -n "$1 "
{ while : ; do for X in '' '' '' '' '' '' '' '' '' '' ; do echo -en "\b\b\b\b\b\b\b\b$X" ; sleep 0.1 ; done ; done & } 2>/dev/null
spinner_pid=$!
@128keaton
128keaton / ConvertToISO.ps1
Created March 31, 2022 04:00
Powershell scripts used to help manage a collection of Wii games
$currentISOs = Get-ChildItem -Path .\iso -Name -Include *.iso
$currentRZVs = Get-ChildItem -Path .\rvz -Name -Include *.rvz
$dolphinToolPath = "..\Dolphin-x64\DolphinTool.exe"
$totalConverted = 0
foreach ($rvz in $currentRZVs)
{
$iso = $rvz -replace '.rvz', '.iso'
@128keaton
128keaton / install_ffmpeg.sh
Last active November 17, 2021 06:48 — forked from Piasy/install_ffmpeg.sh
Install ffmpeg on macOS via homebrew with all the options (minus chromaprint and decklink), updated for latest Homebrew version
#!/bin/bash
brew uninstall --force --ignore-dependencies ffmpeg
brew install chromaprint amiaopensource/amiaos/decklinksdk
brew tap homebrew-ffmpeg/ffmpeg
brew install ffmpeg
brew install --cask xquartz
brew upgrade homebrew-ffmpeg/ffmpeg/ffmpeg $(brew options homebrew-ffmpeg/ffmpeg/ffmpeg | grep -vE '\s' | grep -- '--with-' | grep -vi 'chromaprint\|decklink' | tr '\n' ' ')
@128keaton
128keaton / chip-list-autocomplete-fix.directive.ts
Created April 14, 2021 18:48
Material Chip List Autocomplete Fix Directive
import {AfterContentInit, ContentChild, Directive, QueryList, ViewContainerRef} from '@angular/core';
import {MatAutocompleteTrigger} from '@angular/material/autocomplete';
import {MatChip, MatChipList} from '@angular/material/chips';
/**
* This directive fixes the Material Chip List Autocomplete issue where if you click an option in the autocomplete menu,
* the panel doesn't return unless you click out and click back in again.
*
* Keaton Burleson
@128keaton
128keaton / mad-mac.sh
Created January 28, 2021 04:46
Mac scripts for disabling nanny stuff, automating setup, etc.
#!/bin/bash
#### DISABLE SECURITY STUFF
### DISK IMAGE VERIFICIATION
# https://apple.stackexchange.com/questions/370202/how-do-i-skip-verification-of-a-dmg-file
# Disable the "Are you sure you want to open this application?" dialog
# vi /sbin/led-tool
#!/bin/bash
# Shamelessly stolen from https://community.ui.com/stories/Repurposing-a-second-UniFi-Cloud-Key-as-a-DNS-Recursor-Radius-and-NTP-server/56605e0f-401f-4397-8c05-5b1cbe118bf6
if [ "$1" == "blue" ]; then
echo "Enabling steady blue LED"
echo 0 > /sys/class/leds/ubnt:white:dome/brightness
cat /sys/class/leds/ubnt:blue:dome/max_brightness > /sys/class/leds/ubnt:blue:dome/brightness
elif [ "$1" == "white" ]; then
echo "Enabling flashing white LED"
public static void iterateListData(ListNode listNode) {
ListNode currentList = listNode;
int nestLevel = 0;
while (currentList != null ){
StringBuilder nestIndicator = new StringBuilder("→");
for (int i = 0; i < nestLevel; i++) {
nestIndicator.append("→");
}
System.out.println(nestIndicator + " data = " + currentList.data);
@128keaton
128keaton / README.md
Last active November 8, 2019 16:00
Small scripts I use to run IntelliJ IDEA inside of WSL2 with an X11 server

1. Create ramdisk in /etc/fstab:

Open up a shell instance editing /etc/fstab:

$ sudo nano /etc/fstab

Inside the editor, append the following to create a new ramdisk. Adjust the 1024M segment to whatever size you want your ramdisk to be.

tmpfs /tmp/ramdisk tmpfs noexec,defaults,noatime,size=1024M,x-gvfs-show,mode=1777 0 0
#!/bin/bash
## INCORRECT
$(top -bn1 | grep load | awk '{printf"%.2f%%\t\t\n", $(NF-2)}')
@128keaton
128keaton / output.shell
Last active September 17, 2019 22:15
Prints HDD/Memory Usage (bash)
--------------------------------------------------|Usage|--------------------------------------------------
Memory Usage: [###############-------------------------] 38% (372M/962M, 194M available)
Disk Usage: [##########------------------------------] 26% (5G/19G, 13G available)
-----------------------------------------------------------------------------------------------------------