Skip to content

Instantly share code, notes, and snippets.

@buuhsmead
buuhsmead / create-brokers.sh
Created September 11, 2022 18:55
Red Hat AMQ Broker 2 times Master/Slave
#!/usr/bin/env bash
AMQ_BASE=$HOME/repo/amq/download/7.9/amq-broker-7.9.3
AMQ_DIR=$HOME/repo/amq/download/7.9/brokers
AMQ_SEQ=0
AQM_DATA=east
@buuhsmead
buuhsmead / LowLevelKafkaConsumerTest.java
Created March 7, 2022 09:20
Direct low level Kafka consumer test
package com.github.buuhsmead.quarkus.messaging.quickstarts;
import io.quarkus.test.junit.QuarkusTest;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Properties;
@buuhsmead
buuhsmead / my-prometheus-config.yaml
Last active August 28, 2020 21:08
jmx-exporter for Red Hat Fuse 7.7 with added RouteState and ContextState
startDelaySecs: 5
ssl: false
blacklistObjectNames: ["java.lang:*"]
rules:
# Context level
- pattern: 'org.apache.camel<context=([^,]+), type=context, name="([^"]+)"><>ExchangesCompleted'
name: org.apache.camel.ExchangesCompleted
help: Exchanges Completed
type: COUNTER
labels:
@buuhsmead
buuhsmead / prometheus-blackbox-job.yaml
Last active August 26, 2020 11:06
prometheus job with blackbox-exporter to scrape
- job_name: 'blackbox-scrape'
metrics_path: /probe # is the endpoint of blackbox-exporter itself
params:
module: ['tcp_connect'] # a module defined in blackbox-config.yaml inside blackbox image
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- '${NAMESPACE}'
relabel_configs: # not correct at this moment WIP
@buuhsmead
buuhsmead / gist:af430090084d4ffdda5985f12f1e340c
Created March 28, 2020 11:36
webhook_config for watchdog from alertmanager
(openshift 4.3)
To configure a webhook_config for Watchdog of Alertmanager we have to adjust the secret alertmanager.yml.
# oc -n openshift-monitoring get secret alertmanager-main --template='{{ index .data "alertmanager.yaml" }}' | base64 -d > alertmanager.yaml
And then change alertmanager.yml into
global:
resolve_timeout: 5m
route:
@buuhsmead
buuhsmead / gist:d8e7b17ddc3c8168dea0383a5a7b309d
Created August 21, 2019 15:09
camel cm:property-placeholder
<cm:property-placeholder id="myblueprint.placeholder" persistent-id="camel.blueprint" >
<cm:default-properties>
<cm:property name="sleutel" value="env:waarden:geen_waarde" />
</cm:default-properties>
</cm:property-placeholder>
....
@buuhsmead
buuhsmead / pidport.sh
Created July 25, 2019 07:44
OSX PID and PORT of process
#!/usr/bin/env bash
sudo lsof -Pnl +M -i4 -i6
@buuhsmead
buuhsmead / gist:5ee868013b3919aa3adbee787ab8485d
Last active March 23, 2019 09:52
linux disk speed test
Disk WRITE speed test
sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
Disk READ speed test
dd if=tempfile of=/dev/null bs=1M count=1024
Just use it often on different machines to get a feeling of speed.
@buuhsmead
buuhsmead / thread-local-utc-date-format.clj
Last active May 15, 2016 18:58
clojure rfc3339 simple date format
(def ^:private thread-local-utc-date-format
;; SimpleDateFormat is not thread-safe, so we use a ThreadLocal proxy for access.
;; http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4228335
(proxy [ThreadLocal] []
(initialValue []
(doto (java.text.SimpleDateFormat. "yyyy-MM-dd'T'HH:mm:ss.SSS-00:00")
;; RFC3339 says to use -00:00 when the timezone is unknown (+00:00 implies a known GMT)
(.setTimeZone (java.util.TimeZone/getTimeZone "GMT"))))))
(defn write-date
@buuhsmead
buuhsmead / parms.py
Last active April 22, 2016 06:36
ptyhon command line parms
#!/usr/bin/python
import sys, getopt
print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)
def usage(msg=None):
if msg: