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
"UserData": { | |
"Fn::Base64": { "Fn::Join":["", [ | |
"#!/bin/bash -ex\n", | |
"apt-get update\n", | |
"apt-get -y install python-setuptools\n", | |
"mkdir aws-cfn-bootstrap-latest\n", | |
"curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n", | |
"easy_install aws-cfn-bootstrap-latest\n", | |
"/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n", | |
"\n", |
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
__author__ = 'ahmed' | |
import boto3, botocore | |
import argparse | |
def get_vpcid(sitename, client): | |
response = client.describe_vpcs( | |
Filters = [{ | |
'Name': 'tag:Site', | |
'Values': [ |
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
# Quick script to configure routes for a VPC peering connection | |
# Searches a region for all peering connection and prompts to choose one | |
# Configures routes between the peered networks for all routing tables | |
# STS/AssumeRole not implemented cross-account peering. Instead, | |
# Choose accepter/requestor depending on which credentials are set in the environment | |
# Enter either IPv4 and IPv6 route destinations | |
# Example usage: | |
# ( Assuming boto credentials are configured) | |
# $ pip install boto3 | |
# $ python3.6 peer_routes.py |
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
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
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
#!groovy | |
// imports | |
import hudson.plugins.git.* | |
import hudson.plugins.git.extensions.* | |
import hudson.plugins.git.extensions.impl.* | |
import jenkins.model.Jenkins | |
// parameters | |
def jobParameters = [ |
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
# link: http://allandenot.com/devops/2015/01/31/provisioning-ec2-hosts-with-ansible.html | |
--- | |
- name: Provision EC2 Box | |
local_action: | |
module: ec2 | |
key_name: "{{ ec2_keypair }}" | |
group_id: "{{ ec2_security_group }}" | |
instance_type: "{{ ec2_instance_type }}" | |
image: "{{ ec2_image }}" |
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
--- | |
Description: AWSAppSync DynamoDB Example | |
Resources: | |
GraphQLApi: | |
Type: "AWS::AppSync::GraphQLApi" | |
Properties: | |
Name: AWSAppSync DynamoDB Example | |
AuthenticationType: AWS_IAM | |
PostDynamoDBTableDataSource: |
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 React, { Component } from 'react' | |
import CloudWatchLogs from 'aws-sdk/clients/cloudwatchlogs' | |
import Fingerprint2 from 'fingerprintjs2' | |
import StackTrace from 'stacktrace-js' | |
import { promisify } from 'es6-promisify' | |
export default class Logger { | |
events = [] | |
originalConsole = null |
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
# This example is from https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html. | |
UserData: | |
Fn::Base64: | |
!Sub | | |
#!/bin/bash -xe | |
yum update -y aws-cfn-bootstrap | |
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets wordpress_install --region ${AWS::Region} | |
/opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region} |
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
//https://youtu.be/Mgs7jl430vs | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", |
OlderNewer