Skip to content

Instantly share code, notes, and snippets.

View viebig's full-sized avatar

Guilherme Viebig viebig

View GitHub Profile
@viebig
viebig / Dockerfile
Created April 4, 2019 21:18
Dockerfile for nodejs 10 with oracle
FROM oraclelinux
RUN yum install -y oracle-nodejs-release-el7 oracle-release-el7 && yum install -y node-oracledb-node10
RUN npm i -g yarn
RUN echo /usr/lib/oracle/18.3/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf
RUN ldconfig
ADD package.json /tmp/package.json
RUN cd /tmp && yarn
@viebig
viebig / shell
Created August 27, 2018 13:32
Amazon AWS AMI Create Swap Space
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 && \
sudo /sbin/mkswap /var/swap.1 && \
sudo chmod 600 /var/swap.1 && \
sudo /sbin/swapon /var/swap.1
@viebig
viebig / dddRegioesBrasil.js
Created October 16, 2017 11:11
DDD Regiões do Brasil
var regions = {
nordeste: [71, 73, 74, 75, 77, 79, 81, 82, 83, 85, 86, 87, 88, 89],
norte: [63, 68, 69, 84, 91, 92, 93, 94, 95, 96, 97, 98, 99],
centroeste: [61, 62, 64, 65, 66, 67],
sul: [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 53, 54, 55],
sudeste: [11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 24, 27, 28, 31, 32, 33, 34, 35, 37, 38]
};
@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 --user=email@gmail.com --password=1! --from-email=email@gmail.com --no-ssl
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 SMTP_USER_NAME=s@gmail.com \
@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}}]"
@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 / 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 / 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 / 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"]