Skip to content

Instantly share code, notes, and snippets.

@danielgross
Last active November 16, 2019 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgross/4f253f85e6c209e2ece0a604806eee13 to your computer and use it in GitHub Desktop.
Save danielgross/4f253f85e6c209e2ece0a604806eee13 to your computer and use it in GitHub Desktop.
OS X WiFi Shortcuts
# Add this to your bash_profile.
# Type `wifi` to list all WiFi networks.
# Type `wifi` "SSID_NAME" "PASSWORD" to connect to one.
# To tether:
# 1. Update tether() with your iPhone SSID and hotspot password.
# 2. Open Control Center.
# 3. Long-press (force touch) Bluetooth.
# 4. Turn OFF Wifi and turn ON "Personal Hotspot". It should read "Discoverable".
# 5. Don't leave that screen or state.
# 6. Type `tether` to pair with your iOS device.
function wifi() {
if [ -z "$1" ]
then
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
else
networksetup -setairportnetwork en0 "$@"
fi
}
function tether() {
wifi YOUR_IPHONE_SSID IPHONE_PASSWORD
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment