Skip to content

Instantly share code, notes, and snippets.

{
"namespace": "com.example.avro",
"type": "record",
"name": "AvroMessage",
"fields": [
{"name": "id", "type": "string"},
{"name": "message", "type": "string"},
{"name": "note", "type": "string"}
]
}
@martinhynar
martinhynar / application.yml
Created November 25, 2020 08:41
micronaut-kafka-simple-producer-consumer
micronaut:
application:
name: micronaut-kafka-simple-producer-consumer
server:
port: 8081
endpoints:
health:
sensitive: false
package main
// http://cr.openjdk.java.net/~ohair/openjdk7/jdk7-build-copyright/webrev/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java-.html
// https://github.com/twitter/commons/blob/master/src/python/twitter/common/java/perfdata/builders/perfdata2.py
import (
"fmt"
"errors"
"io/ioutil"
"encoding/binary"
@martinhynar
martinhynar / zookeeper.service
Created June 2, 2017 10:56
ZooKeeper SystemD Service Unit File
[Unit]
Description=ZooKeeper Service
Documentation=http://zookeeper.apache.org
Requires=network.target
After=network.target
[Service]
Type=forking
User=zookeeper
Group=zookeeper
@martinhynar
martinhynar / dynamic-mapping.json
Created February 8, 2016 09:49
dynamic mapping to discard temporary fields after logstash processing
{
"mappings": {
"logs": {
"dynamic": "false",
"_source": {
"excludes": [
"*_"
]
},
"properties": {
@martinhynar
martinhynar / collectd.conf
Created October 18, 2015 19:09
Quick collect configuration for reading CPU data
Interval 5
Hostname 1.1.1.1
LoadPlugin cpu
LoadPlugin network
<Plugin network>
<Server "localhost" "1984">
</Server>
</Plugin>
@martinhynar
martinhynar / nodes.json
Last active August 29, 2015 14:23
status.json
{
"cluster_name" : "elasticsearch-beta",
"nodes" : {
"y3q_T0UzQ2i_UyVmACqdSg" : {
"name" : "es-data-beta001.dom.example.com",
"transport_address" : "inet[/172.24.249.9:9300]",
"host" : "es-data-beta001",
"ip" : "172.24.249.9",
"version" : "1.5.2",
"build" : "62ff986",
public DefaultHttpClient createHttpClient() throws Exception {
// Some constants
final int timeout = 10000;
final int HTTP_PORT = 80;
final int HTTPS_PORT = 443;
final String HTTPS = "https";
final String HTTP = "http";
String keystoreName = "keystore";
String keystoreType = "JKS";
String keystorePass = "secret";
.idea
.vagrant
@martinhynar
martinhynar / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console