Skip to content

Instantly share code, notes, and snippets.

View garethnunns's full-sized avatar

Gareth Nunns garethnunns

View GitHub Profile
@garethnunns
garethnunns / youtube-hq.sh
Created March 11, 2023 22:38
Download YouTube videos at high quality
#!/bin/bash
# check yt-dlp is installed (and if not install it via Homebrew)
which -s yt-dlp
if [[ $? != 0 ]] ; then
# check Homebrew is installed (and if not install it)
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
@garethnunns
garethnunns / Useful-Mac-Commands.sh
Created January 12, 2021 00:08
Useful Mac Commands
# disable sleep when lid closed
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep when lid closed
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0
# prevent Photos opening when SD inserted
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES
# speed up Time Machine backups
@garethnunns
garethnunns / WiFiLog.py
Created July 1, 2018 22:37
Logs to CSV the RSS value perceived by the Raspberry Pi of devices connected to its WiFi AP
"""
File: WiFiLog.py
Author: garethnunns.com
Logs to CSV the RSS value perceived by the Raspberry Pi of devices connected to its WiFi AP
"""
import subprocess, csv, time, threading