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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 bash | |
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts] | |
where: | |
region - the AWS region | |
stack-name - the stack name | |
aws-cli-opts - extra options passed directly to create-stack/update-stack | |
" |
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
'Update or create a stack given a name and template + params' | |
from __future__ import division, print_function, unicode_literals | |
from datetime import datetime | |
import logging | |
import json | |
import sys | |
import boto3 | |
import botocore |
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: | |
########### | |
KeyName: | |
Description: The EC2 Key Pair to allow SSH access to the instance | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
AvailabilityZone: | |
Description: Availability zone to deploy |
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
// /stacks/cicd-pipelines.ts | |
// CDK app which creates a stack using a set of service definitions | |
import 'source-map-support/register'; | |
import { App } from '@aws-cdk/cdk'; | |
import { ServiceCicdPipelines } from '../lib/cicd/pipelines'; | |
import { deploymentTargetAccounts } from './config'; | |
import services from './services'; | |
const app = new App({ |