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
#!/usr/bin/env python | |
# Usage: | |
# $ scapy_nailgun.py example.pcap | |
# Creating the pcap with tcpdump: | |
# $ tcpdump -w example.pcap -i lo tcp port 8212 | |
# Output format is: | |
# [sender:port | type | length] content | |
# where: | |
# sender - 'C' for client, 'S' for server |
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
implicit object OptionalStringReads extends Reads[Option[String]] { | |
def reads(json: JsValue) = json match { | |
case JsString(s) => JsSuccess(Some(s)) | |
case JsNull => JsSuccess(None) | |
case _ => JsError("error.expected.jsstring") | |
} | |
} |
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 org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ | |
import org.apache.spark.SparkConf | |
import org.yaml.snakeyaml.Yaml | |
import org.yaml.snakeyaml.constructor.Constructor | |
import scala.collection.mutable.ListBuffer | |
import scala.beans.BeanProperty | |
object Main { |
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 scala.concurrent.ExecutionContext.Implicits.global | |
import reactivemongo.bson.BSONObjectID | |
import reactivemongo.bson.BSONDocument | |
import scala.concurrent.Future | |
object Main { | |
def main(args: Array[String]): Unit = { | |
val driver = new reactivemongo.api.MongoDriver | |
val connection = driver.connection(List("localhost")) |