Skip to content

Instantly share code, notes, and snippets.

@pudquick
pudquick / mas_updates.py
Last active January 25, 2024 15:47
Mac App Store updates
# App Store playing
import urllib, urllib2, json, plistlib
###
# Utility function for performing an iTunes-style search
def perform_itunes_search(api_url, query_list=[]):
query_str = urllib.urlencode(query_list)
response_handle = urllib2.urlopen('https://itunes.apple.com/%s?%s' % (api_url, query_str))
@pmbuko
pmbuko / quick_ad_pass_exp.sh
Created July 10, 2015 20:43
This script will return info on Active Directory password expiration for the currently active user when run on a Mac bound to an AD domain.
#!/bin/bash
# This section uses python to get the current console user. You can
# usually just use the built-in $USER variable, but this is more
# robust.
USER=$(/usr/bin/python -c \
'from SystemConfiguration import SCDynamicStoreCopyConsoleUser;\
print SCDynamicStoreCopyConsoleUser(None, None, None)[0]')
# This looks up the password expiration date from AD. It's stored
@rderewianko
rderewianko / CheckWarranty
Last active September 28, 2015 19:45
Checks warranty of a machine, and reports back to the user in a popup
#!/bin/sh
#File Name:CheckWarranty.sh
########################################################################
# Created By: Andrew Tomson Modified by Ross Derewianko for Self Service
# Creation Date: Sept 2015
# Last modified: Sept 28, 2015
# Brief Description: Lets the user Know its changed
########################################################################
# this script was written to query apple's service database to determine warranty coverage
# base on a system's serial number. This updated version stores the infomration locally so
@opragel
opragel / ea_microsoft_outlook2016_versioncheck.py
Last active November 8, 2016 03:16
ea_microsoft_outlook2016_versioncheck.py
#!/usr/bin/python
"""
This script checks whether the installed version of Microsoft Outlook 2016 is
equal, less, or more than the target version defined by APP_TARGET_VERSION
and reports the result in Casper Suite extension attribute style.
T = Local app version is equal to provided target version
N = Local app version is newer than provided target version
F = Local app version is less than provided target version
N/A = Local app plist was not found or accesible at specified path
"""
@trodemaster
trodemaster / PowerCli.txt
Last active October 20, 2016 02:02
Some install notes for macOS + .net core + powershell core + PowerCli core
#Install openssl via macports
sudo port install openssl curl
# create a dir in the path for library links
mkdir -p /usr/local/lib
# link tehse librarys ino the path. Not sure this is needed..
ln -s /opt/local/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /opt/local/lib/libssl.1.0.0.dylib /usr/local/lib/
@joshua-d-miller
joshua-d-miller / 802.1x System Fix.py
Last active February 4, 2022 14:42
This script will allow your 802.1x Configuration Profile to work on any other Ethernet interface at the System Level
#!/usr/bin/python
# pylint: disable=E0611, E1101, E0602
''''Fix 802.1x When Using Config Profiles and PEAP-MSCHAPV2 or EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will find the system profile that is attached to one ethernet
# interface from our configuration profile and then copy it to all other
# ethernet interfaces so that other ethernet interfaces can be used instead
# of just the FirstActiveEthernet at time of profile installation. This issue
# is still an issue as of 10.12.3
@ttscoff
ttscoff / appinfo.md
Last active September 2, 2024 18:53
appinfo: A quick ruby script for Mac that returns some information for a specified Mac app in Terminal. Includes icon display if using imgcat or chafa are available.

appinfo

A script for getting details of installed Mac apps. Like Get Info but faster and cooler.

Save the script below as appinfo somewhere in your path. Make it executable with chmod a+x appinfo. Then just run appinfo APPNAME to get info on any installed app.

@korylprince
korylprince / merge.py
Last active November 17, 2024 00:06
Modify 10.13 (SFL2) Server Favorites list
#!/usr/local/munki/munki-python
# change the above path to your own python if you don't have Munki installed
"""
Merges add_servers into current favorites and removes remove_servers.
Run as root to update all users or as normal user to update just that user.
"""
import os
import getpass
#!/usr/bin/python
import sys, datetime, time, subprocess
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)))
@smashism
smashism / unmanage-computers-modern-auth.sh
Last active June 3, 2024 15:44
Programmatically unmanage computers via Jamf Pro API using bearer-auth token authentication.
#!/bin/bash
##########
# title: unmanage-computers-modern-auth.sh
# author: dr. k | @smashism on github
# date: 2024-03-28
# note: include jssIDs where specified, other server/cred details will
# prompt when run via terminal.app
# disclaimer: provided as-is with no warranty (express or implied). please test!
#