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
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 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 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 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 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 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 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 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 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
$RoleArn = "%deployer_arn%" | |
$ExternalId = "%assume_role_external_id%" | |
$Region = "us-east-1" | |
$Response = (Use-STSRole -Region $Region -RoleArn $RoleArn -ExternalId $ExternalId -RoleSessionName "deploy-website-s3-bucket").Credentials | |
$SecretAccessKey = $Response.SecretAccessKey | |
$SessionToken = $Response.SessionToken |
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
def get_orgunits_properties(uc,org_unit_type_id=None,org_unit_code=None,org_unit_name=None,bookmark=None,ver='1.3',**kwargs): | |
""" | |
Custom method hitting Brightspace Valence API. Request to add to service.py in d2lvalence_util submitted; consider removal. | |
""" | |
route = '/d2l/api/lp/{0}/orgstructure/'.format(ver) | |
kwargs.setdefault('params', {}) | |
if org_unit_type_id: | |
kwargs['params'].update({'orgUnitType': org_unit_type_id}) | |
if org_unit_code: | |
kwargs['params'].update({'orgUnitCode': org_unit_code}) |