Skip to content

Instantly share code, notes, and snippets.

View n8felton's full-sized avatar
🍎

Nate Felton n8felton

🍎
View GitHub Profile
@n8felton
n8felton / hack.sh
Created March 31, 2012 15:07 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
#!/bin/bash
[ ! `id -u` = 0 ] && echo "Requires elevation. Please run as root or use \"sudo\" ($(id -u))" && exit 1
SCRIPT_START=$(date +%s)
SCRIPT_PATH=$(dirname $0)
SCRIPT_NAME=$(basename $0 .sh)
LOG="/var/log/$SCRIPT_NAME.log"
@n8felton
n8felton / dastest
Created July 20, 2012 21:36
Testing daslib
#!/usr/bin/env php
<?php
require_once 'daslib.php';
$guid = generateGUID();
$applicationName = "dascli";
$serviceTag = "24BL3R1";
$serials = "DRX5WL1,HRX5WL1,FWX5WL1,9RX5WL1,CWX5WL1,GVX5WL1,9SX5WL1,CRX5WL1,7SX5WL1,CSX5WL1,BRX5WL1,BQX5WL1,DSX5WL1,6RX5WL1,6SX5WL1,JTX5WL1,7RX5WL1,9WX5WL1,2SX5WL1,3VX5WL1,DWX5WL1,DVX5WL1,BSX5WL1,JVX5WL1,5WX5WL1,4SX5WL1,8RX5WL1,5TX5WL1,GQX5WL1,DQX5WL1,9VX5WL1,FQX5WL1,7WX5WL1,6VX5WL1,2WX5WL1,FTX5WL1,9MB3NM1,CXNV6D1";
$ sudo managedsoftwareupdate --applesuspkgsonly --installonly
Password:
Managed Software Update Tool
Copyright 2010-2012 The Munki Project
http://code.google.com/p/munki
Starting...
Performing preflight tasks...
NOTE: managedsoftwareupdate is configured to process Apple Software Updates only.
Nothing to install or remove.
$ sudo managedsoftwareupdate --applesuspkgsonly
Managed Software Update Tool
Copyright 2010-2012 The Munki Project
http://code.google.com/p/munki
Starting...
Performing preflight tasks...
NOTE: managedsoftwareupdate is configured to process Apple Software Updates only.
Checking Apple Software Update catalog...
0..20..40..60..80..100
#Generated: 2013-03-20
# $Rev$ from $Date$
Installer Disc Builds: 10A432, 10B504, 10C540, 10D573, 10D575, 10F569
Output Volume Name: Macintosh HD
Output File Name: 10.6_vanilla
OS Updates:
iTunes 11.0.2 http://appldnld.apple.com/iTunes11/041-9794.20130220.DdPy6/iTunes11.0.2.dmg sha1:e8eba6c2b83b9e24116a9944c808525bed260aa0
#!/bin/sh
KICKSTART="/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart"
CONFIG_PARAMS="-configure -access -on -privs -none -allowAccessFor -specifiedUsers -clientopts -setmenuextra -menuextra no -setdirlogins -dirlogins yes"
RESTART_PARAMS="-activate -restart -agent -console"
ADMIN_GROUP="MAIN\LABSVCS-Admins"
/usr/sbin/dseditgroup -o delete -t group com.apple.local.ard_admin 2>&1
/usr/sbin/dseditgroup -o create com.apple.local.ard_admin 2>&1
@n8felton
n8felton / gist:5726752
Created June 7, 2013 02:47
Sample iWork09 catalog file for InstaDMG
Apple Updates:
iWork '09 iWork09.mpkg sha1:2e46c72a31d887d898dde83adfb410566f378ca1
@n8felton
n8felton / reset_ethernet.sh
Created July 9, 2013 19:42
Check to see if you can ping the Gateway IP address, and if not, reset the interface.
#!/bin/bash
# Check to see if you can ping the Gateway IP address, and if not, reset the interface.
# Author: Nathan Felton
# Date: 2013-07-09
if [ $EUID -ne 0 ]; then
echo "Run as root."
exit 1
fi
To fix permissions on NetBoot sets for the Apple NetBoot server.
sudo xattr -dr com.apple.quarantine /Library/NetBoot/NetBootSP0
sudo xattr -dr com.apple.FinderInfo /Library/NetBoot/NetBootSP0
sudo chown -R root:admin /Library/NetBoot/NetBootSP0/*
sudo find /Library/NetBoot/NetBootSP0/ -type d -exec chmod 755 {} \;
sudo find /Library/NetBoot/NetBootSP0/ -type f -exec chmod 664 {} \;
for d in $(find /Library/NetBoot/NetBootSP0 -name "NetInstall.sparseimage"); do cd $(dirname $d); sudo rm NetInstall.dmg; sudo ln -s $(basename $d) NetInstall.dmg; done