These are just rough notes, maybe I'll clean them up later.
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ssm:DescribeAssociation", | |
"ssm:GetDeployablePatchSnapshotForInstance", | |
"ssm:GetDocument", | |
"ssm:GetManifest", |
I hereby claim:
- I am raymondbutcher on github.
- I am rbutcher (https://keybase.io/rbutcher) on keybase.
- I have a public key whose fingerprint is CBE2 0B2D DA8D E1F5 1AD0 C4E3 E38B D102 BABD EE8E
To claim this, I am signing this object:
This file contains 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 bash | |
# | |
# Usage: waitfor <command> | |
# Example: waitfor sudo service httpd status | |
# | |
# Waits until a command returns true (exit code: 0) | |
# | |
# Save or link this file as "waitwhile" to reverse the check, | |
# and wait while the command returns true. | |
# |
This file contains 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
import time | |
class SluggishCache(object): | |
""" | |
A partial wrapper for a Django cache API object. It will remember cache | |
values in local memory for the specified delay time (in seconds) to | |
avoid accessing the cache backend. This might be useful for a small | |
number of keys which get accessed very frequently. |
This file contains 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
import sys | |
import time | |
from contextlib import contextmanager | |
@contextmanager | |
def time_elapsed(name=''): | |
""" | |
A context manager for timing blocks of code. |
This file contains 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
""" | |
Returns this: | |
{ | |
'help_text': 'Returns a list of sites for which the given user has access.', | |
'returns': {'type': 'array', 'desc': 'list of blog dicts'}, | |
'args': { | |
'username': {'type': 'string', 'desc': 'your username'}, | |
'password': {'type': 'string', 'desc': 'plain text password'} | |
} |
This file contains 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
from ScriptingBridge import SBApplication | |
class ITunes(object): | |
""" | |
Display the total duration (in hours) of your music libraries in iTunes. | |
This is admittedly pretty dumb. | |
""" |