Skip to content

Instantly share code, notes, and snippets.

View steadystatic's full-sized avatar

Mike Wabst steadystatic

View GitHub Profile
@steadystatic
steadystatic / Microsoft.PowerShell_profile.ps1
Created December 2, 2021 19:49
Minimal PowerShell Profile for bash guy
# Uncomment $Workspace_Dir set preferred location (defaults to $home):
# $Workspace_Dir="Documents\workspace"
Set-Location $home\$Workspace_Dir
set-alias dc 'docker-compose'
set-alias vim 'nvim-qt'
set-alias ll 'dir'
set-alias grep 'findstr'
function rmrf {
@steadystatic
steadystatic / eac-to-aac.sh
Created June 16, 2021 15:58
Re-encode EAC audio (unsupported on older DLNA clients like Playstation 3) to AAC
#!/bin/bash
# Used to help older DLNA clients (e.g. PS3) convert mkv file audio
# (requirement) mediainfo
for mkvFile in $(find ./ -iname "*.mkv" ); do
# Greps the output from mediainfo (required to run script)
eacMatch=$(mediainfo $mkvFile | grep -cim1 "A_EAC3");
# Find files that contain EAC audio
if [[ ${eacMatch} -ge 1 ]]; then
# Create directories to process files
@steadystatic
steadystatic / .gitconfig
Created December 22, 2020 16:43 — forked from jaburns/.gitconfig
Using VS as mergetool on WSL
[merge]
tool = vs
[mergetool "vs"]
cmd = /home/XXX/win_merge.sh merge $LOCAL $REMOTE $BASE $MERGED
trustExitCode = false
[mergetool]
keepBackup = false
[diff]
tool = vs
[difftool "vs"]
@steadystatic
steadystatic / example.sh
Created September 6, 2019 20:36
Open a project's npm advisories in default browser (macOS)
for advisory in $(npm audit | grep 'More Info' | awk -F':' '{print "https:" $3}' | sort -u); do open $advisory; done;
@steadystatic
steadystatic / install_minecraft.sh
Created July 6, 2019 21:33
Simple install script for Minecraft on Linux
#!/bin/bash
# YOU HAVE TO RUN WITH ROOT
# AND YOU NEED TO INSTALL JAVA FIRST
# You can install it on Debian/Ubuntu with: "sudo apt-get install openjdk-8-jre"
dir="/opt/minecraft"
# Script to make Install of Minecraft
makeInstall() {
@steadystatic
steadystatic / jq-insert-var.sh
Created June 28, 2019 18:24 — forked from joar/jq-insert-var.sh
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@steadystatic
steadystatic / tmuxa.zsh
Last active June 18, 2019 16:29
tmuxa shell fn (requires Tmuxinator)
## Attach to running tmuxinator/start a new tmuxinator session w/ fuzzy list
tmuxa () {
if [[ "$(tmux list-sessions -F '#S'&>/dev/null| wc -l)" -ne 0 ]]; then
muxSessions=''
muxSessionsList=$(tmuxinator ls | cut -d':' -f 2 | tr '[:blank:]' '\n')
while IFS= read -r line; do
# Denote running sessions with asterisk
if [[ "${line}" == *"$(tmux ls | cut -d':' -f 1)"* ]]; then
muxSessions+="$(echo $line | sed -e "s|$line|$line [*]|g")\n"
elif [[ "${line}" ]]; then
@steadystatic
steadystatic / consul-vault-cli-kickstart.sh
Created May 8, 2019 18:04
Kickstart for using vault and consul cli tools (helpful alternative to curl for debugging missing consul configs or vault secrets)
# Consul and Vault k8s cli clients for working with k8s cluster consul and vault per namespace
# Mac: brew install consul vault
# Consul v1.4.4
# Vault v1.1.1
# kubectl (client: v1.14.1, server: v1.10.11)
# export k8s namespace if you use namespace, otherwise use default:
export NAMESPACE=<your-namespace-or-just-put-default>
export VAULT_TOKEN=<your-vault-token>
@steadystatic
steadystatic / kubectl-shortcuts.sh
Created May 3, 2019 02:23 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@steadystatic
steadystatic / my-100-vim-plugins.md
Last active April 25, 2019 15:48
I like plugins I guess - mostly web dev/javascript focused