Skip to content

Instantly share code, notes, and snippets.

View tombentley's full-sized avatar

Tom Bentley tombentley

View GitHub Profile
#!/usr/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".

Strimzi Quickstart

Getting up and running with a Apache Kafka cluster on Kubernetes and OKD can be very simple, when using the Strimzi project! This quick start guide walks you through a quick and easy install for your development environment, using OKD.

Start OKD

This assumes that you have the latest version of the oc binary, which you can get here.

@tombentley
tombentley / CLI
Last active February 20, 2018 15:49
$ oc create -f ./other-binding.yaml
Error from server: error when creating "./other-binding.yaml": invalid origin role binding strimzi-cluster-controller-binding-other: attempts to reference role in namespace "myproject" instead of current namespace "other"
StatefulSet statefulSet = new StatefulSetBuilder()
.withNewMetadata()
.withName(name)
.withLabels(getLabelsWithName())
.withNamespace(namespace)
.endMetadata()
.withNewSpec()
.withPodManagementPolicy("Parallel")
.withUpdateStrategy(new StatefulSetUpdateStrategyBuilder().withType("OnDelete").build())
.withSelector(new LabelSelectorBuilder().withMatchLabels(getLabelsWithName()).build())
@tombentley
tombentley / kafka-cheat-sheet.md
Created June 14, 2017 10:39 — forked from sahilsk/kafka-cheat-sheet.md
Apache Kafka Cheat Sheet

Kafka Cheat Sheet

Display Topic Information

$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic beacon
Topic:beacon	PartitionCount:6	ReplicationFactor:1	Configs:
	Topic: beacon	Partition: 0	Leader: 1	Replicas: 1	Isr: 1
	Topic: beacon	Partition: 1	Leader: 1	Replicas: 1	Isr: 1
15:40 tom@localhost ~/.../ceylon-lang.org 1.2.2
$ rake setup
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using asciidoctor 1.5.1
Using sass 3.2.19
Using colorize 0.7.3
Using chunky_png 1.3.3
Using fssm 0.2.10
12:05 tom@feist ~/.../ceylon-sdk master
$ ant clean dist ide-quick
Buildfile: /home/tom/ceylon/ceylon-sdk/build.xml
clean:
[delete] Deleting directory /home/tom/ceylon/ceylon-sdk/modules
ceylondefs:
compile-jvm:
MavenArtifactInfo class : org.jboss.shrinkwrap.resolver.impl.maven.MavenArtifactInfoImpl loaded from : file:/home/tom/eclipse-mars-1/plugins/com.redhat.ceylon.maven-support_2.0.0/
java.lang.NoSuchMethodError: org.jboss.shrinkwrap.resolver.api.maven.MavenArtifactInfo.isOptional()Z
at com.redhat.ceylon.cmr.maven.AetherUtils.fetchDependencies(AetherUtils.java:243)
at com.redhat.ceylon.cmr.maven.AetherUtils.findDependencies(AetherUtils.java:176)
at com.redhat.ceylon.cmr.maven.AetherUtils.findDependencies(AetherUtils.java:142)
at com.redhat.ceylon.cmr.maven.AetherRepository.getArtifactResultInternal(AetherRepository.java:95)
at com.redhat.ceylon.cmr.impl.AbstractRepository.getArtifactResult(AbstractRepository.java:125)
at com.redhat.ceylon.cmr.impl.AbstractNodeRepositoryManager.toArtifactResult(AbstractNodeRepositoryManager.java:117)
at com.redhat.ceylon.cmr.impl.RootRepositoryManager.getArtifactResult(RootRepositoryManager.java:108)
at com.redhat.ceylon.cmr.impl.AbstractNodeRepositoryManager.getArtifactRe

TO DO

  • SL = serialization library.
  • SC = SerializationContext
  • DC = DeserializationContext

SerializationContext.getReference()

Add method SerializationContext.getReference(Instance instance) to get the SerializableReference of an already registered instance:

@tombentley
tombentley / TupleBench.ceylon
Created July 15, 2014 10:33
Some benchmark results comparing native Tuple with Ceylon tuple
import java.lang.management{ManagementFactory}
import ceylon.interop.java{CeylonIterable}
import java.lang{Runtime}
import java.util{Arrays}
class BenchmarkResult<out Result>(name, iterations, result, nanoseconds, memory) {
shared String name;
shared Integer iterations;
shared Result result;
shared Integer nanoseconds;