This file contains 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 | |
# Copyright 2016-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at | |
# http://aws.amazon.com/apache2.0/ | |
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | |
import json | |
import boto3 | |
import http.client |
This file contains 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 | |
import pprint | |
import os | |
import re | |
environment = os.environ.get('ENVIRONMENT', 'development') | |
domain = os.environ.get('DOMAIN', f'sd-{environment}.internal') | |
cluster = f'{environment}-ECSCluster' | |
DEFAULT_TTL = 0 | |
DEFAULT_WEIGHT = 1 |
This file contains 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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log debug; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
This file contains 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/sh | |
remove_last_comma() { sed ' | |
$x;$G;/\(.*\),/!H;//!{$!d | |
}; $!x;$s//\1/;s/^\n//' | |
} | |
response=$(curl -s "https://cloud-images.ubuntu.com/locator/ec2/releasesTable" | remove_last_comma) | |
regions=$(echo $response | jq -c '.aaData[] | select(contains(["16.04", "hvm:ebs"])) | .[0]' | sed 's/"//g') |
This file contains 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 -xe | |
REGIONS=$(aws ec2 describe-regions --query "Regions[].RegionName" --output text) | |
for region in $REGIONS; do | |
ami=$(aws --region $region ec2 describe-images --filters "Name=name,Values=amzn-ami-hvm-2018.03.0.20180508-x86_64-gp2" --query "Images[0].ImageId" --output "text") | |
printf "$region:\n AMI: '$ami'\n" | |
done |
This file contains 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
init: | |
./dep_wrapper.sh init | |
./dep_wrapper.sh ensure | |
ensure: | |
./dep_wrapper.sh ensure | |
build: | |
mkdir -p ./src | |
cp -R ./vendor/. ./src/ |
This file contains 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/sh | |
CURR_DIR="$(PWD)" | |
PARENT_DIR="$(dirname $CURR_DIR)" | |
export GOPATH="$(mktemp -d "/tmp/dep.XXXXXXXX")" | |
trap "rm -rf \"${GOPATH}\"" EXIT HUP INT | |
SRCDIR="${GOPATH}/src/$PARENT_DIR" | |
mkdir -p "$(dirname "${SRCDIR}")" |
This file contains 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
Parameters: | |
VPC: | |
Description: VPC that will be used for Cluster. | |
Type: AWS::EC2::VPC::Id | |
Resources: | |
MyTestSecurityGroup: | |
Type: AWS::EC2::SecurityGroup |
This file contains 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
/** | |
* @class TextCoding | |
* | |
* @constructor | |
*/ | |
function TextCoding() {} | |
/** | |
* Replaces CP-1251 encodings in string with UTF-8 | |
* |
This file contains 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
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\] \w\[\033[01;31m\]\$(parse_git_branch)\$\[\033[00m\] " | |
# aliases | |
alias lt='ls -al --time-style=+%D | grep $(date +%D)' | |
function parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} |
NewerOlder