Skip to content

Instantly share code, notes, and snippets.

@patricksanders
patricksanders / summarize.py
Created Jan 31, 2020
Summarize IAM policy with policy_sentry
View summarize.py
import json
from policy_sentry.analysis.analyze import analyze_by_access_level, determine_actions_to_expand
from policy_sentry.shared.database import connect_db
DB_SESSION = connect_db('bundled') # Use the bundled data that comes with Policy Sentry
sample_policy = json.loads("""
{
"Statement":[
View mentoring_tips.md

via @rob_rix (https://twitter.com/rob_rix/status/1073199812844097536)

Mentoring is challenging. You have to:

  • be mindful of the power gradient between yourself and your mentee;
  • be mindful of your mentee’s current level of understanding;
  • provide context around why, and not just what things are done;
  • come up with explanations on the fly;
  • let your mentee make mistakes so they can learn to diagnose & recover from them;
  • give them challenges that are just outside their current reach;
View gist:7fdac24e58e42dc495758398fb59da08
# set aliases
. ~/.bash_aliases
new-alias() {
local last_command=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //')
echo alias $1="'""$last_command""'" >> ~/.bash_aliases
. ~/.bash_aliases
}
View keybase.md

Keybase proof

I hereby claim:

  • I am patricksanders on github.
  • I am patricksanders (https://keybase.io/patricksanders) on keybase.
  • I have a public key whose fingerprint is C7D5 6A1F 1590 4160 6F7D 2B2E 310A CA60 2E27 A12A

To claim this, I am signing this object: