Skip to content

Instantly share code, notes, and snippets.

View kagzgenius's full-sized avatar

Matthew Obwaya kagzgenius

View GitHub Profile
@breiter
breiter / bluetoohtd-restart.sh
Last active July 7, 2022 17:56
Restart bluetoothd in macOS
#!/bin/sh
#kill bluetoothd to reset bluetooth wonkiness in macOS
#catalina, big sur, monterey
#fixes continuity, magic keyboard mismapping of function keys, magic mouse scrolling
current_userid=$(id -u)
if [ $current_userid -ne 0 ]; then
echo "$(basename "$0") requires superuser privileges to run" >&2
echo "try: \033[1;36msudo $(basename "$0")" >&2
@roalcantara
roalcantara / 0_tldr.zsh
Last active December 9, 2023 00:30
Glob (globbing)
## TL;DR
setopt extendedglob
ls *(<tab> # to get help regarding globbing
rm ../debianpackage(.) # remove files only
ls -d *(/) # list directories only
ls /etc/*(@) # list symlinks only
ls -l *.(png|jpg|gif) # list pictures only
ls *(*) # list executables only
ls /etc/**/zsh # which directories contain 'zsh'?