Skip to content

Instantly share code, notes, and snippets.

@dardo82
dardo82 / wifi-passwd.sh
Last active January 9, 2019 14:30
Find Wi-Fi password
#!/bin/sh
airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
security find-generic-password -w -a $($airport -I | awk '/ SSID: /{print $2}')
@jakebathman
jakebathman / is_backblaze_uploading.sh
Created February 15, 2018 20:25
Determine if Backblaze is currently backing up files on macOS
#!/bin/sh
# This will look at the overviewstatus.xml file and
# determine if Backblaze is currently transmitting a file.
#
# Developed against:
# macOS 10.13.3
# Backblaze 5.2.0.172
BBSTATUS='/Library/Backblaze.bzpkg/bzdata/overviewstatus.xml'
@codycodes
codycodes / toggle_menu_bar_macos.scpt
Last active January 9, 2019 11:41
-- Toggle "Automatically hide and show the menu bar option using UI" -- Useful for when you want to maximize your screen real estate :) -- Please comment if you have any suggestions for improvements!
-- Toggle "Automatically hide and show the menu bar option using UI"
-- Useful for when you want to maximize your screen real estate :)
-- Please comment if you have any suggestions for improvements!
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.General"
tell application "System Events"
delay 1
tell process "System Preferences"
@codycodes
codycodes / get_stored_airport_wifi_passwords.js
Last active November 24, 2020 11:54
Two commands to get your current WiFi password or any WiFi password stored in your macOS keychain!
#!/bin/bash
get_current_wifi_password() {
# this command from http://bit.ly/2zWtUhQ
current_wifi=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | \
awk '/ SSID/ {print substr($0, index($0, $2))}'`
security find-generic-password -a "$current_wifi" -g | tail -0
}
get_wifi_password() {
@codycodes
codycodes / change_raspberry_pi_hostname.sh
Last active January 9, 2019 11:42
Changes the hostname on your raspberry pi to what's set in $hostname (variable); can be passed in as a parameter or hard-coded into the script
#!/bin/bash
# see LICENSE file on this gist at gist.github.com/codycodes
# Requires root permissions. An easy way to run this script is to simply use "sudo bash change_raspberry_pi_hostname.sh"
# Changes the hostname on your raspberry pi to what's set in $hostname (variable)
# Can be passed in as a parameter by calling this script or set explicitly in this file
# Makes a backup of the hosts file (/etc/hosts.bak)
@ayyybe
ayyybe / ccdl.command
Last active March 26, 2025 20:41
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear