This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u postgres psql postgres | |
postgres=# \password postgres | |
Enter new password: (enter your password) | |
Enter it again: (re-enter your password) | |
postgres=# (press control+d to exit postgres) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u postgres createuser -D -A -P my_db_user | |
sudo -u postgres createdb -O my_db_user my_db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you have to run this after every reboot (route is not persistent) | |
# 2 lines added below; deduct if more needed... | |
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to me 80 | |
sudo ipfw add 101 fwd 127.0.0.1,8443 tcp from any to me 443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client | |
dev tun | |
proto udp | |
remote [server name/address] 1194 | |
resolv-retry infinite | |
nobind | |
reneg-sec 3600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SBT_VERSION="0.12.4" | |
BUILD_VERSION="0.1.0-SNAPSHOT" | |
BUILD_SCALA_VERSION="2.10.2" | |
BUILD_JVM_VERSION="1.7" | |
function doIt() { | |
NAME=$1 | |
ORGANIZATION=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.libs.json._ | |
import play.api.libs.functional.syntax._ | |
case class User(id: Int, name: String, partner: Option[String]) | |
// Json format without null | |
val userReads: Reads[User] = ( | |
(JsPath \ "id").read[Int] and | |
(JsPath \ "name").read[String] and | |
(JsPath \ "partner").readNullable[String] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am pjan on github. | |
* I am pjan (https://keybase.io/pjan) on keybase. | |
* I have a public key whose fingerprint is ACFB 2F34 1D70 9617 496F C3E0 8A96 A1C9 3CA1 3DF6 | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install docker (bootstrap) | |
curl -sSL https://get.docker.io/ubuntu/ | sudo sh | |
# add current user to docker group | |
sudo gpasswd -a ${USER} docker | |
# restart the docker daemon | |
sudo service docker restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def safeEquals(a: String, b: String) = { | |
val a_bytes = a.getBytes | |
val b_bytes = b.getBytes | |
if (a_bytes.length != b_bytes.length) { | |
false | |
} | |
else { | |
a_bytes.zip(b_bytes).foldLeft(0){ (acc, t) => acc + (t._1 ^ t._2) } == 0 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>For Topre REALFORCE 87 Users</name> | |
<devicevendordef> | |
<vendorname>TopreCorporation</vendorname> | |
<vendorid>0x0853</vendorid> | |
</devicevendordef> | |
<item> |
OlderNewer