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
case class Employee(val age:Int, val tenure:Int, val salary:Int, val name:String) | |
case class Monoid(e:Set[Employee]) { | |
def plus(a:Employee, b:Employee) = { | |
if (a.age > b.age) a else | |
if (b.age > a.age) b else | |
if (a.tenure > b.tenure) a else | |
if (b.tenure > a.tenure) b else | |
if (a.salary > b.salary) a else | |
if (b.salary > b.salary) b else |
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 com.twitter.algebird.Operators._ | |
case class IPRecord(val SRCipAddress: String, val DSTipAddress: String, val number: Int) extends Ordered[IPRecord] { | |
def compare(that: IPRecord): Int = { | |
val c = this.number - that.number | |
if (c == 0) this.DSTipAddress.compareTo(that.DSTipAddress) else c | |
} |
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
object KafkaSpark { | |
def main(args: Array[String]): Unit = { | |
if (args.length < 4) { | |
System.err.println("Usage: KafkaSpark <zkQuorum> <group> <topics> <numThreads>") | |
System.exit(1) | |
} | |
val Array(zkQuorum, group, topics, numThreads) = args |
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 akka.actor.{ Actor, ActorRef, Props, ActorSystem } | |
case class ProcessStringMsg(string: String) | |
case class StringProcessedMsg(words: Integer) | |
class StringCounterActor extends Actor { | |
def receive = { | |
case ProcessStringMsg(string) => { | |
val wordsInLine = string.split(" ").length |
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 the AKKA Actor System | |
import akka.actor.{ Actor, ActorRef, Props, ActorSystem } | |
// create a couple of records for each word and overall counter | |
case class ProcessStringMsg(string: String) | |
case class StringProcessedMsg(words: Integer) | |
// actor returns a count of words in each line | |
class StringCounterActor extends Actor { | |
def receive = { |
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._ | |
object test { | |
def main(args: Array[String]) { | |
val master = "spark://ec2-xx-xx-xxx-xxx.eu-west-1.compute.amazonaws.com:7077" | |
val sparkHome = "/home/ubuntu/spark/" |
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
case class Employee(val age:Int, val tenure:Int, val salary:Int, val name:String) | |
case class Monoid(e:Set[Employee]) { | |
def plus(a:Employee, b:Employee) = { | |
if (a.age > b.age) a else | |
if (b.age > a.age) b else | |
if (a.tenure > b.tenure) a else | |
if (b.tenure > a.tenure) b else | |
if (a.salary > b.salary) a else |
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 io.github.cloudify.scala.aws.kinesis.Client | |
import io.github.cloudify.scala.aws.kinesis.Client.ImplicitExecution._ | |
import io.github.cloudify.scala.aws.kinesis.KinesisDsl._ | |
import io.github.cloudify.scala.aws.auth.CredentialsProvider.DefaultHomePropertiesFile | |
import java.nio.ByteBuffer | |
import scala.concurrent.duration._ | |
import scala.concurrent.{Future, Await} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
// Declare an implicit Kinesis `Client` that will be used to make API calls. |
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 tweepy | |
from py2neo import neo4j | |
consumer_key = "HsYoJ1______Key_Here_______bFh0w" | |
consumer_secret = "k6D4o6fNBy______Key_Here_________PpZ1vFak86A7m4" | |
access_token = "364557525-HwlP7I___________Key_Here______mZw8dBRBmIXMFLgS" | |
access_token_secret = "SF5faO7iNKI_________Key_Here_______p5Aw1304Vbik5D" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) |
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
cmd.exe /c set >> CCSAuditDec2010.txt | |
arp -a >> CCSAuditDec2010.txt | |
netstat -ns >> CCSAuditDec2010.txt | |
net accounts >> CCSAuditDec2010.txt | |
gpresult /V >> CCSAuditDec2010.txt | |
netstat -ano >> CCSAuditDec2010.txt | |
tasklist -svc >> CCSAuditDec2010.txt | |
netstat -ab >> CCSAuditDec2010.txt | |
route print >> CCSAuditDec2010.txt | |
ipconfig /all >> CCSAuditDec2010.txt |