Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From @Elios on macadmins#python
#!/usr/bin/python
import os
import pwd
from Foundation import CFPreferencesAppSynchronize
from Foundation import CFPreferencesSetValue
from Foundation import kCFPreferencesCurrentUser
from Foundation import kCFPreferencesCurrentHost
uid = pwd.getpwnam('_locationd').pw_uid
os.setuid(uid)
CFPreferencesSetValue('LocationServicesEnabled', True, 'com.apple.locationd',
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment