Skip to content

Instantly share code, notes, and snippets.

View carlashley's full-sized avatar
🎯
Focusing on life.

Carl carlashley

🎯
Focusing on life.
View GitHub Profile
@carlashley
carlashley / mdns_debug_state.py
Last active November 14, 2016 10:51
mDSN Debug states
#!/usr/bin/python
# A dictionary detailing what logging is configured for mDNS debugging
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'mDNS', None, None)
result = SCDynamicStoreCopyValue(ds, 'State:/Network/mDNSResponder/DebugState')
@carlashley
carlashley / smb.py
Last active November 14, 2016 10:50
Apple SMB
#!/usr/bin/python
# A dictionary of SMB server configuration settings
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'smb', None, None)
result = SCDynamicStoreCopyValue(ds, 'com.apple.smb')
@carlashley
carlashley / cpu_power.py
Last active August 25, 2021 05:05
CPU Power
#!/usr/bin/python
# A dictionary of available CPU's, COU scheduler limit, and CPU speed limit
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'power', None, None)
result = SCDynamicStoreCopyValue(ds, 'State:/IOKit/Power/CPUPower') # returns nothing on Apple Silicon
@carlashley
carlashley / system_load.py
Last active November 14, 2016 10:48
Detailed system load
#!/usr/bin/python
# A dictionary of system load information.
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'power', None, None)
result = SCDynamicStoreCopyValue(ds, 'State:/IOKit/PowerManagement/SystemLoad/Detailed')
@carlashley
carlashley / current_power.py
Last active April 3, 2017 06:25
Current power settings
#!/usr/bin/python
# A dictionary of current power settings from various system configurations
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'power', None, None)
result = SCDynamicStoreCopyValue(ds, 'State:/IOKit/PowerManagement/CurrentSettings')
@carlashley
carlashley / power_adaptor.py
Last active November 14, 2016 10:46
Power adaptor info
#!/usr/bin/python
# A dictionary of information about connected AC adaptor for Mac laptops
from SystemConfiguration import (
SCDynamicStoreCreate,
SCDynamicStoreCopyValue,
)
ds = SCDynamicStoreCreate(None, 'power', None, None)
result = SCDynamicStoreCopyValue(ds, 'State:/IOKit/PowerAdapter')
# Returns nothing if no adaptor connected.