Sep - 06 2016

Some note for myself to help with searching log file – ill update this as i go Ensure Regular Expression is ticked   to search for 2 string on the same line i use String1(.*)String2 Where (.*) can contain anything   or (?<=String1)(.*)(?=String2) this highlights the text between the 2 strings     search for […]

Jul - 25 2016

kill all UP docker containers docker stop $(docker ps | awk ‘/Up/ { print $1}’) 2>/dev/null || echo ‘There are no running containers!’     remove all Exited Docker images rm $(docker ps -a | awk ‘/Exited/ { print $1}’) 2>/dev/null || echo ‘Nothing to remove’     running in interaction mode – while linking […]

Jul - 15 2016

FSM stands for Finite State Machine. Lets break this down, State : State is a description of the status of a system that is waiting to execute a transition. A transition is a set of actions to be executed when a condition is fulfilled or when an event is received. Its the best way to […]

Jul - 08 2016

Something i often forget about to easily   When we create a Case Class we should valid the field values   case class Person(FirstName: String, LastName: String) { require(!FirstName.isEmpty, “Person.FirstName.empty”) require(FirstName.length < 64, “Person.FirstName.sizeExceeded”) require(FirstName.matches(“^[a-zA-Z](((?!__)[a-zA-Z0-9_])*[a-zA-Z0-9])?$”), “Person.FirstName.mustStartWithLetter”) require(!LastName.isEmpty, “Person.LastName.empty”) require(LastName.length < 64, “Person.LastName.sizeExceeded”) require(LastName.matches(“^[a-zA-Z](((?!__)[a-zA-Z0-9_])*[a-zA-Z0-9])?$”), “Person.LastName.mustStartWithLetter”) }

Jul - 07 2016

Duck Typing is Defined as In duck typing, a programmer is only concerned with ensuring that objects behave as demanded of them in a given context, rather than ensuring that they are of a specific class But its best put “If it looks like a duck and quacks like a duck, it’s a duck” Its […]

Jun - 10 2016

There are a few things to set up correctly to get this working, I’ve spent a long time playing around with monitoring Cassandra and the datadog option seems to be the best approach. The datastax alternative OpsCenter (http://www.datastax.com/products/datastax-enterprise-visual-admin) is very limited by the number of key-spaces you create and can easily halt every node on […]

May - 30 2016

The Aggregator Pattern is pretty useful for adding / removing / tracking akka actors. (kinda like treating an functional array like an array of actors)   Let start with the base code from Akka here. Its not part of the akka library by default https://github.com/akka/akka/blob/master/akka-contrib/src/main/scala/akka/contrib/pattern/Aggregator.scala   Once we import this into our project we can […]

May - 30 2016

package Training import org.scalatest.{Matchers, FlatSpec} object ObjectType { final val Original : String = “Original” final val New : String = “New” } case class OriginalObject( name: String, age: Integer, location : String, ObjectType : String = Training.ObjectType.Original ) case class NewObject( newName: String, newAge: Integer, newLocation : String, ObjectType :String = Training.ObjectType.New ) object […]

May - 19 2016

I think its about time i started jotting down some of the patterns I’m starting to utilise in Scala. For both myself and other s to gain insight from.   Here is something i put together package Training import org.scalatest.{Matchers, FlatSpec} import scala.collection.mutable //Animal Type so we can see waht we have selected in the […]

Aug - 06 2014

No plugin needed   creates a script to see how much data was sent / received over ports in 1 minute in this case ports 7000, 9160, 9042 The script creates a listener, waits for 1 min, prints the results then removes the listeners Need to be super user (“su”) to run change “eth1″ to […]

1 2