Skip to content

Instantly share code, notes, and snippets.

Avatar

Joss Brown JayBrown

View GitHub Profile
@JayBrown
JayBrown / imgur-au
Last active Mar 2, 2021
imgurAU – imgur anonymous uploader for online images (shell script to use in Firefox using the OpenWith browser extension)
View imgur-au
#!/bin/zsh
# shellcheck shell=bash
# imgur-au
# v0.4
# imgur anonymous uploader
export LANG=en_US.UTF-8
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:$HOME/.local/bin:$HOME/bin:$HOME/local/bin
@JayBrown
JayBrown / reconnect
Last active Mar 1, 2021
Fritz!Reconnect (macOS) – tell Fritz!Box to reconnect to WAN to get a new public IP address (tested on model 7490)
View reconnect
#!/bin/zsh
# shellcheck shell=bash
# reconnect v0.2
# macOS / Fritz!Box (tested on model 7490)
export LANG=en_US.UTF-8
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
###
View wifi-auto-switch.zsh
#!/bin/zsh
# shellcheck shell=bash
# wifi-auto-switch.zsh for macOS
# v0.2
emulate -LR bash
export LANG=en_US.UTF-8
# switch WiFi network function
@JayBrown
JayBrown / ckimg
Last active Apr 16, 2021
macOS: check if a disk image is APFS-formatted
View ckimg
#!/bin/bash
# ckimg v0.5
for filepath in "$@"
do
shortpath="${filepath/#$HOME/~}"
filename=$(basename "$filepath")
echo "Accessing: $shortpath"
extension="${filename##*.}"
@JayBrown
JayBrown / rm-dsstore
Last active Feb 14, 2021
quick script to run a .DS_Store deletion process on volumes
View rm-dsstore
#!/bin/zsh
# shellcheck shell=bash
# rm-dsstore v0.2
# macOS Catalina and later only!
if [[ $(id -u) != 0 ]] ; then
echo "Please run as root user!" >&2
exit
fi
@JayBrown
JayBrown / ejecta
Last active Feb 14, 2021
Ejecta: correctly eject APFS-formatted DMGs (raw version)
View ejecta
#!/bin/zsh
# shellcheck shell=bash
# ejecta v0.11
# https://gist.github.com/JayBrown/da7da1ef88cdce264fb47495a0fd34c4
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
_beep () {
osascript -e 'beep' -e 'delay 0.5' &>/dev/null
@JayBrown
JayBrown / 14.pip
Created Nov 28, 2016
mapbox CLI: update error v0.4.0 > v0.5.1 via homebrew (OS X 10.11.6)
View 14.pip
2016-11-27 17:57:39 +0100
/usr/local/Cellar/mapbox/0.5.1/libexec/bin/pip
install
-v
--no-deps
--no-binary
:all:
--ignore-installed
/private/tmp/mapbox--polyline-20161127-75577-1ha0sdu/polyline-1.3.1