This file contains 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 | |
import os | |
import sys | |
from CoreFoundation import (CFPreferencesAppValueIsForced, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesAnyHost, |
This file contains 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
<# | |
Modified version of the script from Microsoft Documentation. | |
Removed the part that checks if the users is assigned more products than the group assigned license. | |
Added connection part and help to find Sku and Group Object ID. | |
This script requires Azure AD (aks MSOL) PowerShell v1. It doesn't seem possible to do so with v2. | |
Ref: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-licensing-ps-examples | |
#> | |
Import-Module MSOnline | |
$UserCredential = Get-Credential |
This file contains 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
parse_array() { | |
FS=':' | |
key=(); val=() | |
for (( i=0 ; i < $(eval echo \${#$1[@]}) ; i++ )); do | |
key+=( "$(eval echo \${$1[$i]} | awk -F${FS} '{print $1}')" ) | |
val+=( "$(eval echo \${$1[$i]} | awk -F${FS} '{print $2}')" ) | |
done | |
} | |
# Assuming script contains myarray=( "key1:value1" "key2:value2" ) | |
parse_array myarray |
This file contains 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
from Foundation import NSBundle | |
import objc | |
CoreServices = NSBundle.bundleWithIdentifier_('com.apple.CoreServices') | |
functions = [ | |
('_LSCopyRunningApplicationArray', '@I'), | |
('_LSCopyApplicationInformation', '@I@@'), | |
] | |
constants = [ |
This file contains 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 | |
# Completely uninstall Office 2016, as per: | |
# https://support.office.com/en-us/article/Uninstall-Office-2016-for-Mac-eefa1199-5b58-43af-8a3d-b73dc1a8cae3 | |
# and | |
# https://support.office.com/en-us/article/Troubleshoot-Office-2016-for-Mac-issues-by-completely-uninstalling-before-you-reinstall-ec3aa66e-6a76-451f-9d35-cba2e14e94c0?ui=en-US&rs=en-US&ad=US | |
import glob | |
import os |
This file contains 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
'''Routines for manipulating the Dock''' | |
import os | |
import subprocess | |
from Foundation import NSURL | |
from Foundation import CFPreferencesAppSynchronize | |
from Foundation import CFPreferencesCopyAppValue | |
from Foundation import CFPreferencesSetAppValue |
This file contains 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/env python3 | |
import os, os.path, json, hashlib, subprocess, argparse, sys, stat | |
BUFFER_SIZE = 65536 | |
def checksum_directory(source_path, progress=False): | |
filesystem_details = dict() | |
# rough guess of how many files are in a directory | |
# horrible hack with a little fudge | |
if not os.path.isdir(source_path): |
This file contains 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 | |
## Script: get_chrome_extensions.py | |
## Author: Christopher Collins (christophercollins@livenation.com) | |
# also, owen wuz here. minor corrections (utf-8) | |
########################################### | |
##Description: This script searches the last logged in user's installed extensions and submits it to Casper during an inventory report. | |
########################################### | |
import os |
This file contains 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
import os.path | |
from Foundation import NSData, NSKeyedUnarchiver, SFLListItem, NSURL, NSMutableDictionary, NSKeyedArchiver, NSString, NSDictionary, NSArray | |
def load_favservers(sfl_path): | |
if os.path.isfile(sfl_path): | |
# File exists, use it | |
sfl_decoded = NSKeyedUnarchiver.unarchiveObjectWithData_(NSData.dataWithContentsOfFile_(sfl_path)) | |
else: | |
# File doesn't exist, make a blank template | |
sfl_decoded = {u'items': [], |
This file contains 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 | |
import os.path, subprocess, datetime, dateutil.parser, time, sys | |
def apple_year_offset(dateobj, years=0): | |
# Convert to a maleable format | |
mod_time = dateobj.timetuple() | |
# Offset year by number of years | |
mod_time = time.struct_time(tuple([mod_time[0]+years]) + mod_time[1:]) | |
# Convert back to a datetime obj | |
return datetime.datetime.fromtimestamp(int(time.mktime(mod_time))) |