Skip to content

Instantly share code, notes, and snippets.

docker pull postgres:latest
docker run -d --name db postgres:latest
docker build -t web .
docker run -d --name web -p 8000:8000 --link=db:db web:latest python app.py
@jacoelho
jacoelho / docker-example
Created May 20, 2015 05:49
docker-example
docker pull postgres:latest
docker run -d --name db postgres:latest
docker build -t web .
docker run -d --name web -p 8000:8000 --link=db:db web:latest python app.py
#!/bin/bash
echo "nameserver $(boot2docker ip)" | sudo tee /etc/resolver/dev
# Title
---
# Agenda
1. Introduction
2. Deep-dive
3. ...
@jacoelho
jacoelho / circle.yml
Created June 1, 2015 14:34
circle.yml
machine:
ruby:
version: 2.1.5
services:
- docker
dependencies:
override:
- docker info
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
@jacoelho
jacoelho / gist:06536818eae2c49d5434
Created July 17, 2015 09:32
Generate a certificate request
[ req ]
default_bits = 2048
encrypt_key = no
default_md = sha256
prompt = no
utf8 = yes
distinguished_name = my_req_distinguished_name
req_extensions = my_extensions
[ my_req_distinguished_name ]
#!/bin/bash
set -e
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
msg_ok() {
@jacoelho
jacoelho / ami_locator.py
Created September 2, 2015 10:37
ubuntu ami locator
#!/usr/bin/env python3
import requests
import argparse
CLOUD_IMAGES_URL="https://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:aws.json"
def ubuntu_ami(region, version, arch, storage, virt):
req = requests.get(CLOUD_IMAGES_URL)
if req.status_code != 200:
@jacoelho
jacoelho / route.sh
Created September 16, 2015 16:51
docker-machine routing
#!/bin/bash
DOCKER_NETWORK=$(docker-machine ssh dev "ip route show" | awk '/docker0/{print $1}')
DOCKER_HOST=$(docker-machine ip dev)
sudo bash <<EOF
route -n delete "${DOCKER_NETWORK}" "${DOCKER_HOST}" || true
route -n add "${DOCKER_NETWORK}" "${DOCKER_HOST}"
EOF
@jacoelho
jacoelho / golang.sh
Last active February 26, 2020 16:43
Install golang debian/ubuntu
#!/bin/bash
export GOLANG_VERSION=1.10.3
export GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
export GOLANG_DOWNLOAD_SHA256=fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035
apt-get update -qq
apt-get install -y --no-install-recommends \
g++ \