Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Cowgill moofish32

View GitHub Profile
View lambda.generated.ts
// Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Generated from the AWS CloudFormation Resource Specification
// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2019-06-17T20:08:49.014Z","fingerprint":"Y9UchU9pctC6/xWTm7rE/XBp8d05mvBX9wvFf2MixrM="}
// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control
import cdk = require('@aws-cdk/cdk');
/**
View kms.generated.ts
// Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Generated from the AWS CloudFormation Resource Specification
// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2019-06-17T20:08:04.438Z","fingerprint":"RRaQrKXriTRnT5GDKdzJRqLngFMESa0HgUFjHJUl2rM="}
// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control
import cdk = require('@aws-cdk/cdk');
/**
@moofish32
moofish32 / ingress-control-check.ts
Created Apr 15, 2019
cdk aspect for checking for an ingress control issue
View ingress-control-check.ts
import cdk = require('@aws-cdk/cdk');
import ec2 = require('@aws-cdk/aws-ec2');
export class IngressControlCheck implements cdk.IAspect {
constructor(private readonly cidr: string, private readonly port: number) { }
public visit(construct: cdk.Construct) {
if (cdk.CfnResource.isCfnResource(construct) && this.isCfnSecurityGroup(construct)) {
this.check(construct);
@moofish32
moofish32 / app-delivery-example.ts
Last active Nov 15, 2018
Simple App Delivery Example
View app-delivery-example.ts
import codebuild = require('@aws-cdk/aws-codebuild');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import s3 = require('@aws-cdk/aws-s3');
import iam = require('@aws-cdk/aws-iam');
import ec2 = require('@aws-cdk/aws-ec2');
import cdk = require('@aws-cdk/cdk');
import cicd = require('@aws-cdk/app-delivery');
const app = new cdk.App();
View cdk-output-import-example.ts
import dyn = require('@aws-cdk/aws-dynamodb');
import cdk = require('@aws-cdk/cdk');
export class DynamoExport extends cdk.Stack {
public readonly tableNameOutput: cdk.Output;
public readonly tableArnOutput: cdk.Output;
constructor(parent: cdk.App, name: string, props?: cdk.StackProps) {
super(parent, name, props);
View gist:db75aa4bb8b3a4cd42839fcb06cc9183
export class Helper {
public help(): string {
return 'your welcome for the help';
}
}
export interface Helpable {
help: Helper;
}
View basic_pidfile.sh
Adding the above rm command to the end of the script will result in cleaning up the PID file after a successful execution. If the script exits any other places this step should be included before the exit command.
Summary of Changes
Now that we have made our changes let's take another look at this script.
#!/bin/bash
PIDFILE=/home/vagrant/forever.pid
if [ -f $PIDFILE ]
then
View keybase.md

Keybase proof

I hereby claim:

  • I am moofish32 on github.
  • I am moofish32 (https://keybase.io/moofish32) on keybase.
  • I have a public key ASBl4zn7ZSZKszjGuc7vW97e0-GlyuUtSmKYUHm49fSTGAo

To claim this, I am signing this object:

View gistpubgpg
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQINBFYwAecBEADa6rlfrN6hLwJXeIjuRGj+E8KknKCIRo6rymlOmh9x9lHCDGPY
OVVzVj/+ETD52ZdPEwg8oQvwmy53dAbQJgVyFnMdE71dkBYrYkKf7HpKf40eu26O
vbx8QC0ZOY52HipwnIm1lgs3lYxo1lXoPNvjFkPkkLgur+Wr59q5rI+cTks9n8Y9
ymHyHgulSyA+RDz/rXeaCt5AiwN5JJHoQgRW/QvsMxmVSOTM0uBMg23P69kr6/Vl
ypW37KkanLTcvDDEfckbeJvrxFAtmUROGCoWwZWSVnFTMRjAxOJSfrUurZp0Af0G
xGhjy9htP5cUgAk1VtSdBS976w0hRz3jM4Ag7U4EPJ5GCNOo3RW7jc5ac5ldpXjW
PhYiM9TO/3uyFTsljz9B/wlgirq5kcWzpCPc8Ker2Pg22yjEZcI1oSXD4aZ98rDG
@moofish32
moofish32 / ubuntu_init.sh
Created Oct 13, 2015
init script for an ubuntu box
View ubuntu_init.sh
fancy_echo() {
printf "\n%b\n" "$1"
}
install_if_needed() {
local package="$1"
if [ $(dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
sudo aptitude install -y "$package";