Skip to content

Instantly share code, notes, and snippets.

View exaV's full-sized avatar

Patrick Del Conte exaV

View GitHub Profile
@agners
agners / elgate-wave3-fix.sh
Created June 5, 2022 12:22
Elgato Wave:3 Pulseaudio "unstuck"
#!/bin/sh
# Getting Elgato Wave:3 Microphone input "unstuck" on Linux & Pulseaudio
# Replace <card-name> with your microphones card name (check "pacmd list-cards")
# It looks something like "usb-Elgato_Systems_Elgato_Wave_3_<serial>-00"
pacmd set-card-profile alsa_card.<card-name> output:analog-stereo
pacmd set-card-profile alsa_card.<card-name> input:mono-fallback
@exaV
exaV / docker-grep.sh
Last active August 25, 2020 12:56
A fuzzy wrapper for the docker cli. Execute a docker command for all containers who match a search term. Do something sensible if no command or no search terms are provided.
docker_ps_formatted(){ docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}" }
# dockerg [ARGS] SEARCH
# basically docker ps | grep SEARCH | xargs docker ARGS
# but all args are optional
# e.g. 'dockgerg bank' -> check which services are found; dockgerg logs --tail 15 bank -> log the service
# e.g. 'dockerg start Exited' -> start all containers with status 'Exited'
dockgerg(){
if [ "$#" -eq 0 ]; then docker_ps_formatted; return; fi
SEARCH=${@:$#};
if [ "$#" -eq 1 ]; then docker_ps_formatted | grep $SEARCH; return; fi