Skip to content

Instantly share code, notes, and snippets.

View viebig's full-sized avatar

Guilherme Viebig viebig

View GitHub Profile
@viebig
viebig / .gitignore
Last active December 16, 2016 20:39
sum12factor .gitignore
.env
@viebig
viebig / .env
Created December 16, 2016 20:41
sum2factor .env
RESTIFY_SEVER_PORT=8080
@viebig
viebig / index.js
Last active December 19, 2016 00:50
sum12factor index.js v3 ses
const restify = require('restify');
const plugins = require('restify-plugins');
const nodemailer = require('nodemailer');
const ses = require('nodemailer-ses-transport');
require('dotenv').config();
const mailerTransport = nodemailer.createTransport(ses({
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
@viebig
viebig / Dockerfile
Created December 18, 2016 20:40
sum12factor Dockerfile
FROM mhart/alpine-node:6
WORKDIR /src
ADD . .
RUN apk add --no-cache make gcc g++ python
RUN npm install
EXPOSE 8080
CMD ["node", "index.js"]
@viebig
viebig / shell.bash
Created December 18, 2016 21:10
sum12factor shell.bash
#!/bin/bash
appname="sum12factor"
run() {
echo "docker run \
--name=$appname \
-p 8080:8080 \
-d \
--restart=unless-stopped $appname"
}
@viebig
viebig / shell.bash
Last active December 19, 2016 00:50
sum12factor shell.bash multiple
#!/bin/bash
appname="sum12factor"
port=8080
run() {
echo "docker run \
-e DOCKER_INSTANCE=$instance \
-e DOCKER_PORT=$port \
--name=$appname$instance \
-p $port:8080 \
@viebig
viebig / index.js
Last active December 19, 2016 00:29
sum12factor indes,js loggly eslintrc
const restify = require('restify');
const plugins = require('restify-plugins');
const nodemailer = require('nodemailer');
const ses = require('nodemailer-ses-transport');
const winston = require('winston');
require('winston-loggly-bulk');
require('dotenv').config();
winston.add(winston.transports.Loggly, {
@viebig
viebig / ModifyDeleteOnTermination.sh
Created April 5, 2017 18:16
Modify Spot Instance "Delete Volume on Termination" flag
aws ec2 modify-instance-attribute --instance-id i-xxxxxxxxxxxxxxx --block-device-mappings "[{\"DeviceName\": \"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":false}}]"
sudo mkdir -p /var/lib/openproject
docker run -d -p 8881:80 \
-e SECRET_KEY_BASE=s \
-e EMAIL_DELIVERY_METHOD=smtp \
-e SMTP_ADDRESS=smtp.sendgrid.net \
-e SMTP_PORT=587 \
-e SMTP_DOMAIN=smtp.gmail.com \
-e SMTP_AUTHENTICATION=plain \
-e SMTP_ENABLE_STARTTLS_AUTO=true \
-e [email protected] \
@viebig
viebig / graylog2-gmail-smtp-config
Created June 30, 2017 18:00
Graylog2 Gmail SMTP Config
sudo graylog-ctl set-email-config smtp.gmail.com --port=587 [email protected] --password=1! [email protected] --no-ssl