Skip to content

Instantly share code, notes, and snippets.

@pajp
pajp / getimg.py
Created February 27, 2011 22:00 — forked from stchris/getimg.py
Gets the current image of the day from NASA and sets it as the background. The summary / description text is written to the image.
#!/usr/bin/env python
"""
getimg.py
Gets the current image of the day from NASA and sets it as the
background. The summary / description text is written
to the image.
Requires:
PIL (apt-get install python-imaging or pip install PIL)
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@eins78
eins78 / hack.sh
Created March 31, 2012 11:57 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
from ctypes import CDLL, Structure, POINTER, c_char_p, c_size_t, c_void_p, c_uint32, pointer, byref
Security = CDLL('/System/Library/Frameworks/Security.framework/Versions/Current/Security')
class OpaqueType(Structure):
pass
OpaqueTypeRef = POINTER(OpaqueType)
AuthorizationRef = OpaqueTypeRef
@jessepeterson
jessepeterson / app_map.c
Last active October 23, 2023 07:32
_CFPreferencesCopyApplicationMap example
/* re-implementation of the behaviour that the /usr/bin/defaults application
* uses to read sandboxed preference data */
#include <CoreFoundation/CoreFoundation.h>
#define EX_BUNDLE_ID "com.apple.mail"
#define EX_KEY "JunkMailBehavior"
// undocumented, internal CFPreferences API call
extern CFDictionaryRef _CFPreferencesCopyApplicationMap(CFStringRef userName, CFStringRef hostName);
@pudquick
pudquick / uninstalld.md
Last active August 26, 2024 14:58
com.apple.uninstalld.uninstall in detail - how to read the authorization.plist / auth.db

A study of the 'com.apple.uninstalld.uninstall' right

From /System/Library/Security/authorization.plist:

<key>com.apple.uninstalld.uninstall</key>
<dict>
    <key>class</key>
    <string>rule</string>