Skip to content

Instantly share code, notes, and snippets.

groob /
Last active Mar 11, 2017
quick CA server

create a CA and generate keys

# pull container for
docker pull groob/certified:latest
# create CA and intermediary CA; will prompty you for a password
docker run --rm -it --name certified -v $(pwd)/certs:/certified/etc -e GIT_USER=groob -e groob/certified certified-ca C="US" ST="NY" L="New York" O="Example" CN="groob-ca"
# create server cert
docker run --rm -it --name certified -v $(pwd)/certs:/certified/etc -e GIT_USER=groob -e groob/certified certified CN=""
# create cert chain as server.crt
cat certs/ssl/certs/ certs/ssl/certs/ca.crt certs/ssl/certs/root-ca.crt > server.crt
grahampugh / mail_profile.mobileconfig
Last active Nov 25, 2017
E-Mail IMAP configuration profile and outset script. Takes the long user name of the logged in user to populate the email field. User must supply only the password.
View mail_profile.mobileconfig
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
<plist version="1.0">
<false />
pudquick /
Last active Dec 8, 2018
Accessing battery details via python and pyobjc on macOS / OS X
import objc
from Foundation import NSBundle
IOKit = NSBundle.bundleWithIdentifier_('')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperties", b"IIo^@@I"),
("IOPSCopyPowerSourcesByType", b"@I"),
("IOPSCopyPowerSourcesInfo", b"@"),
View pem.go
package main
import (
WardsParadox / chrome.mobileconfig
Created Apr 9, 2018
Newer style chromeconfig example for multi domain pattern sign-in whitelist
View chrome.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
juancarlospaco /
Last active May 17, 2019
Add Colors to Logging Python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import logging as log
from copy import copy
if not sys.platform.startswith("win") and sys.stderr.isatty():
scriptingosx /
Created Mar 28, 2019
This script will print the build numbers of the macOS version from all installer apps
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
installerBuildVersion() { # $1 path to the installer app
installerApp=${1:?"no path for installer"}
# echo "inspecting: $installerApp"
if [[ -d "$installerApp" ]]; then
identifier=$(/usr/libexec/PlistBuddy -c "print CFBundleIdentifier" "$installerApp/Contents/Info.plist")
pudquick /
Last active Feb 11, 2020
Forcing automatic timezone discovery with pyobjc on OS X
# Tested on 10.11
# Assumes your network is in a state to actually do the discovery and that you have
# automatic timezone discovery enabled in Date & Time and Location services enabled
# (Generally this means wifi enabled on your device and network stack is up)
# For enabling location services and auto, check Allister's work here:
from Foundation import NSBundle
TZPP = NSBundle.bundleWithPath_("/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZone.prefPane")
n8henrie /
Last active Mar 29, 2020 — forked from nhoffman/
Python script template
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
A simple python script template.
import argparse
soundsnw /
Created Jun 11, 2019
Give macOS standard users access to networking, printing and more
# Provides standard user access to preference panels they would expect to be able to access, and might need access to.
# Provides standard users access to system preferences
/usr/bin/security authorizationdb write system.preferences allow
You can’t perform that action at this time.