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/python3 | |
''' | |
Display CPU usage for a given process | |
emoji ref: https://github.com/sheagcraig/Spruce/blob/master/spruce.py | |
''' | |
import subprocess | |
import time | |
import argparse |
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 | |
### | |
# Clean up infected HandBrake (1.0.7) for macOS | |
# Note that this script is WIP and does not remove all the traces of the malware | |
# e.g. reverting /etc/sudoers back to previous state is left out here | |
# Based on the information posted here: |
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
# Only tested on OSX 10.11.5 | |
import objc | |
from Foundation import NSBundle | |
Metadata_bundle = NSBundle.bundleWithIdentifier_('com.apple.Metadata') | |
functions = [ | |
('_MDCopyExclusionList', b'@'), | |
('_MDSetExclusion', b'@@I'), | |
] |
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
<!-- This can be added to a Munki pkginfo so as to deselect the MAU component | |
from being installed. However, some version of MAU would be probably | |
already installed if Office 2011 had ever been installed on this system. --> | |
<key>installer_choices_xml</key> | |
<array> | |
<dict> | |
<key>attributeSetting</key> | |
<integer>0</integer> | |
<key>choiceAttribute</key> | |
<string>selected</string> |
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
1. Pick a port and hack up your /etc/services file | |
Change existing port entry from | |
mbus 47000/udp # Message Bus | |
mbus 47000/tcp # Message Bus | |
to.. | |
ssh-47000 47000/udp # Alternate port SSH Remote Login Protocol | |
ssh-47000 47000/tcp # Alternate port SSH Remote Login Protocol |
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/env python | |
# encoding: utf-8 | |
# | |
# Copyright 2014 - The Regents of the University of Michigan. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.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
#!/usr/bin/python | |
import os | |
import subprocess | |
import urllib | |
import urllib2 | |
import tempfile | |
import json | |
import shutil | |
from time import localtime |
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 | |
# As written, this requires the following: | |
# - OS X 10.6+ (may not work in 10.10, haven't tested) | |
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6) | |
# - pyObjC (as such, recommended to be used with native OS X python install) | |
# Only tested and confirmed to work against 10.9.5 | |
# Run with root |
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
def default_interface(): | |
# 203.0.113.1 is reserved in TEST-NET-3 per RFC5737 | |
# Should never be local, essentially equal to "internet" | |
# This should get the 'default' interface | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
try: | |
# Uses UDP for instant 'connect' and port 9 for discard | |
# protocol: http://en.wikipedia.org/wiki/Discard_Protocol | |
s.connect(('203.0.113.1', 9)) | |
client = s.getsockname()[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/bash | |
### | |
# | |
# Name: shard.sh | |
# Description: This Casper extension attribute takes a Mac serial | |
# number as input and uses that serial number to output a | |
# number from 0 to 9. This can be useful in scoping Casper | |
# policies to a specific percentage of the fleet. | |
# Author: Elliot Jordan <[email protected]> |
NewerOlder