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
IMAGE_URL="httpd:2.4" | |
CPU=256 | |
MEMORY=512 | |
export TASK_DEFINITION=$(cat << EOF | |
{ | |
"containerDefinitions": [ | |
{ | |
"command": [ | |
"/bin/sh -c \"echo '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>Congratulations!</h2> <p>Your application is now running on a container in Amazon ECS.</p> </div></body></html>' > /usr/local/apache2/htdocs/index.html && httpd-foreground\"" |
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
// ==UserScript== | |
// @name Twitter L's | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Replace Twitter Verified badge with a fat L | |
// @author You | |
// @match https://twitter.com/* | |
// @icon | |
// @grant none | |
// ==/UserScript== |
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
apt remove -y amazon-ssm-agent amazon-ecs-init | |
rm -rf /var/lib/amazon/ssm/Vault/Store/RegistrationKey | |
rm -rf /var/lib/ecs/ecs.config | |
rm -rf /etc/ecs/ecs.config | |
rm -rf /var/lib/ecs/data/* |
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
var request = require('request'); | |
var async = require('async'); | |
var faker = require('faker'); | |
var _ = require('lodash'); | |
if (!process.env.PEAK_PERIOD_MINS) { | |
process.env.PEAK_PERIOD_MINS = '30'; | |
} | |
var PEAK_PERIOD_MINS = parseInt(process.env.PEAK_PERIOD_MINS, 10) * 60 * 1000; | |
var MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT, 10) || 100; |
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
// This handler function gets called for each SQS message that arrives in my process | |
mySqsHandler = function(msg) { | |
var self = this; | |
if (!msg.Attributes || !msg.Attributes.AWSTraceHeader) { | |
// This message was not selected for tracing by the sampler in | |
// a higher level service | |
runMySqsLogic(msg, function() { | |
// Noop, no segment to run | |
}); |
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 class Service extends cdk.Construct implements ServiceInterface { | |
public addons: Map<string, ServiceAddon>; | |
protected taskDefinition: ecs.Ec2TaskDefinition; | |
protected service: ecs.Ec2Service; | |
readonly scope: cdk.Stack; | |
readonly id: string; | |
readonly vpc: ec2.Vpc; | |
readonly cluster: ecs.Cluster; | |
constructor(scope: cdk.Stack, id: string, props: ServiceProps) { |
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 dynamoStore = require('dynamodb-datastore'); | |
import cdk = require('@aws-cdk/core'); | |
import lambda = require('@aws-cdk/aws-lambda'); | |
const app = new cdk.App(); | |
class MyStack extends cdk.Stack { | |
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); |
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 AWS = require('aws-sdk'); | |
const ecs_sdk = new AWS.ECS(); | |
function chunk(array: Array<any>, size: number) { | |
const chunked_arr = []; | |
for (let i = 0; i < array.length; i++) { | |
const last = chunked_arr[chunked_arr.length - 1]; | |
if (!last || last.length === size) { | |
chunked_arr.push([array[i]]); | |
} else { |
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 ec2 = require('@aws-cdk/aws-ec2'); | |
import ecs = require('@aws-cdk/aws-ecs'); | |
import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2'); | |
import cdk = require('@aws-cdk/core'); | |
class PublicFargateService extends cdk.Stack { | |
constructor(scope: cdk.App, id: string) { | |
super(scope, id); | |
// Create VPC and Fargate Cluster |
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
TaskDefinition: | |
Type: AWS::ECS::TaskDefinition | |
Properties: | |
Family: nginx-ingress | |
Cpu: 256 | |
Memory: 128 | |
ContainerDefinitions: | |
- Name: nginx | |
Image: public.ecr.aws/nginx/nginx:mainline | |
EntryPoint: |
NewerOlder