Random recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
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
def touch(path): | |
with open(path, 'a'): | |
os.utime(path, None) | |
def lock_file(LOCK_FILE): | |
now = datetime.now() | |
restart_hours = [1] | |
if now.hour in restart_hours: | |
if VERBOSE: PrettyLogger(log_level="info", msg="H|Restart hour hgreen|Found.") |
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
def touch(path): | |
with open(path, 'a'): | |
os.utime(path, None) |
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/env python2.7 | |
# | |
# kills openresty nginx and possibly regular nginx '"hung"' worker processes | |
# | |
# version 0.1 | |
# | |
import psutil | |
import os | |
import time |
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/env python2.7 | |
# | |
# kills openresty nginx and possibly regular nginx '"hung"' worker processes | |
# | |
# version 0.1 | |
# | |
import psutil | |
import os | |
import time |
NewerOlder