bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
import spark.streaming.StreamingContext._ | |
import spark.streaming.{Seconds, StreamingContext} | |
import spark.SparkContext._ | |
import spark.storage.StorageLevel | |
import spark.streaming.examples.twitter.TwitterInputDStream | |
import com.twitter.algebird.HyperLogLog._ | |
import com.twitter.algebird._ | |
/** | |
* Example of using HyperLogLog monoid from Twitter's Algebird together with Spark Streaming's |
- name: ensure github.com is a known host | |
lineinfile: | |
dest: /root/.ssh/known_hosts | |
create: yes | |
state: present | |
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}" | |
regexp: "^github\\.com" |
package akkahttptest | |
import akka.actor.ActorSystem | |
import akka.http.Http | |
import akka.stream.FlowMaterializer | |
import akka.http.server._ | |
import akka.http.marshalling.PredefinedToResponseMarshallers._ | |
import akka.stream.scaladsl.{HeadSink, Source} | |
object Proxy extends App { |
val rejectionHandler = RejectionHandler.default | |
def logDuration(inner: Route): Route = { ctx => | |
val start = System.currentTimeMillis() | |
// handling rejections here so that we get proper status codes | |
val innerRejectionsHandled = handleRejections(rejectionHandler)(inner) | |
mapResponse { resp => | |
val d = System.currentTimeMillis() - start | |
logger.info(s"[${resp.status.intValue()}] ${ctx.request.method.name} ${ctx.request.uri} took: ${d}ms") | |
resp | |
}(innerRejectionsHandled)(ctx) |
# From https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH" | |
brew install coreutils | |
brew install gnu-tar --with-default-names | |
# alternatively | |
brew install binutils | |
brew install diffutils |
COPY /docker-entrypoint.sh / | |
COPY /docker-entrypoint.d/* /docker-entrypoint.d/ | |
ONBUILD COPY /docker-entrypoint.d/* /docker-entrypoint.d/ | |
ENTRYPOINT ["/docker-entrypoint.sh", "/opt/puppetlabs/puppet/bin/mcollectived"] | |
CMD ["--no-daemonize"] |
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
# core | |
brew install coreutils | |
# key commands | |
brew install binutils | |
brew install diffutils | |
brew install ed --default-names | |
brew install findutils --with-default-names |
import sangria.ast | |
import sangria.execution.Executor | |
import sangria.marshalling.{InputUnmarshaller, ScalarValueInfo, ArrayMapBuilder, ResultMarshaller} | |
import sangria.schema._ | |
import sangria.validation.{ValueCoercionViolation, IntCoercionViolation, BigIntCoercionViolation} | |
import spray.json._ | |
import sangria.macros._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
implicit object CustomSprayJsonResultMarshaller extends ResultMarshaller { |
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
import java.util.UUID | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.HttpRequest | |
import akka.http.scaladsl.model.headers.{ModeledCustomHeader, ModeledCustomHeaderCompanion} | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.server._ | |
import scala.io.StdIn |