Skip to content

Instantly share code, notes, and snippets.

@pudquick
pudquick / warranty_update.py
Last active March 10, 2019 11:49
Casper warranty estimation, stored locally at /Library/Preferences/com.apple.warranty - in python!
#!/usr/bin/python
import os.path, subprocess, datetime, dateutil.parser, time, sys
def apple_year_offset(dateobj, years=0):
# Convert to a maleable format
mod_time = dateobj.timetuple()
# Offset year by number of years
mod_time = time.struct_time(tuple([mod_time[0]+years]) + mod_time[1:])
# Convert back to a datetime obj
return datetime.datetime.fromtimestamp(int(time.mktime(mod_time)))
startosinstall command & syntax
Command: startosinstall
Requires root access: Yes
Parameters:
- -usage: Displays all parameters available for the command.
- -agreetolicense: Agrees to the license agreement during deployment (Required for automated deployments).