This file contains 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
# /etc/network/interfaces | |
auto lo | |
iface lo inet loopback | |
auto bond0 | |
iface bond0 inet static | |
address 192.168.1.155 | |
netmask 255.255.255.0 | |
gateway 192.168.1.1 |
This file contains 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
load.ivy("org.postgresql" % "postgresql" % "9.4-1206-jdbc4") | |
load.ivy("com.typesafe.slick" %% "slick" % "3.1.1") | |
load.ivy("org.slf4j" % "slf4j-nop" % "1.6.4") | |
import slick.driver.PostgresDriver | |
import slick.driver.PostgresDriver.api._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import slick.jdbc.GetResult._ | |
import scala.concurrent.Future | |
import scala.concurrent.Await |
This file contains 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 | |
echo | |
echo `find . -type f -iname \*.pyc -not -path "./.*"` | |
echo `find . -type d -name __pycache__ -not -path "./.*"` | |
echo | |
read -p "Delete these files (y/n)? " RESP | |
case "$RESP" in | |
y|Y ) find . -type f -iname \*.pyc -not -path "./.*" -delete && find . -type d -name __pycache__ -not -path "./.*" -delete;; | |
n|N ) echo "Exiting without deleting anything.";; | |
* ) echo "invalid";; |
This file contains 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 math | |
x1,y1,z1 = 5.0,6.7,1.5 | |
x2,y2,z2 = 4.0,1.2,1.6 | |
distance = math.sqrt((x2-x1)**2+(y2-y1)**2+(z2 -z1)**2) |