Category Archives: Uncategorized
Apache Zeppelin, with Spark and Cassandra, the perfect tool
Zeppelin has become one of my favourite tools in my toolbox. I am heavily designing stuff for Cassandra and in Scala, and even though I love Cassandra there are times when things just gets so complicated with the CQL command … Continue reading
SQL LIKE operation in Cassandra, is possible in v3.4+
For a long time it has not been possible to do a SELECT * FROM table WHERE firstname like ‘t%’; in Cassandra like you could in eg.. MySQL or any other Relation Database for that matter. In Cassandra v3.4 this … Continue reading
Apache SPARK and Cassandra and SQL
This is a short intro to start using Apache SPARK with Cassandra, running SQL on the Cassandra tables. Note that I am not running a SPARK cluster, I am running “local”, to me this is really convenient, not having to … Continue reading
Create an MBean (JMX) in Scala
Create the MBean like this
1 2 3 4 5 6 7 8 9 10 11 12 13 |
trait OrderTrackerMBean { def getOrderId : Int def setOrderId(orderId:Int) } class OrderTracker extends OrderTrackerMBean { var orderId = 0 override def getOrderId: Int = orderId override def setOrderId(_orderId: Int)= { orderId = _orderId } } |
NOTE, that the interface/trait must end with MBean in the name And this is how you register your MBean
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
package com.tsoft.playingWithLogback import java.lang.management.ManagementFactory import javax.management.{ObjectName, MBeanServer} import org.slf4j.{MarkerFactory, Marker, LoggerFactory} import org.slf4j.MDC import scala.concurrent.{Await, Future} import scala.concurrent.duration._ import scala.concurrent.ExecutionContext.Implicits.global object LotsOfLogOutput { val logger = LoggerFactory.getLogger(this.getClass) val orderTrackerBean = new OrderTracker val mbs:MBeanServer = ManagementFactory.getPlatformMBeanServer(); val mBeanName:ObjectName = new ObjectName("com.tsoft.playingWithLogback:type=Tracking"); mbs.registerMBean( orderTrackerBean, mBeanName); ... |
And the simply launch Java Mission Control (imc), attach to the JVM, and modify … Continue reading
SBT module not found, why ?
I have an build.sbt file that looks like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
name := "TobiasPlayground" version := "1.0" scalaVersion := "2.11.7" scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8") libraryDependencies ++= { val akkaV = "2.3.9" val sprayV = "1.3.3" Seq( "io.spray" %% "spray-client" % sprayV, "io.spray" %% "spray-can" % sprayV, "io.spray" %% "spray-routing" % sprayV, "io.spray" %% "spray-testkit" % sprayV % "test", "com.typesafe.akka" %% "akka-actor" % akkaV, "com.typesafe.akka" %% "akka-testkit" % akkaV % "test", "org.specs2" %% "specs2-core" % "2.3.11" % "test", "org.slf4j" %% "slf4j-api" % "1.7.10" ) } |
But for some reason I can’t get slf4j downloaded from the Maven repository (http://mvnrepository.com) If I search the Maven Repository, I can clearly see that the version I intend to … Continue reading
See who is connected to the same network / WIFI
There are tools out there, such as Angry IP Scanner, iNet or IP Scanner, Â but this can easily be done using a bash script, not as nice looking perhaps but it does the job. The script :
1 2 3 4 5 6 7 8 9 10 |
#!/bin/bash for i in {0..255} do cmd="nslookup 192.168.1." cmd=$cmd$i result=$($cmd|egrep "Address|name") echo "****************" echo $cmd echo $result done |
Which should … Continue reading
Printopia a great AirPrinter server for your USB printer
I have recently starting to use Printopia on my iMac, it makes it possible to use my USB printer connected to my iMac as a AirPrinter, and thus I am able to print from my iPhone or iPad. What a … Continue reading
Me and my son off for a short trip with the bike
This is me and my son taking a ride, we have only been out for a couple of times, but he likes it, and I like it a lot !!!