Skip to content

Instantly share code, notes, and snippets.

View rhuss's full-sized avatar

Roland Huß rhuss

View GitHub Profile
@rhuss
rhuss / ruler-issue.html
Created June 26, 2012 06:57
Ruler issue with Cubism 1.2.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css" media="all">
@import url("http://square.github.com/cubism/style.css");
</style>
<script type="text/javascript" src="http://square.github.com/cubism/d3.v2.js"></script>
<script type="text/javascript" src="http://square.github.com/cubism/cubism.v1.js"></script>
</head>
<body>
@rhuss
rhuss / jolokia-cors.md
Last active October 10, 2018 10:24
Jolokia and CORS

Jolokia and CORS

[Jolokia][1] has configurable [CORS][2] support so that it plays nicely together with the Browser world when it comes to cross origin requests. However, Jolokia’s CORS support is not without gotchas. This gist explains how Jolokias CORS supports works, what are the issues and how I plan to solve them.

tldr; Jolokia CORS support is configured via jolokia-access.xml but has issues with authenticated requests which are tackled for the next release 1.3.0

CORS Primer

[CORS][3] (Cross Origin Resource Sharing) is a specification for browsers to allow controlled access for JavaScript code to locations which are different than the origin of the JavaScript code itself.

@rhuss
rhuss / docker-enter.sh
Last active August 29, 2015 14:05
nsenter with boot2docker
#!/bin/sh
usage ()
{
cat <<EOF
docker-enter -- Enter a running container via boot2docker and nsenter
Usage: docker-enter <container_name_or_ID> [command]
See https://github.com/jpetazzo/nsenter for details.
@rhuss
rhuss / Jolokia (Data Image).xml
Last active August 29, 2015 14:05
docker-maven-plugin configuration Samples
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<image>
<id>tomcat</id>
<name>consol/tomcat-7.0</name>
<run>
@rhuss
rhuss / gist:a83633c512fe0d0f1f2c
Created May 5, 2015 10:10
Debug output for "jmx4perl tomcat exec jolokia:type=Config debugInfo"
1430820552: Execution time: 1 ms
1430820552: Response: {"timestamp":1430820552,"status":200,"request":{"mbean":"java.lang:type=Runtime","attribute":"Name","type":"read"},"value":"11257@Tichny.local"}
1430820552: Execution time: 0 ms
1430820552: Response: {"timestamp":1430820552,"status":200,"request":{"mbean":"java.lang:type=Runtime","attribute":"VmVersion","type":"read"},"value":"24.75-b04"}
1430820552: Execution time: 0 ms
1430820552: Response: {"timestamp":1430820552,"status":200,"request":{"mbean":"java.lang:type=Runtime","attribute":"VmName","type":"read"},"value":"Java HotSpot(TM) 64-Bit Server VM"}
1430820552: Execution time: 0 ms
1430820552: Response: {"timestamp":1430820552,"status":200,"request":{"mbean":"java.lang:type=Runtime","attribute":"VmVendor","type":"read"},"value":"Oracle Corporation"}
1430820552: Execution time: 0 ms
1430820552: Response: {"timestamp":1430820552,"status":200,"request":{"mbean":"java.lang:type=Runtime","attribute":"Uptime","type":"read"},"value":98185}
@rhuss
rhuss / gist:b0e1884c990a8351d3e9
Last active August 29, 2015 14:21
Docker-Hammering

With an empty OpenShift 0.5.1 started up (except for some services) within a Vagrant setup, I noticed, that /var/log/messages grows very fast because of the requests logged below. I could (and have) set the loglevel to WARN but this doesn't solve the issue of many requests needs to be processed by the Docker daemon which leads to a constant CPU usage of about 4-5%. I wonder where these requests for container meta information comes from and why they are sent in such a high frequency (look at the timestamps).

May 21 13:06:52 localhost journal: Suppressed 741 messages from /system.slice/docker.service
May 21 13:06:52 localhost docker: time="2015-05-21T13:06:52Z" level=info msg="GET /containers/json"
May 21 13:06:52 localhost docker: time="2015-05-21T13:06:52Z" level=info msg="+job containers()"
May 21 13:06:52 localhost docker: time="2015-05-21T13:06:52Z" level=info msg="-job containers() = OK (0)"
May 21 13:06:52 localhost docker: time="2015-05-21T13:06:52Z" level=info msg="GET /containers/json?all=1"
@rhuss
rhuss / alpine-jre-8
Last active January 3, 2021 13:03
The Holy Grail of a Minimal, Headless, OpenJDK JRE 8
# Build for 206 MB JRE 1.8.0_60 (192 MB in size) with Alping and glibc
FROM alpine:3.2
ENV JRE=jre1.8.0_60 \
JAVA_HOME=/opt/jre
# That's the an EA from OpenJDK.net
# Courtesy to https://github.com/frol/docker-alpine-oraclejdk8 from where the setup of glibc is borrowed
@rhuss
rhuss / execute_groovy_jenkins_sample.groovy
Last active August 12, 2020 19:09
How to execute some shell scripting on Groovy with environment variables and redirection
def exec(cmd) {
println cmd
def process = new ProcessBuilder([ "sh", "-c", cmd])
.directory(new File("/tmp"))
.redirectErrorStream(true)
.start()
process.outputStream.close()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()
brew install libvirt
sudo ln -s /opt/vagrant/embedded/include/ruby-2.0.0/{universal-darwin12.6.0,x86_64-darwin12.6.0}
ARCHFLAGS='-arch x86_64' \
CONFIGURE_ARGS="with-libvirt-include=/usr/local/include/libvirt:/opt/vagrant/embedded//include/ruby-2.0.0/universal-darwin12.6.0/ with-libvirt-lib=/usr/local/lib" \
vagrant plugin install vagrant-libvirt

gofabric8 IDE setup for IntelliJ IDEA

In Shell:

  • export $GOPATH=~/go/workspace
  • mkdir -p $GOPATH
  • export PATH=$PATH:$GOPATH/bin
  • cd ~/go
  • rm -rf workspace/*
  • go get github.com/tools/godep