Skip to content

Instantly share code, notes, and snippets.

View chrisgrande's full-sized avatar

Christopher Grande chrisgrande

View GitHub Profile
@chrisgrande
chrisgrande / TimeInterval.py
Created August 31, 2023 20:26
A python version of the Ruby 5.day.ago syntax.
#!/usr/bin/env python3
from datetime import datetime, timedelta
class TimeDeltaWrapper:
def __init__(self, delta):
self.delta = delta
def ago(self):
return datetime.now() - self.delta
@chrisgrande
chrisgrande / ea_ddm_decalaration.sh
Created January 8, 2024 22:55
macOS Software Update DDM Extension Attribute
#!/bin/bash
# Define the path to the property list file
plist_file="/var/db/softwareupdate/SoftwareUpdateDDMStatePersistence.plist"
# Check if the file exists
if [ -f "$plist_file" ]; then
# Use PlistBuddy to extract the Declarations section
declarations=$(/usr/libexec/PlistBuddy -c "Print SUCorePersistedStatePolicyFields:Declarations" "$plist_file")