Skip to content

Instantly share code, notes, and snippets.

View drkmullins's full-sized avatar

Derek Mullins drkmullins

View GitHub Profile
@drkmullins
drkmullins / autoWireless.sh
Last active December 16, 2015 19:00
Checks my macbook's Wi-Fi every 5 seconds. If it's down, it restarts the adapter. I use it when my Wi-Fi signal is flaky and my macbook is having issues staying connected.
#!/bin/bash
# Checks my mac's Wi-Fi every 5 seconds.
# If it's down, restart the adapter.
while :
do
if [ $(networksetup -getinfo Wi-Fi | grep -c 'IP address:') = '1' ]
then
$(networksetup -setairportpower en1 off)
NSNotificationCenter *center;
center = [NSNotificationCenter defaultCenter];
token = [center addObserverForName: nil
object: nil
queue: nil
usingBlock: ^(NSNotification *notification) {
QuietLog (@"NOTIFICATION %@ -> %@",
notification.name, notification.userInfo);
}];
@drkmullins
drkmullins / findJar
Created July 25, 2013 18:49
This will find a given class name's jar
find / -type f -name '*.jar' -exec grep -l '[ClassName].class' '{}' \;
@drkmullins
drkmullins / gitCleanup
Created March 13, 2017 17:02
Deletes local branches that no longer exist on the remote
git fetch -p && git branch -vv | gawk "/: gone]/{print $1}" | xargs git branch -d