Skip to content

Instantly share code, notes, and snippets.

View jimmidyson's full-sized avatar

Jimmi Dyson jimmidyson

View GitHub Profile
# go test -bench=. -benchmem -benchtime=30s
testing: warning: no tests to run
PASS
BenchmarkSetNs 100000 464509 ns/op 14876 B/op 163 allocs/op
BenchmarkSysFs 100000 459523 ns/op 14735 B/op 157 allocs/op
ok github.com/jimmidyson/benchmark-setns 122.377s
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>json</id>
<phase>generate-resources</phase>
<goals>
<goal>json</goal>
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.12.0</version>
<configuration>
<images>
<image>
<name>${docker.image}</name>
<build>
<from>fabric8/java</from>
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
@ContextName("myCdiRestCamelContext")
public class MyRoutes extends RouteBuilder {
@Override
public void configure() throws Exception {
restConfiguration().component("netty4-http").host("0.0.0.0").port(8080);
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.fabric8.examples</groupId>
<artifactId>camel-rest</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Fabric8 :: Examples :: Camel REST</name>
@jimmidyson
jimmidyson / 0_download_openshift.sh
Last active August 29, 2015 14:21
OpenShift Fabric8 start scripts
#!/bin/bash
curl -L https://github.com/openshift/origin/releases/download/v0.5.1/openshift-origin-v0.5.1-ce1e6c4-linux-amd64.tar.gz | tar xzv
2015-04-17 12:03:50,195 | ERROR | 6b961-1-thread-1 | DeploymentAgent | ? ? | 78 - io.fabric8.fabric-agent - 1.2.0.SNAPSHOT | Unable to update agent
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=fabric-camel-demo; type=karaf.feature; filter:="(&(osgi.identity=fabric-camel-demo)(type=karaf.feature))" [caused by: Unable to resolve fabric-camel-demo/1.2.0.SNAPSHOT: missing requirement [fabric-camel-demo/1.2.0.SNAPSHOT] osgi.identity; osgi.identity=io.fabric8.examples.fabric-camel-demo; type=osgi.bundle; version="[1.2.0.SNAPSHOT,1.2.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve io.fabric8.examples.fabric-camel-demo/1.2.0.SNAPSHOT: missing requirement [io.fabric8.examples.fabric-camel-demo/1.2.0.SNAPSHOT] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.activemq.camel.component)"]]
at org.apache.felix.resolver.Candidates.populateResource(Candida
@jimmidyson
jimmidyson / cluster-service.json
Created April 17, 2015 08:29
Clustering on Kubernetes & OpenShift3 using DNS - cluster service
{
"id": "elasticsearch-cluster",
"apiVersion": "v1beta1",
"PortalIP": "None",
"kind": "Service",
"containerPort": 9300,
"port": 9300,
"selector": {
"component": "elasticsearch"
}
@jimmidyson
jimmidyson / client-service.json
Created April 17, 2015 08:27
Clustering on Kubernetes & OpenShift3 using DNS -
{
"id": "elasticsearch",
"apiVersion": "v1beta1",
"kind": "Service",
"containerPort": 9200,
"port": 9200,
"selector": {
"component": "elasticsearch",
"type": "client"
}
@jimmidyson
jimmidyson / labels.json
Created April 17, 2015 08:26
Clustering on Kubernetes & OpenShift3 using DNS - labels.json
"labels" : {
"component" : "elasticsearch",
"type": "client"
}