Skip to content

Instantly share code, notes, and snippets.

View lazymutt's full-sized avatar

Todd McDaniel lazymutt

View GitHub Profile
@lazymutt
lazymutt / ipconfig_to_dict.py
Created April 17, 2019 21:13
Converts the output of an "ipconfig /all" command to a nested dictionary.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ipconfig_to_dict.py *****************
#
# converts the output of an "ipconfig /all" command
# to a nested dictionary.
#
# *************************************
#!/usr/bin/python
from __future__ import print_function
import os
import sys
import struct
import macholib
from macholib import MachO
input_path = sys.argv[1]
@lazymutt
lazymutt / flake8.scpt
Last active April 7, 2022 18:28
Runs flake8 against the current window/tab in BBEdit, displays results in new window. Shortens file paths in output.
-- Copyright (c) 2017 University of Utah Student Computing Labs.
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and
-- its documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation, and that the name of The University
-- of Utah not be used in advertising or publicity pertaining to
-- distribution of the software without specific, written prior
@lazymutt
lazymutt / pylint.scpt
Last active February 27, 2023 17:17
Runs pylint against the current window/tab in BBEdit, displays results in new window. Now allows longer maximum line length!
-- Copyright (c) 2017 University of Utah Student Computing Labs.
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and
-- its documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation, and that the name of The University
-- of Utah not be used in advertising or publicity pertaining to
-- distribution of the software without specific, written prior
#!/usr/local/bin/python3
# Copyright (c) 2019 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University
@lazymutt
lazymutt / SUS_update_finder.py
Last active April 11, 2017 18:35
I sometimes redistribute Apple Mac OS update packages to team members. Apple's Software Update Server doesn't make it easy to find where the packages are stored. This script will find the proper directory and open it in the Finder for you.
#!/usr/bin/python
"""
# Copyright (c) 2017 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University
@lazymutt
lazymutt / report_critical_update_versions.py
Last active May 3, 2023 08:01
parses update versions, some managed by `sudo softwareupdate --background-critical`, ported from an applescript found at https://www.jamf.com/jamf-nation/discussions/19111/xprotect-status-extension-attribute
#!/usr/bin/python
# Copyright (c) 2019 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University
@lazymutt
lazymutt / list_open_invitations_on_jss.py
Last active November 23, 2016 09:45
Queries and displays open invitation codes on your JSS
#!/usr/bin/python
# Copyright (c) 2015 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University
@lazymutt
lazymutt / census.py
Last active December 8, 2015 19:45
consumes the output of /usr/bin/last and parses out the the user with largest number of minutes logged into the console.
#!/usr/bin/python
# Copyright (c) 2015 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University
@lazymutt
lazymutt / removeDuplicateVPNProfiles.py
Last active September 23, 2015 23:03
Attempts to remove specific, duplicate profiles.
#!/usr/bin/env python
# Copyright (c) 2015 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University