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 | |
# Get all local users and calculate the size of the homedirectory | |
import os, pwd, plistlib | |
system_accounts = ['root', 'daemon', 'nobody', 'Guest'] | |
account_list = [] | |
def get_size(start_path): | |
total_size = 0 |
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/sh | |
# Script that creates two installer packages with the same destination app | |
# but different CFBundleIdentifiers. | |
# These trigger in macOS installer the creation of a .localized version | |
mkdir -p /tmp/test/Applications/Test.app/Contents | |
/usr/libexec/plistbuddy -c "Add :CFBundleIdentifier string macadmins.test.1" /tmp/test/Applications/Test.app/Contents/Info.plist | |
pkgbuild --root /tmp/test /tmp/test.1.pkg | |
/usr/libexec/plistbuddy -c "Set :CFBundleIdentifier string macadmins.test.2" /tmp/test/Applications/Test.app/Contents/Info.plist |
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 | |
# encoding: utf-8 | |
''' Downloads iBooks from Stack storage | |
Complexity is a result from the CSRF token that is needed for the download. | |
''' | |
import urllib, urllib2, json, re, cookielib, os, xattr | |
from Cocoa import NSWorkspace, NSImage | |
PAGE_URL = 'https://username.stackstorage.com/s/6hjYxxxxKnp6x' |
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/sh | |
# This ugly script sets the proper passphrase per department | |
# it retrieves the department via the JAMF API | |
API_URL=https://YOURJAMFSERVER:8443/JSSResource | |
API_USER=api_user | |
API_PASS=$4 | |
# Get serial number | |
myserial=$(system_profiler SPHardwareDataType | awk '/Serial Number/{print $4}') |
OlderNewer