Skip to content

Instantly share code, notes, and snippets.

@macjustice
macjustice / days_from_now.py
Last active May 16, 2022 19:13
Calculate a future date
from datetime import datetime, timedelta
days_from_now=30
print(datetime.now())
@macjustice
macjustice / maycam_import.py
Last active November 13, 2021 20:27
For renaming photos and videos from May's camera
#!/usr/local/bin/python3
from pathlib import Path
from IPython import embed
videos = Path('/Volumes/DRAGONTOUCH/VIDEO')
photos = Path('/Volumes/DRAGONTOUCH/PHOTO')
embed()
@macjustice
macjustice / dep-debug.md
Last active April 30, 2021 22:44
DEP Debugging from JAMF

Collecting logs for DEP enrollment processes

  1. Hold CMD + R at boot to boot the machine into Recovery Mode.
  2. Navigate to Utilities > Terminal to launch a Terminal shell
  3. Run the following com mands against the internal volume (normally just "Macintosh HD"):
    • defaults write /Volumes/Macintosh\ HD/Library/Preferences/com.apple.apsd EnableDetailedLogging -bool TRUE
    • defaults write /Volumes/Macintosh\ HD/Library/Preferences/com.apple.MCXDebug debugOutput -2
    • defaults write /Volumes/Macintosh\ HD/Library/Preferences/com.apple.MCXDebug collateLogs 1
    • touch /Volumes/Macintosh\ HD/var/db/MDM_EnableDebug
  4. Reboot the machine
@macjustice
macjustice / The Gregest Love of All
Last active May 24, 2020 06:32
To the tune of “The Greatest Love of All” as performed by Whitney Houston
Greg believes the children are our are future
Teach them well and let them lead the way
Show them all the beauty they possess inside
Give them a sense of pride to make it easier
Let the children's laughter remind Greg how Greg used to be
Everybody searching for a hero
People need someone to look up to
I never found anyone who fulfill Greg's needs
A lonely place to be
And so Greg learned to depend on Greg
@macjustice
macjustice / Imagr-MDT-Guide.md
Last active December 6, 2016 00:15 — forked from androindep/DS-MDT-Guide.md
Deploying BootCamp with Imagr & MDT/LiteTouch

#Deploying BootCamp with Imagr & MDT/LiteTouch

So, you have a Windows Deployment Server and you'd like to use Microsoft Deployment Toolkit to image your Windows partitions on your dual-boot Macs.

Over the years--judging by the date of some of the posts I've seen on the topic--it seems that using MDT or SCCM to install BootCamp on a Mac en masse was more common in the past than it is now. Several folks cite their LiteTouch Task Sequences failing with this error or that ever since they upgraded from 2010 to something more modern.

There are other deployment tools out there for putting Windows on a Mac, but few are as flexible and modular as MDT--and things get even trickier in some ways with newer Macs that don't support Legacy booting, as their boot information is written to the EFI partition.

Using Windows-based installation tools ensures that the proper boot information gets written right the first time in the way Microsoft intended, no matter whether you are imaging a Legacy or UEFI-style installation

munkitest () { # Optional first arg is a ClientID to check
if [[ $# == 0 ]]; then
sudo managedsoftwareupdate --checkonly --munkipkgsonly -vv
else
echo "Checking updates for $1"
sudo managedsoftwareupdate --checkonly --munkipkgsonly -vv --id=$1
fi
}
@macjustice
macjustice / Imaging.md
Created October 16, 2015 19:03
Synapse Image Workflow c. 2012

Required - Laptop, New user's username and temporary password, Clonezilla boot device, wired network connection, steely resolve

  1. Install additional RAM. Laptops are purchased with 4GB, we normally upgrade them to 8GB.
  2. Apply image using Clonezilla
    1. Boot from Clonezilla boot media.
    2. Select "Boot to RAM option" unless other selection required by hardware (13" MacBook, Air)
    3. Select defaults (english, don't touch keymap, start clonezilla, device-image) until you reach the image source selector.
    4. Choose Samba server and DHCP
    5. Server address: "kif"
    6. Domain: "synapsedev"