Skip to content

Instantly share code, notes, and snippets.

View dbathily's full-sized avatar

Didier Bathily dbathily

View GitHub Profile
#!/bin/bash
#
# =========================================================================
# Copyright 2014 Rado Buransky, Dominion Marine Media
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

package controllers
import lib._
import play.api.mvc._
import play.api.libs.json._
object Auth extends Controller {
val GITHUB = new OAuth2[GithubUser](OAuth2Settings(
package filters
import play.api.mvc._
import controllers.Default
import play.api.libs.iteratee.Enumerator
import play.Logger
object CorsFilter extends Filter {
@dbathily
dbathily / debug.sh
Created August 14, 2013 20:50
Print debug information only if debug flag is set.
function debug() {
if [[ $DEBUG ]]
then
echo ">>> $*"
fi
}
# For any debug message
debug "Trying to find config file"
@dbathily
dbathily / color.sh
Created August 14, 2013 20:49
Colors your echo
NORMAL=$(tput sgr0)
GREEN=$(tput setaf 2; tput bold)
YELLOW=$(tput setaf 3)
RED=$(tput setaf 1)
function red() {
echo -e "$RED$*$NORMAL"
}
function green() {
@dbathily
dbathily / gist:6098427
Created July 28, 2013 12:34
packer AMI policy
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:AuthorizeSecurityGroupEgress",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateImage",
"ec2:CreateKeyPair",
"ec2:CreateSecurityGroup",
@dbathily
dbathily / Build.scala
Created July 23, 2013 22:24
Upload play framework 2 build to amazon s3
import sbt._
import Keys._
import play.Project._
import com.typesafe.sbt.S3Plugin._
import S3._
object ApplicationBuild extends Build {
val appName = "sample"
val appVersion = "1.0-SNAPSHOT"
@dbathily
dbathily / gist:6063435
Created July 23, 2013 15:43
cicrle ci playframework 2 sample
machine:
timezone:
UTC
environment:
PLAY_VERSION: 2.1.2
PLAY_HOME: play-$PLAY_VERSION
dependencies:
pre:
- if [[ ! -e $PLAY_HOME ]]; then curl -k -L -o $PLAY_HOME.zip http://downloads.typesafe.com/play/$PLAY_VERSION/play-$PLAY_VERSION.zip && unzip -q $PLAY_HOME.zip; fi
@dbathily
dbathily / gist:6063392
Last active December 20, 2015 03:28
travis playframework 2 sample
language: scala # to trigger the build on JVM worker ('language: java' works the same)
env:
- PLAY_VERSION=2.1-RC2 # Latest 2.1.x
before_script:
- wget http://downloads.typesafe.com/play/${PLAY_VERSION}/play-${PLAY_VERSION}.zip
- unzip -q play-${PLAY_VERSION}.zip
script: play-${PLAY_VERSION}/play test
notifications:
# Email notifications are disabled to not annoy anybody.
# See http://about.travis-ci.org/docs/user/build-configuration/ to learn more