Skip to content

Instantly share code, notes, and snippets.

View likwid's full-sized avatar

Jeff Gonzalez likwid

View GitHub Profile
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Data;
using System.IO;
using System.Text;
using System.Threading;
using CodeMakerX.DataAbstraction.Evox;
@likwid
likwid / gist:62579c5bac3b25464a182cfc167c05df
Created October 19, 2016 02:18
Nginx stout and stderr
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
- name: Create secrets container
command: >
docker create -v /srv/secrets --name secrets likwid/alpine-ansible bash
sudo: no
when: has_secrets.rc > 0
- name: Inspect secrets container
command: docker inspect secrets
register: secrets_raw_output
@likwid
likwid / base.json
Last active December 16, 2019 22:13
Nomad base, app, deploy merge example
{
"Job": {
"Region": "us-east-1",
"ID": "placeholder",
"Name": "placeholder",
"Type": "service",
"Priority": 50,
"Datacenters": ["us-east-1a", "us-east-1b", "us-east-1c"],
"Constraints": [{
"LTarget": "${attr.kernel.name}",
@likwid
likwid / playground-blue.tmpl
Created September 27, 2016 21:08
Blue / Green Deployment Example
/
testing/
apps/
playground/
deploy/
current => green
services/
playground-green/
app_name => playground
docker_tag => 22222222
const R = require("ramda");
const match = (field, value) => {
const matchContainer = R.objOf("match"),
fieldContainer = R.objOf(field),
matchAndField = R.compose(matchContainer, fieldContainer);
return matchAndField(value);
};
const boolMatch = (field, operator, value) => {
module.exports = (function (R, AWS, Promise) {
const ec2 = new AWS.EC2({region: "us-east-1"}),
iamInstanceProfile = {
IamInstanceProfile: {
Name: "pairing"
}
},
keyName = { KeyName: "infrastructure" },
securityGroups = ["sg-1233456"],
instanceType = { InstanceType: "m4.large" },
@likwid
likwid / .eslintrc
Created July 6, 2016 03:13
jslint compatible eslint profile
module.exports = {
extends: "eslint:recommended",
parserOptions: {ecmaVersion: 6},
env: {
node: true,
es6: true,
mocha: true
},
rules: {
//possible errors
{{- $appKey := printf "prod/services/playground-blue" -}}
{{- $app := key $appKey -}}
{{- $container_count := key_or_default (printf "prod/apps/%s/container_count" $app) "0" -}}
{{- $docker_image := key (printf "prod/apps/%s/docker_image" $app) -}}
{{- $docker_tag := key (printf "prod/apps/%s/docker_tag" $app) -}}
{{- $container_port := key (printf "prod/apps/%s/container_port" $app) -}}
{{- $healthcheck_uri := key (printf "prod/apps/%s/healthcheck_uri" $app) -}}
{{- $cpu := key_or_default (printf "prod/apps/%s/cpu" $app) "500" -}}
{{- $memory := key_or_default (printf "prod/apps/%s/memory" $app) "256" -}}
job "playground-blue" {
job "playground-blue" {
datacenters = ["prod"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
update {
stagger = "10s"
max_parallel = 1