Skip to content

Instantly share code, notes, and snippets.

View soundsnw's full-sized avatar

soundsnw

View GitHub Profile
#!/bin/bash
# Set time zone and enable network time server
sudo /usr/sbin/systemsetup -setusingnetworktime off
sudo /usr/sbin/systemsetup -settimezone "Europe/London"
sudo /usr/sbin/systemsetup -setnetworktimeserver time.euro.apple.com
#!/bin/bash
# Enable location services and automatic time zone configuration
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -int 1
uuid=$(/usr/sbin/system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -c22-57)
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.$uuid LocationServicesEnabled -int 1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>allowDiagnosticSubmission</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>forceLimitAdTracking</key>
<true/>
<key>AD_DEVICE_IDFA</key>
<string>00000000-0000-0000-0000-000000000000</string>
</dict>
</plist>
@soundsnw
soundsnw / approve-mau-daemon.sh
Created July 18, 2019 21:08
approve-mau-daemon.sh
#!/bin/bash
# Pre-approve the popup that asks the user to approve running the MAU daemon
# Get the logged in user
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
# Register MAU
@soundsnw
soundsnw / Preload Chrome bookmarks on macOS
Last active June 10, 2019 22:01
preload-chrome-bookmarks.sh
#!/bin/bash
# Output Chrome Bookmarks to /Library/Google/bookmarks.html
if [ ! -d "/Library/Google" ]
then
mkdir "/Library/Google"
fi
(
#!/bin/bash
# macOS printer script: if color queue is selected, revert to grayscale
# Get logged in user
loggedInUser=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
# If the print queues have been deleted, re-add them