Skip to content

Instantly share code, notes, and snippets.

View mkhq's full-sized avatar

Mikael Högqvist Tabor mkhq

View GitHub Profile
package test
import akka.remote.{RemoteClient, RemoteNode, RemoteServer}
import akka.actor.{Actor, ActorRef}
import akka.serialization.RemoteActorSerialization
import akka.actor.Actor.actorOf
import org.specs._
import java.util.concurrent.{CountDownLatch, TimeUnit}
test.akka
import akka.actor.Actor
import akka.actor.Actor.actorOf
import org.specs._
object ActorMatchSpec extends Specification {
"actor match" should {
"match non-exhaustive" in {
@mkhq
mkhq / akka remote registered actors talking to each other
Created February 15, 2011 09:59
two remote actors, register one send ping and reply with pong
import akka.remoteinterface.RemoteSupport
import akka.remote.netty.NettyRemoteSupport
import akka.actor.Actor.actorOf
import akka.actor.{Actor}
import org.specs._
import java.util.concurrent.{CountDownLatch, TimeUnit}
object ServiceState {
@mkhq
mkhq / primary.scala
Created April 10, 2013 18:37
Primary election using zookeeper
import com.twitter.zookeeper.ZooKeeperClient
import org.apache.zookeeper.CreateMode
import java.util.UUID
object PrimaryBootstrap {
def main(args:Array[String]) {
val path = args(0)
val zk = new ZooKeeperClient("localhost:2181")
zk.create(path, null, CreateMode.PERSISTENT)
@mkhq
mkhq / kafka
Last active February 6, 2018 11:30 — forked from iandow/kafka
Simple Kafka Ubuntu init.d Startup Script
#!/bin/bash
DAEMON_PATH=/opt/kafka/
PATH=$PATH:$DAEMON_PATH/bin
# See how we were called.
case "$1" in
start)
# Start daemon.
echo "Starting Zookeeper";
@mkhq
mkhq / autopart.sh
Created October 28, 2016 09:56 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}