Skip to content

Instantly share code, notes, and snippets.

Mikael Högqvist Tabor mkhq

Block or report user

Report or block mkhq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mkhq
mkhq / autopart.sh
Created Oct 28, 2016 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
View autopart.sh
#!/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>"
}
@mkhq
mkhq / kafka
Last active Feb 6, 2018 — forked from iandow/kafka
Simple Kafka Ubuntu init.d Startup Script
View kafka
#!/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 / primary.scala
Created Apr 10, 2013
Primary election using zookeeper
View primary.scala
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 / akka remote registered actors talking to each other
Created Feb 15, 2011
two remote actors, register one send ping and reply with pong
View akka remote registered actors talking to each other
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 {
View non-exhaustive match in actor
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 {
View akka send actor ref test
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}
You can’t perform that action at this time.