Skip to content

Instantly share code, notes, and snippets.

View jsgarmon's full-sized avatar

John S-G jsgarmon

View GitHub Profile

Testing

pic

${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 }

Keybase proof

I hereby claim:

To claim this, I am signing this object:

#!/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
# 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>

Example of entry:

/dev/disk/by-uuid/183A84CD3A84A978 /mnt/Windows ntfs defaults,x-gvfs-show,umask=037,gid=46 0 0

Options

  • 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.
OSZAR »