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 | |
from M2Crypto import X509, BIO, m2 | |
import os | |
from ctypes import CDLL | |
from ctypes import * | |
from ctypes.util import find_library | |
class PKCS7_SIGNED(Structure): |
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 grp, pwd, os | |
from ctypes import * | |
from ctypes.util import find_library | |
libc = cdll.LoadLibrary(find_library('libc')) | |
# getgrouplist_2() is an undocumented API which, I beleive, retrives all of | |
# a user's groups instead of the maximum 16 groups which getgrouplist() gets |
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 | |
class DmgMounter(object): | |
"""Base class for Processors that need to mount disk images.""" | |
DMG_EXTENSIONS = ['.dmg', '.iso', '.DMG', '.ISO'] | |
#pylint: disable=invalid-name | |
def parsePathForDMG(self, pathname): | |
"""Helper method for working with paths that reference something |
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 | |
''' | |
Takes a list of file names/paths on stdin and checks to see if they have | |
unresolvable ACE entries in their ACLs. E.g. ACEs which have a non-resolvable | |
UUID on the system. | |
Usage: | |
find /some/file/path | /path/to/findbadacls.py | |
''' |
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 sys | |
import plistlib | |
pl = plistlib.readPlist(sys.argv[1]) | |
structs = [] | |
def struct_from_dict(name, vals): | |
global structs |
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
#!/bin/sh | |
BOARD_ID=`ioreg -p IODeviceTree -r -n / -d 1 | grep board-id | awk '{print $3}' | sed -n 's/\<\"\(Mac-[0-9A-Z]*\)\"\>/\1/p'` | |
grep $BOARD_ID > /dev/null << EOF | |
Mac-031B6874CF7F642A | |
Mac-F2268DC8 | |
Mac-50619A408DB004DA | |
Mac-F2218EA9 | |
Mac-F42D86A9 |
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 | |
"""Print files that have a specific length ACL text presentation | |
Used to debug a backup tool that may have been having problems with files | |
with this precise ACL representation. | |
Created by Jesse Peterson on 2/2/16 | |
""" |
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
# example: | |
# | |
# github_dlextract { "mxcl/homebrew", | |
# path => "/my/path/directory", | |
# rev => "b8c7e203d1", # optional | |
# } | |
define github_dlextract ($repo = $title, $path, $rev = 'master') { | |
file { $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
import sys | |
for i in sys.argv[1:]: | |
if i.lower().endswith('emlx'): | |
print 'Processing:', i | |
else: | |
print 'Unknown file:', i | |
sys.exit(1) | |
emlx = open(i, 'r') |
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
require 'puppet/provider/parsedfile' | |
newsyslog = '/etc/newsyslog.conf' | |
Puppet::Type.type(:newsyslog).provide( | |
:parsed, | |
:parent => Puppet::Provider::ParsedFile, | |
:default_target => newsyslog, | |
:filetype => :flat) do |