Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
sudo time
ps auxw | grep OpenDNS | awk '{print $2}' | xargs sudo kill -9
sudo rm "/Library/Application Support/OpenDNS Roaming Client/dns-updater"
sudo touch "/Library/Application Support/OpenDNS Roaming Client/dns-updater"
sudo rm "/Library/Application Support/OpenDNS Roaming Client/dnscrypt-proxy"
sudo touch "/Library/Application Support/OpenDNS Roaming Client/dnscrypt-proxy"
@magoon
magoon / gist:1232c85afff19d7a14668178098f249a
Created October 20, 2017 17:51
What's listening on port 80? Mac
sudo lsof -i TCP:80 | head -2 | tail -1 | awk '{print $2}' | xargs -I {} sh -c 'sudo ps auxw | grep {}' | grep -v grep
#!/bin/sh
# <bitbar.title>Amazon SQS Message listing</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Andy Magoon</bitbar.author>
# <bitbar.author.github>magoon</bitbar.author.github>
# <bitbar.desc>Shows queue statistics from Amazon SQS.</bitbar.desc>
# <bitbar.dependencies>awscli,jq</bitbar.dependencies>
# Dependencies:
# awscli (https://aws.amazon.com/cli/)
pmset -g
Active Profiles:
Battery Power -1
AC Power -1*
Currently in use:
standbydelay 10800
standby 0
womp 0
halfdim 1
hibernatefile /var/vm/sleepimage
@magoon
magoon / .bash_profile
Created November 19, 2014 20:58
Fifth element your shell
alias multipass='say -v Cellos corbin dallas multipass multipass multipass Corbin dallas multipass big ba da ba da boom'
@magoon
magoon / gist:aa555ce2988551ab0a90
Created September 23, 2014 11:26
Remove Adobe Updater from Mac
sudo killall "AAM Updates Notified" ; sudo rm -rf "/Applications/Utilities/Adobe Application Manager/UWA/AAM Updates Notifier.app/"
@magoon
magoon / .bash_profile
Created August 6, 2014 14:14
Open informational website for a particualr brew package
# brewman: think "brew manpage"
#
# usage: brewman [package]
# example: brewman transcrypt
#
# have you ever done a 'brew update' and wondered about all of those fancy new packages?
function brewman() {
brew info $1 | sed -n 2p | xargs open
}
@magoon
magoon / Patch-ize Bitbucket PR
Created July 28, 2014 23:53
Bookmarklet to turn a Bitbucket pull request into a git patch. Simply create a new bookmark and paste this in as the address, then click it when viewing a Bitbucket PR. This allows you to test anybody's PR on your local environment without merging. To apply a patch, copy the entire patch into your clipboard and, on a Mac, run this from console: …
javascript:(function()%7Bwindow.location.href%3D%22https%3A%2F%2Fbitbucket.org%2Fapi%2F2.0%2Frepositories%2F%22%2BJSON.parse(%24(%22%5Bdata-current-repo%5D%22).attr(%22data-current-repo%22)).fullslug%2B%22%2Fpullrequests%2F%22%2BJSON.parse(%24(%22%5Bdata-current-pr%5D%22).attr(%22data-current-pr%22)).localId%2B%22%2Fpatch%22%3B%7D)();
@magoon
magoon / gist:04ad4d37faac9b24ac68
Last active March 17, 2017 20:57
Second hipchat
# To have a second HipChat on Mac OS X
# Run this in your terminal:
cp -a /Applications/HipChat.app/ /Applications/HipChat2.app ; sed -i -e 's/HipChat\</HipChat2</' /Applications/HipChat2.app/Contents/Info.plist ; open /Applications/HipChat2.app ; open /Applications/Utilities/Keychain\ Access.app/
# Sign in, then search for "Hockey" in the KeyChain app that I opened for you. Open each
# found entry, click its Access Control tab, and choose "Allow all applications.." & Save
@magoon
magoon / gist:39c9d2899ea53702b623
Created June 16, 2014 21:38
Simple encrypt/decrypt
#
# Add the following to your .bash_profile
#
# Example: If you run "enc secretfile secretfile.encrypted"
# it'll ask you for a password. Then you, or a friend, can
# reverse it with "dec secretfile.encrypted secretfile"
#
# -andymagoon@gmail.com 2014-06-16
alias enc=encryptfunc