Skip to content

Instantly share code, notes, and snippets.

View rosston's full-sized avatar

Ross Brandes rosston

View GitHub Profile
@rosston
rosston / ios-update-watcher.py
Last active May 23, 2020 03:21
A script for watching and reporting progress of iOS update file downloads
#
# A script for watching and reporting progress of iOS update file downloads.
#
# Supported platforms: macOS
#
# Once your update begins downloading, run
# * on macOS:
# python3 /path/to/ios-update-watcher.py
#
import collections
@rosston
rosston / unwatch-github-repos.js
Last active October 20, 2021 17:59
A quick and dirty bit of JS to run in the console to quickly unwatch repos in GitHub one page at a time
// WARNING: this script is very brittle and may not do what you intend.
//
//
// To run:
// 1. On github.com/watching, copy/paste the function into the console
// 2. Call the function, passing a function to filter repos to unwatch, e.g.,
// unfollowMatches((repoName) => repoName.startsWith('rosston'))
// 3. Check the output of the function to make sure it looks right
// 4. Run the function again with `true` at the end to really for real make the changes, e.g.,
// unfollowMatches((repoName) => repoName.startsWith('rosston'), true)
@rosston
rosston / delete_old_tm_backups
Last active February 3, 2023 17:03
A script to delete Time Machine backups that match a regex
#!/usr/bin/env ruby
# Usage:
# sudo delete_old_tm_backups <path to backup volume> <regex>
#
# Example:
# sudo delete_old_tm_backups /Volumes/backup ^2019
backup_volume = ARGV.shift
delete_regex = Regexp.new(ARGV.shift)
@rosston
rosston / check-internet.sh
Last active October 28, 2021 23:52
A script to check which of your network interfaces is up
#!/bin/bash
# Built only to support macOS, almost certainly doesn't work on Linux
lan_mac='<your LAN MAC address>'
wifi_mac='<your Wi-Fi MAC address>'
test_url='<some test URL, which should fully support both IPv4 and IPv6>'
interfaces=$(ifconfig | grep -E '^[A-z0-9]+: ' | sed 's/: .*$//g')