Skip to content

Instantly share code, notes, and snippets.


Will Sargent wsargent

View GitHub Profile
wsargent / gist:5860224
Created Jun 25, 2013
Using ning async http client
View gist:5860224
import scala.concurrent.{Future, Promise}
import com.ning.http.client._
import com.ning.http.client.{Response => AHCResponse}
import com.ning.http.client.AsyncCompletionHandler
val url = ""
val config = new AsyncHttpClientConfig.Builder()
wsargent / gist:6640993
Created Sep 20, 2013
logging dead letter
View gist:6640993
class DeadLetterLogger extends Actor with ActorLogging {
def receive = {
case DeadLetter(message, sender, recipient) =>"DeadLetter message {}", message)
val deadLetterLogger = system.actorOf(Props(classOf[DeadLetterLogger]))
system.eventStream.subscribe(deadLetterLogger, classOf[DeadLetter])
wsargent /
Last active Oct 10, 2020
Docker cheat sheet
View gist:7906205

Setup vagrant vm

vagrant box add precise64
vagrant init precise64
sed -i '.bak' 's/# :private_network/ :private_network/' Vagrantfile
vagrant up
vagrant ssh

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

View gist:8877238

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(
  "-encoding", "UTF-8",       // yes, this is 2 args

Keybase proof

I hereby claim:

  • I am wsargent on github.
  • I am will_sargent ( on keybase.
  • I have a public key whose fingerprint is CD69 70B7 2D00 E5BE 9A33 0EF3 C1E8 BF06 2BC6 C4B7

To claim this, I am signing this object:

sbt stage || exit 1;
ssh $REMOTE "cd $REMOTE_APP; ./";
rsync -va target/ $REMOTE:$REMOTE_APP/target
ssh $REMOTE "cd $REMOTE_APP; ./";
wsargent / genclient
Last active Oct 23, 2019
Create a working(!) client certificate for use with nginx, using only keytool
View genclient
export PW=`pwgen -Bs 10 1`
echo "$PW" > password
# Create a self signed certificate & private key to create a root certificate authority.
keytool -genkeypair -v \
-alias clientCA \
-keystore client.jks \
wsargent /
Last active Jul 30, 2020
Generate a certificate authority and trust anchor keystore, using only keytool
export PW=`cat password`
# Create a self signed key pair root CA certificate.
keytool -genkeypair -v \
-alias exampleca \
-dname "CN=exampleCA, OU=Example Org, O=Example Company, L=San Francisco, ST=California, C=US" \
-keystore exampleca.jks \
-keypass:env PW \
wsargent /
Last active Aug 29, 2015
Creates a JKS keystore that uses exampleCA as a trust anchor.
export PW=`cat password`
# Create a JKS keystore that trusts the example CA, with the default password.
# This is used by the client.
keytool -import -v \
-alias exampleca \
-file exampleca.crt \
-keypass:env PW \
You can’t perform that action at this time.