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
from __future__ import print_function | |
import boto3 | |
#from datetime import datetime, timedelta, tzinfo | |
def sts_info(event, context): | |
sts = boto3.client('sts') | |
caller_id = sts.get_caller_identity() | |
awsid = caller_id['Account'] | |
http_header = caller_id['ResponseMetadata']['HTTPHeaders'] |
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
from __future__ import print_function | |
import boto3 | |
def sts_info(event, context): | |
sts = boto3.client('sts') | |
caller_id = sts.get_caller_identity() | |
awsid = caller_id['Account'] | |
http_header = caller_id['ResponseMetadata']['HTTPHeaders'] | |
date = caller_id['ResponseMetadata']['HTTPHeaders']['date'] | |
response_metadata = caller_id['ResponseMetadata'] |
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
#!/bin/bash | |
# After installing dynamodb-local with brew you can start it with | |
# the following command | |
# | |
java -Djava.library.path=/usr/local/Cellar/dynamodb-local/2016-05-17/libexecynamoDBLocal_lib -jar /usr/local/Cellar/dynamodb-local/2016-05-17/libexec/DynamoDBLocal.jar -port 9000 -dbPath /opt/dynamodb-local |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Cross stack security group' | |
Resources: | |
egress1: | |
Type: AWS::EC2::SecurityGroupEgress | |
Properties: | |
CidrIp: 0.0.0.0/0 | |
GroupId: | |
Ref: sgTESTY22 | |
IpProtocol: '-1' |
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
myInstance: | |
Type: AWS::EC2::Instance | |
Properties: | |
ImageId: | |
Fn::FindInMap: | |
- RegionMap | |
- Ref: AWS::Region | |
- AMI | |
InstanceType: t1.micro | |
KeyName: |
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
scp -oProxyCommand="ssh -W %h:%p <user>@<host>" <file> <user>@<host>:<path> |
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
openssl s_client -showcerts -connect <host>:443 |
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
curl -s -D - < URL > -o /dev/null | grep -E "Date|Expires" |
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
git config --global core.editor $(which vim) |
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
Jq notes | |
Show names and ids of all efs file systems | |
$ aws efs describe-file-systems | jq '.FileSystems[] | {FileSystems: .Name, FileSystemId}' | |
Select a single file system based on its name tag, | |
$ aws efs describe-file-systems | jq '.FileSystems[] | select(.Name == "my_fs_name")' |