This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
## ntlm-hash.py | |
# create a NTLM hash from user input (or input redirect) | |
# thanks to https://stackoverflow.com/a/15603809 | |
# usage: | |
# - put this content in ~/dev/ntlm-hash.py | |
# - append next line (without comment) to ~/.zprofile | |
# alias 2ntlm="pbpaste | /usr/bin/python3 ~/dev/ntlm-hash.py | pbcopy" | |
# source ~/.zprofile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check for user presence at console by checking for screen lock and console login status | |
# Thanks to https://stackoverflow.com/users/908494/abarnert at | |
# https://stackoverflow.com/a/11511419/4326287 | |
# Wait until console is logged in and screen is unlocked | |
while true ; | |
do | |
timestamp=$(date +%Y-%m-%dT%H:%M:%S%z) | |
python -c 'import sys,Quartz; d=Quartz.CGSessionCopyCurrentDictionary(); sys.exit(d and d.get("CGSSessionScreenIsLocked", 0) == 0 and d.get("kCGSSessionOnConsoleKey", 0) == 1)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Check for user presence at console by checking for screen lock and console login status | |
# Thanks to https://stackoverflow.com/users/908494/abarnert at | |
# https://stackoverflow.com/a/11511419/4326287 | |
import sys | |
import Quartz | |
from datetime import datetime | |
from dateutil.tz import tzlocal | |
import time |