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 python | |
import boto3 | |
import json | |
import sys | |
def find_public_addresses(ec2): | |
public_instances = {} | |
instance_public_ips = {} | |
instance_private_ips = {} | |
instance_ident = {} |
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
{ | |
"EngineConfiguration":{ | |
"PollInterval":"00:00:15", | |
"Components":[ | |
{ | |
"Id":"ApplicationEventLog", | |
"FullName":"AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch", | |
"Parameters":{ | |
"LogName":"Application", | |
"Levels":"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
version: 0.2 | |
env: | |
variables: | |
RCLONE_CONFIG_PUBLIC_TYPE: "http" | |
RCLONE_CONFIG_S3_TYPE: "s3" | |
RCLONE_CONFIG_S3_PROVIDER: "AWS" | |
RCLONE_CONFIG_S3_ENV_AUTH: "true" | |
RCLONE_CONFIG_S3_REGION: "eu-central-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
#!/bin/bash | |
export AWS_DEFAULT_PROFILE=zzzzzz | |
BUCKET=xxxxx | |
# DIRS="$HOME/.bash_profile $HOME/.gitconfig $HOME/.aws $HOME/.ssh $HOME/.bashrc $HOME/.gnupg $HOME/.bash_history" | |
DIRS="$HOME/.bash_profile $HOME/.gitconfig $HOME/.aws $HOME/.ssh $HOME/.bashrc $HOME/.gnupg $HOME/.bash_history $HOME/git" | |
echo "Backup $DIRS.." |
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
<seelog type="adaptive" mininterval="2000000" maxinterval="100000000" critmsgcount="500" minlevel="info"> | |
<exceptions> | |
<exception filepattern="test*" minlevel="error"/> | |
</exceptions> | |
<outputs formatid="fmtinfo"> | |
<console formatid="fmtinfo"/> | |
<rollingfile type="size" filename="/var/log/message" maxsize="30000000" maxrolls="5"/> | |
<custom name="cloudwatch_receiver" formatid="fmtjs" data-log-group="/aws/ssm/demolog"/> | |
</outputs> | |
<formats> |
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
# auto mfa | |
complete -W "$(ls -1 ~/.aws/*.mfa | awk -F "/" '{print $5}' | sed -e 's/\.mfa$//')" mfa | |
function mfa () { | |
oathtool --base32 --totp "$(cat ~/.aws/$1.mfa)" | pbcopy ; | |
} | |
# manual mfa | |
function mmfa () { | |
oathtool --base32 --totp "$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
daemon off; | |
worker_processes auto; | |
events { worker_connections 1024; } | |
http { | |
sendfile on; |
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
import boto3 | |
def find_public_addresses(ec2): | |
public_instances = {} | |
instance_public_ips = {} | |
instance_private_ips = {} | |
instance_ident = {} | |
instances = ec2.instances.filter(Filters=[{'Name': 'instance-state-name', 'Values': ['running'] }]) | |
# Ranges that you define as public subnets in AWS go here. |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:DescribeAddresses", | |
"ec2:DescribeClassicLinkInstances", | |
"ec2:DescribeCustomerGateways", | |
"ec2:DescribeDhcpOptions", |
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
################################################## | |
### Elasticsearch host name | |
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com" | |
### Elasticsearch prefix for index name | |
INDEX_PREFIX = "elb_log" | |
### ELB name for type name | |
ELB_NAME = "*****" | |