This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Universal enforce wallpaper script for 10.9 and up | |
# Based on https://gist.github.com/gregneagle/6957826#file-gistfile1-py | |
from AppKit import NSWorkspace, NSScreen | |
from Foundation import NSURL | |
from platform import mac_ver | |
from subprocess import call | |
from os import system | |
from os import getlogin | |
import sqlite3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#----------VARIABLES--------- | |
undesiredNetwork="SSID-To-Remove" | |
wifiOrAirport=$(/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(Wi-Fi|AirPort)') | |
echo $wifiOrAirport | |
wirelessDevice=$(networksetup -listallhardwareports | awk "/$wifiOrAirport/,/Device/" | awk 'NR==2' | cut -d " " -f 2) | |
echo $wirelessDevice | |
#-----------SCRIPT----------- | |
# Remove the SSID from the list of preferred networks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
volumeName=$(diskutil info / | awk '/Volume Name/ {print substr ($0, index ($0,$3))}') | |
echo "Current volume name: $volumeName" | |
# If the volume is not named Macintosh HD | |
if [ "$volumeName" != "Macintosh HD" ];then | |
# Rename it | |
diskutil renameVolume "$volumeName" "Macintosh HD" | |
volumeName=$(diskutil info / | awk '/Volume Name/ {print substr ($0, index ($0,$3))}') | |
echo "Root volume is now named: $volumeName" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#----------AUTHOR------------ | |
# Jacob Salmela | |
# 3 January 2014 | |
#-----------IMPORTS---------- | |
from subprocess import call | |
from platform import mac_ver | |
from re import findall | |
from socket import gethostname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#----------AUTHOR------------ | |
# Jacob Salmela | |
# 20 February 2014 | |
# Updated: 2014-12-11 | |
#-----------IMPORTS---------- | |
from os import system | |
from subprocess import call | |
from socket import gethostname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osascript -e 'tell application "system events" to delete login items' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bud='/usr/libexec/Plistbuddy' | |
plist=$HOME'/Library/Preferences/com.apple.sidebarlists.plist' | |
servers=('afp://servername' | |
'smb://servername' | |
'vnc://servername' | |
'ftp://servername') | |
killall cfprefsd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#----------AUTHOR------------ | |
# Jacob Salmela | |
# 02 March 2015 | |
#-----------IMPORTS---------- | |
from os import system | |
from subprocess import call | |
from socket import gethostname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apiKey="abcD12345efGhIJkLmn-abcD12345efGhIJkLmn_cO_8" | |
filename=$(basename "$1") | |
filename="${filename%.*}" | |
directoryname=$(dirname "$1") | |
latitude=$(mdls "$1" | awk '/Latitude/ {print $3}') | |
longitude=$(mdls "$1" | awk '/Longitude/ {print $3}') | |
data=$(curl -s https://maps.googleapis.com/maps/api/geocode/json?latlng="$latitude","$longitude"&key="$apiKey") | |
city=$(echo "$data" | grep "formatted_address" | head -1 | cut -d',' -f2 | sed -e 's/^[ \t]*//') | |
case "$city" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Foundation import NSKeyedUnarchiver | |
from struct import unpack | |
# This entire function is black magic of the highest order and I'll blog about it later | |
def extract_share(bookmark_data): | |
content_offset, = unpack('I', bookmark_data[12:16]) | |
first_TOC, = unpack('I', bookmark_data[content_offset:content_offset+4]) | |
first_TOC += content_offset | |
TOC_len, rec_type, level, next_TOC, record_count = unpack('IIIII', bookmark_data[first_TOC:first_TOC+20]) | |
TOC_cursor = first_TOC + 20 |