2010-10-26 09:29:04 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
exec scala "$0" "$@"
|
|
|
|
|
!#
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
|
|
|
|
|
*/
|
|
|
|
|
import java.security.{MessageDigest, SecureRandom}
|
|
|
|
|
|
|
|
|
|
lazy val random = SecureRandom.getInstance("SHA1PRNG")
|
|
|
|
|
|
2010-10-26 12:04:32 +02:00
|
|
|
val buffer = Array.fill(32)(0.byteValue)
|
2010-10-26 09:29:04 +02:00
|
|
|
random.nextBytes(buffer)
|
|
|
|
|
|
2010-10-26 12:04:32 +02:00
|
|
|
val digest = MessageDigest.getInstance("SHA1")
|
2010-10-26 09:29:04 +02:00
|
|
|
digest.update(buffer)
|
|
|
|
|
val bytes = digest.digest
|
|
|
|
|
|
|
|
|
|
val sb = new StringBuilder
|
|
|
|
|
val hex = "0123456789ABCDEF"
|
|
|
|
|
bytes.foreach { b =>
|
|
|
|
|
val n = b.asInstanceOf[Int]
|
|
|
|
|
sb.append(hex.charAt((n & 0xF) >> 4)).append(hex.charAt(n & 0xF))
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-26 23:43:16 +02:00
|
|
|
print("""
|
|
|
|
|
# This config imports the Akka reference configuration.
|
|
|
|
|
include "akka-reference.conf"
|
|
|
|
|
|
|
|
|
|
# In this file you can override any option defined in the 'akka-reference.conf' file.
|
|
|
|
|
# Copy in all or parts of the 'akka-reference.conf' file and modify as you please.
|
|
|
|
|
|
|
|
|
|
akka {
|
|
|
|
|
remote {
|
|
|
|
|
secure-cookie = """")
|
|
|
|
|
print(sb.toString)
|
|
|
|
|
print(""""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
""")
|
|
|
|
|
|