Tag: python

  • Comparison macOS versions using Python

    At some point in a Python script, you may want to compare macOS versions (or, really, any software versions) to each other. Back in the day, you could use Python’s LooseVersion from distutils.version, but that’s now deprecated: >>> from distutils.version import LooseVersion >>> LooseVersion(‘14.0.0’) > LooseVersion(‘14.0’) True >>> LooseVersion(‘14.0.0’) == LooseVersion(‘14.0’) False >>> LooseVersion(‘14.0’) >…

  • “looks like a filename, but the file does not exist” error when deploying a Cloud Function

    Caveat This fits in the category of “What it ended up being for me, and it may help someone else” and not “I’m an expert on all gcloud errors, and this is always the solution,” so please resist the urge to comment with “This didn’t solve it for me. What’s the solution to my problem?”…

  • How to check the Carbon Black version installed

    Update Thanks to Clay Haynes for pointing out you can get the version more easily by running /Applications/VMware\ Carbon\ Black\ EDR.app/Contents/MacOS/CbOsxSensorService -v Back story In Carbon Black 6.3.0 and 7.0.1, it isn’t super obvious how to check for the version installed. For example, if you run defaults read /Applications/VMware\ Carbon\ Black\ EDR.app/Contents/Info.plist, you’ll see CFBundleInfoDictionaryVersion…

  • Updates to the AutoPkgReviewAndRun.py script

    3.5 years ago, I created a script to automate running AutoPkg recipes while also verifying trust info and prompting the user to approve or deny any changes. With some prompting from some folks on the #autopkg channel of the MacAdmins Slack, I made a few changes to the script: You can now run the script…

  • Python script to list software available in a Munki repo

    I created a small project (for fun) to list out software available in a Munki repo. It’s called MunkiItemsList. On a basic level, it looks for all the items that are listed in any optional installs manifest, and then lists out the display name, description, and highest version available. There are some additional options described…

  • Script to make Jamf Self Service policy install a Munki optional install

    There is a huge project called jamJAR that seeks to integrate Munki and Jamf in a seamless way. I’ve written a script that does something a bit less ambitious, but it may still be helpful to your organization if you are “using” Jamf Self-Service, really want to be using Managed Software Center, and still want…

  • Using a Munki nopkg to disable Chrome 80’s ScrollToTextFragment feature

    Update, 14 July 2020 With Chrome 84, Google has now removed the ability to disable the ScrollToTextFragment feature, so this whole write-up is now obsolete What is ScrollToTextFragment With Chrome 80, Google has introduced a new ScrollToTextFragment feature that allows you to reference an anchor link by any phrase that’s in a webpage, even if…