Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
rockpapergoat / Makefile
Created September 28, 2012 19:53
vmware fusion 5 pkg makefile
#
# Package VMware Fusion.app
#
#
include /usr/local/share/luggage/luggage.make
TITLE=VMwareFusion
REVERSE_DOMAIN=com.vmware
PACKAGE_VERSION=5.0.1
@rockpapergoat
rockpapergoat / fix_ad_login_delay.sh
Created August 29, 2012 16:41
AD off-network login delay fix?
#!/bin/bash
# 8/23/12, nate
# attempt to reduce AD mobile account login delays while off network
# change DOMAIN to your AD domain/config file name
if [[ -e /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist ]]; then
/usr/libexec/PlistBuddy -c "Set options:query\ timeout 2" /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist
/usr/libexec/PlistBuddy -c "Set options:connection\ idle\ disconnect 5" /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist
/usr/libexec/PlistBuddy -c "Set options:connection\ setup\ timeout 5" /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist
fi
@rockpapergoat
rockpapergoat / get_cmd.rb
Created August 29, 2012 13:56
crude command runner
#!/usr/bin/env ruby
=begin
reads contents of a file hosted on a web server, then executes the commands.
security holes? yes, probably...
=end
@rockpapergoat
rockpapergoat / fix_missing_bundle_identifiers.rb
Created July 16, 2012 19:32
resolve missing bundle identifier issues by adding them to plists
#!/usr/bin/env ruby
# 2012-07-16, resolve missing bundle identifier issues by adding them to plists
# add your problem pkg receipts and values to the hash below.
identifiers = {
"vpnclient-api.pkg" => "com.cisco.vpnclient-api",
"vpnclient-bin.pkg" => "com.cisco.vpnclient-bin",
"vpnclient-kext.pkg" => "com.cisco.vpnclient-kext",
"vpnclient-profiles.pkg" => "com.cisco.vpnclient-profiles",
"vpnclient-startup.pkg" => "com.cisco.vpnclient-startup",
@rockpapergoat
rockpapergoat / Makefile
Created July 13, 2012 15:39
recovery partition creation pkg
#
# Copyright 2009 Joe Block <[email protected]>
#
# 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
@rockpapergoat
rockpapergoat / stash_user_file.rb
Created June 29, 2012 19:57
simulate casper's "fill each user" function
#!/usr/bin/env ruby
require 'FileUtils'
require 'pathname'
def get_homedir(user)
begin
Etc.getpwnam("#{user}")["dir"].chomp
rescue Exception => e
end
end
@rockpapergoat
rockpapergoat / EnCase
Created June 21, 2012 15:52
encase pkg parts
#!/bin/sh
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting EnCase Servlet"
/usr/local/sbin/enosxintel -d -p /usr/local/sbin
}
StopService ()
{
ConsoleMessage "Stopping EnCase Servlet"
@rockpapergoat
rockpapergoat / Makefile_flashplayer
Created June 15, 2012 18:40
flash player makefile
#
# Copyright 2009 Joe Block <[email protected]>
#
# 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
@rockpapergoat
rockpapergoat / computer_model.rb
Created June 1, 2012 12:31
extension attribute to get model
#!/usr/bin/ruby
def get_model
# using awk is way simpler, but i wanted to see if i could use just ruby.
#model = %x(system_profiler SPHardwareDataType | awk '/Model Identifier:/ {print $NF}')
# changed to use string.match to make it less ugly. still ugly, though.
model = %x(system_profiler SPHardwareDataType).match(/Model Identifier:\ .+$/).to_s.split(":").last.strip
end
def report_model(model)
@rockpapergoat
rockpapergoat / postflight
Created May 22, 2012 15:35
create a recovery partition using apple's tools
#!/bin/bash
hdiutil attach -nobrowse -noverify /tmp/RecoveryHDUpdate.dmg
hdiutil attach -nobrowse -noverify /Volumes/RecoveryHDUpdate/RecoveryHDUpdate.pkg/RecoveryHDMeta.dmg
/tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / /Volumes/Recovery\ HD\ Update/BaseSystem.dmg 0 0 /Volumes/Recovery\ HD\ Update/BaseSystem.chunklist
hdiutil eject /Volumes/Recovery\ HD\ Update
hdiutil eject /Volumes/RecoveryHDUpdate