Skip to content

Instantly share code, notes, and snippets.

View wsargent's full-sized avatar

Will Sargent wsargent

View GitHub Profile
@wsargent
wsargent / gist:7906205
Last active December 31, 2015 00:19 — forked from tomdz/gist:5339163

Setup vagrant vm

vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init precise64
sed -i '.bak' 's/# config.vm.network :private_network/config.vm.network :private_network/' Vagrantfile
vagrant up
vagrant ssh

Install base software and apache (to have something to proxy)

Useful Scalac Flags

So, there have been some discussions and angry tweets recently about irritating Scala "features" (like value discarding and auto-tupling) that can actually be turned off by selecting the right compiler flag in conjunction with -Xfatal-warnings. I highly recommend a set of options something like those below.

scalacOptions ++= Seq(
  "-deprecation",           
  "-encoding", "UTF-8",       // yes, this is 2 args
  "-feature",                
 "-language:existentials",
@wsargent
wsargent / deploy.sh
Created April 11, 2014 23:52 — forked from gre/deploy.sh
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
rsync -va target/ $REMOTE:$REMOTE_APP/target
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
fooapp@srv:~$ cat app/env/PLAY_OPTS
export DATABASE_URL="jdbc:postgresql://127.0.0.1/foobar"
# We could wire a different configuration file here
# or set up a different database on the fly
export PLAY_OPTS="-DapplyEvolutions.default=true -DapplyDownEvolutions.default=true -Ddb.default.url="$DATABASE_URL" -Ddb.default.user=fooapp -Ddb.default.password=fooapppw -Ddb.default.driver=org.postgresql.Driver"
@wsargent
wsargent / Scala-Play-App-Docker-Deploy.md
Created July 15, 2016 00:21 — forked from IncludeSecurity/Scala-Play-App-Docker-Deploy.md
Deploying Scala Play Framework Applications on AWS Beanstalk using Docker containers
@wsargent
wsargent / README.md
Created September 8, 2016 00:37 — forked from loicknuchel/README.md
Missing features in Play i18n
@wsargent
wsargent / service-checklist.md
Created September 12, 2016 17:27 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@wsargent
wsargent / doc.md
Created June 8, 2017 20:06 — forked from retronym/doc.md
Scripts for convenient access to Scala pre-release builds
@wsargent
wsargent / Directions for creating PEM files
Created August 1, 2018 18:03 — forked from dain/Directions for creating PEM files
Create Java KeyStore from standard PEM encoded private key and certificate chain files
# To regenerate the test key and certificates
# Generate an RSA private key and convert it to PKCS8 wraped in PEM
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -out rsa.key
# Generate a certificate signing request with the private key
openssl req -new -key rsa.key -out rsa.csr
# Sign request with private key
openssl x509 -req -days 10000 -in rsa.csr -signkey rsa.key -out rsa.crt