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
| AWS_ACCESS_KEY_ID = '' # todo: insert aws key. | |
| AWS_ACCESS_KEY_SECRET = '' # todo: insert aws secret. | |
| import os | |
| import boto | |
| import boto.s3 | |
| import os.path | |
| import sys, getopt | |
| import logging |
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
| VBoxManage clonehd [OldHDDFile.vdi] [NewHDDFile.vdi] --existing - See more at: http://tips.kaali.co.uk/2012/03/16/expand-or-increase-the-size-of-virtual-box-vdi-dis/#sthash.WFNw5Rha.dpuf |
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
| def __copy_properties(copy_from, copy_to): | |
| for key in copy_from: | |
| print 'found ' + str(key) | |
| if hasattr(copy_to, key): | |
| print 'for key "{2}" - copying value "{0}" from copy_from and replacing value "{1}" in copy_to'.format(copy_from[key], getattr(copy_to, key), key) | |
| setattr(copy_to, key, copy_from[key]) |
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
| using System.Linq; | |
| using System.Text; | |
| using System; | |
| using System.Collections.Generic; | |
| using Amazon.DynamoDBv2; | |
| using Amazon.DynamoDBv2.Model; | |
| using Amazon.Runtime; | |
| using Amazon.S3; | |
| using System.Configuration; |
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", | |
| "Metadata": { | |
| }, | |
| "Parameters": { | |
| "EnvironmentParameter": { | |
| "Type": "String", | |
| "Default": "dev", | |
| "AllowedValues": ["dev", "test", "stage", "lt", "prod"], | |
| "Description": "Supply an environment from the choices: dev, test, stage, lt, or prod. The default is dev." |
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 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| .. module:: get_api_id_from_stack | |
| :synopsis: | |
| """ | |
| import boto3 | |
| import sys |
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 os | |
| import time | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| def get_api_id_from_stack(stack_name): | |
| api_id = "" | |
| try: | |
| cloudformation = boto3.client('cloudformation') |
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 re | |
| import json | |
| p = re.compile("\{\{[\w]+\}\}") | |
| input_path = '/path/to/swagger.json' | |
| add_whitespace = False | |
| f = open(input_path) | |
| fw = open(input_path + '.notokens', 'w') |
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 | |
| # -*- coding: utf-8 -*- | |
| import boto3 | |
| from boto.dynamodb2.table import Table | |
| def saveSetting(applicationName, settingName, value): | |
| client = boto3.client('dynamodb') | |
| response = client.update_item(TableName="chrisSettings", | |
| Key={ "applicationName": { "S": applicationName } }, |
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
| role_result=$(aws sts assume-role --role-arn "%deployer_arn%" --role-session-name "deploy-dynamo-assets" --external-id "%assume_role_external_id%") | |
| secret_key=$(echo $role_result | python -mjson.tool | grep "SecretAccessKey" | awk -F':' '{print $2}'| sed "s/[ |\"|,]//g") | |
| session_token=$(echo $role_result | python -mjson.tool | grep "SessionToken" | awk -F':' '{print $2}'| sed "s/[ |\"|,]//g") | |
| access_key=$(echo $role_result | python -mjson.tool | grep "AccessKeyId" | awk -F':' '{print $2}'| sed "s/[ |\"|,]//g") | |
| echo "##teamcity[setParameter name='env.AWS_SECRET_ACCESS_KEY' value='${secret_key}']" | |
| echo "##teamcity[setParameter name='env.AWS_SECURITY_TOKEN' value='${session_token}']" | |
| echo "##teamcity[setParameter name='env.AWS_ACCESS_KEY_ID' value='${access_key}']" |