Skip to content

Instantly share code, notes, and snippets.

@MagerValp
MagerValp / kickstartam.sh
Created November 27, 2014 14:10
Force Absolute Manage agent to install packages without delay.
#!/bin/bash
#
# Force Absolute Manage to install software at the login window.
declare -r AMSERVER="your.amserver.example"
declare -r AMDIR="/Library/Application Support/LANrev Agent"
declare -r AMAGENT="$AMDIR/LANrev Agent.app/Contents/MacOS/LANrev Agent"
declare -r LOGFILE="/var/log/kickstartam.log"
@MagerValp
MagerValp / derparse.py
Last active August 29, 2015 14:11
Parse DER format file
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import argparse
class DERParserException(BaseException):
pass
@MagerValp
MagerValp / dafgu_check_extra_volumes.py
Created December 19, 2014 15:23
DeployStudio: Verify that the client only has a single volume named Macintosh HD on the boot drive.
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Verify that the client only has a single volume on the boot drive.
import sys
import argparse
import subprocess
import plistlib
@MagerValp
MagerValp / cmd_board.dis
Last active August 29, 2015 14:18
Ultima IV board command disassembly
.C:4769 A5 1E LDA $1E
.C:476b C9 1F CMP #$1F
.C:476d F0 0F BEQ $477E
.C:476f 20 21 08 JSR $0821
>C:4772 c2 ef e1 f2 e4 a0 bc ad 00
.C:477b 4C 89 41 JMP $4189
.C:477e A5 48 LDA $48
.C:4780 C9 14 CMP #$14
@MagerValp
MagerValp / onlyone.sh
Last active August 29, 2015 14:27
Shell script that uses an flock on itself to avoid multiple instances being run
#!/bin/bash
# Based on https://plus.google.com/+RandalLSchwartz/posts/QcrqvT3mUdy
exec 200< "$0"
if ! perl -MFcntl=LOCK_EX,LOCK_NB -e 'open(FH, "<&=200"); flock(FH, LOCK_EX|LOCK_NB) or exit 1'; then
echo "There can be only one!"
exit 1
fi
echo "Locked and safe"
@MagerValp
MagerValp / MacSysAdminFood.markdown
Last active November 11, 2023 11:04
MacSysAdmin food joins

Favorite food joints near MacSysAdmin

Name Food Address
Little Meats Tacos Olivedalsgatan 13
TomTom's Burritos & Quesdillas Prinsgatan 10
Beijing 8 Dumplings Magasinsgatan 3
Puta Madre Mexican Magasinsgatan 3
Jinx Bao (pork & vegan) Magasinsgatan 17
@MagerValp
MagerValp / clearsign.patch
Created October 7, 2015 15:31
TimeEdit signing fix
--- universalJavaApplicationStub 2015-10-07 17:24:44.000000000 +0200
+++ universalJavaApplicationStub.clearsign 2015-10-07 17:30:07.000000000 +0200
@@ -100,6 +100,12 @@
JVMVersion=""
+if [[ -d "$AppPackageFolder/Contents/_CodeSignature" ]]; then
+ logger -t TimeEdit "Clearing quarantine attribute from $AppPackageFolder"
+ xattr -r -c "$AppPackageFolder"
+ logger -t TimeEdit "Removing code signature from $AppPackageFolder"
@MagerValp
MagerValp / Security Update 2015-006 Yosemite.patch
Created December 13, 2015 12:48
Yosemite Security Update 2015-005 vs 2015-006
diff -rub Security Update 2015-005 Yosemite.pkg/Distribution Security Update 2015-006 Yosemite.pkg/Distribution
--- Security Update 2015-005 Yosemite.pkg/Distribution 2015-11-13 00:32:26.000000000 +0100
+++ Security Update 2015-006 Yosemite.pkg/Distribution 2015-12-12 02:30:09.000000000 +0100
@@ -42,7 +42,7 @@
my.result.type = 'Fatal';
return false;
}
- if (compareBuildVersions(my.target.systemVersion.ProductBuildVersion, '14F1505') &gt; 0) {
+ if (compareBuildVersions(my.target.systemVersion.ProductBuildVersion, '14F1509') &gt; 0) {
my.result.message = system.localizedString('ERROR_4');
@MagerValp
MagerValp / AutoDMG Users.markdown
Last active December 22, 2015 13:15
Number of AutoDMG user IPs per country

26777 AutoDMG users in 164 countries:

IPs Country
81 United Arab Emirates
2 Afghanistan
4 Albania
2 Armenia
1 Angola
42 Argentina
@MagerValp
MagerValp / collision.py
Created January 28, 2016 12:20
Find OS X AD user UniqueID collisions
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import base64
userids = dict()
with open(sys.argv[1]) as f: