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
${jsonencode({ | |
Sid = "testingEC2", | |
Effect = "Allow", | |
Action = ["ec2:*"], | |
Resource = [for instance in instances : "arn:aws-us-gov:ec2:us-gov-west-1:008577686731:instance/${instance}"] | |
})}%{ if !is_last },%{ endif } |
I hereby claim:
- I am jsgarmon on github.
- I am jsgarmon (https://keybase.io/jsgarmon) on keybase.
- I have a public key ASCkGYcOXD3MBpszxhmMVYVFE2mASPW_KLspAl1HXUb45go
To claim this, I am signing this object:
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 python3 | |
''' | |
Produce a one-time password (OTP) from a secret or a json | |
file and label. | |
example: get_otp.py -f ./my-secret.json -l github | |
example: get_otp.py -s NY30 | |
''' | |
import json |
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
# call with `mfa` or `mfa $AWS_PROFILE_TO_USE` | |
mfa() { | |
local bold=$(tput bold) | |
local normal=$(tput sgr0) | |
local AWS_PROFILE=${1:-'default'} | |
if [ -f ~/.aws/session_credentials.sh ]; then | |
source ~/.aws/session_credentials.sh | |
AWS_PROFILE=$AWS_PROFILE aws ssm start-session --target invalid-id 2>&1 | grep -P 'AccessDeniedException|ExpiredTokenException' | |
if [ $? -ne 0 ]; then |
<device name> <mount point> <filesystem type> <options> <backup> <fsck check>
/dev/disk/by-uuid/183A84CD3A84A978 /mnt/Windows ntfs defaults,x-gvfs-show,umask=037,gid=46 0 0
- auto and noauto : auto specifies that the device/partition should be automatically mounted on boot time and ‘noauto’ specifies that the device should be explicitly mounted. When you execute ‘mount –a’ all partition that has ‘auto’ value set will get mounted automatically. The root partitions should have the ‘auto’ option set so that the partition will get mounted automatically.