Skip to content

Instantly share code, notes, and snippets.

View Jaharmi's full-sized avatar
👋
You had me at ‘Hello World’!

Jeremy Reichman Jaharmi

👋
You had me at ‘Hello World’!
  • Landenberg, PA
  • 22:33 (UTC -04:00)
View GitHub Profile
@bruienne
bruienne / getosversionfromdmg.py
Last active April 16, 2021 05:29
Get OS X version from DMG
#!/usr/bin/python
#
# getosversionfromdmg.py
#
# Copyright (c) 2014 The Regents of the University of Michigan
#
# Retrieves the OS version and build from the InstallESD.dmg contained in
# a typical "Install (Mac) OS X <Name>.app" bundle.
#
# To run:
@pudquick
pudquick / parse_pbzx.py
Last active September 27, 2021 04:34
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
# Example usage:
# parse_pbzx('PayloadJava', 'PayloadJava.cpio.xz')
# Updated for speeeeeeeeeeeeed
@pudquick
pudquick / bom.py
Last active November 18, 2021 15:55
Parsing of bom files in pure python
# Python routines for parsing bom files
#
# Examples so far:
#
# dump_bom(filename) - prints diagnostic structure information about bom file (including path list)
from ctypes import BigEndianStructure, c_char, c_uint8, c_uint16, c_uint32, sizeof, memmove, addressof
class BOMHeader(BigEndianStructure):
_pack_ = 1
from munkilib import gurl
def run_connection(options):
connection = gurl.Gurl.alloc().initWithOptions_(options)
percent_complete = -1
bytes_received = 0
connection.start()
try:
while not connection.isDone():
if connection.destination_path:
@poundbangbash
poundbangbash / gist:99ea1f6d837faf4b5cf9
Created May 22, 2015 03:35
ARD AD based authentication
#!/bin/bash
#This script adds local groups to allow for the ard_* group directory based groups to access the computer via ARD
# List of groups to create and edit
groupArray=(ard_interact ard_manage ard_admin)
# List of AD group UUIDs. Get the UUID from the group info in AD.
my_ARD_interact_UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
my_ARD_manage_UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
my_ARD_admin_UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
@poundbangbash
poundbangbash / gist:636c7098c7da21d6a8e5
Created May 22, 2015 03:37
Allow AD user to Remote Management
username=INSERTUSERNAMEHERE
# Check the username has been set
if [ $username = INSERTUSERNAMEHERE ]
then
echo You need to set the username
exit 1
fi
# Create the ARD Interact group which allows Control and Observe
@chilcote
chilcote / gist:4abf81a0be65a675e7c2
Created July 9, 2015 15:34
osquery vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "osx104"
config.vm.synced_folder "./data", "/vagrant_data"
config.vm.provision "shell", inline: <<-SHELL
curl -s -O "https://osquery-packages.s3.amazonaws.com/darwin/osquery-1.4.5.pkg"
installer -pkg osquery-1.4.5.pkg -target /
SHELL
@opragel
opragel / laziest_install_microsoft_office2016.sh
Last active June 25, 2024 22:33
laziest_install_microsoft_office2016.sh
#!/bin/bash
# witness the horror
# seriously don't do this
# last warning.. maybe
# Guess I'm putting a license in
# 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
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
@pudquick
pudquick / pyobjc_version.txt
Created August 2, 2015 16:17
PyObjC versions for OS X
pyobjc versions OS X
import objc
objc.__version__
10.6: 2.2b3
10.7: 2.3.2a0
10.8: 2.3.2a0
10.9: 2.3.2a0
10.10: 2.5.1
#!/usr/bin/python
import plistlib, os.path, os
# Based off of https://forums.developer.apple.com/message/6741
# and http://apple.stackexchange.com/a/136976
def jdk_info_plists():
# Find all the JDK Info.plist files
JDK_ROOT = "/Library/Java/JavaVirtualMachines"
if (os.path.exists(JDK_ROOT) and os.path.isdir(JDK_ROOT)):