Skip to content

Instantly share code, notes, and snippets.

CollectorRegistry collectorRegistry = new CollectorRegistry();
PrometheusMeterRegistry micrometerRegistry =
new PrometheusMeterRegistry(PrometheusConfig.DEFAULT, collectorRegistry, Clock.SYSTEM);
micrometerRegistry
.config()
.commonTags()
.commonTags(
"application",
metadata.getName(),
"env",
@rondinif
rondinif / check-java12-env
Created April 14, 2019 11:30
command line setup of [ openjdk version "12" ] on [ Mac OS X 10.14.3 ]
$ java -XshowSettings -version
Picked up JAVA_TOOL_OPTIONS: -Duser.country=US -Duser.language=en
VM settings:
Max. Heap Size (Estimated): 4.00G
Using VM: OpenJDK 64-Bit Server VM
Property settings:
awt.toolkit = sun.lwawt.macosx.LWCToolkit
file.encoding = UTF-8
file.separator = /
@ricardozanini
ricardozanini / how-to-install-graalvm-linux.md
Last active February 22, 2024 20:59
How to install GraalVM on Linux with alternatives

How to Install GraalVM Community Edition on Linux

Note: Tested on Fedora only

  1. Download the new release of GraalVM and unpack it anywhere in your filesystem:
$ tar -xvzf graalvm-ce-1.0.0-rc14-linux-amd64.tar.gz
@rondinif
rondinif / command-line-slim-setup-osx-10_13_6-high-sierra.md
Last active October 14, 2018 01:16
Install Slim Framework with the Composer dependency manager on native macOS.
# see: https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html
LOGLEVELS = %w[DEBUG INFO WARN ERROR FATAL UNKNOWN].freeze
LOGGER = Logger.new(STDOUT)
level ||= LOGLEVELS.index ENV.fetch("LOG_LEVEL","WARN") # default to WARN index: 2
level ||= Logger::WARN # FIX default in case of environment LOG_LEVEL value is present but not correct
LOGGER.level = level
# Usage:
# before launching the program:
# $ export LOG_LEVEL=DEBUG
# .1: GET API SERVERS
$ oc config view | grep server
server: https://127.0.0.1:8443
server: https://192.168.65.2:8443
server: https://192.168.99.100:8443
server: https://api.starter-us-east-1.openshift.com:443
$ oc config view | grep server | cut -f 2- -d ":"
https://127.0.0.1:8443
https://192.168.65.2:8443
@twmbx
twmbx / vanilla-ajax-poll.js
Last active February 6, 2023 14:57
Polling in JS with an async ajax call that returns a promise ( modified from: https://davidwalsh.name/javascript-polling )
// The polling function
function poll(fn, timeout, interval) {
var endTime = Number(new Date()) + (timeout || 2000);
interval = interval || 100;
var checkCondition = function(resolve, reject) {
var ajax = fn();
// dive into the ajax promise
ajax.then( function(response){
// If the condition is met, we're done!
@ricardozanini
ricardozanini / change-soapui-workspacedir.md
Last active October 25, 2023 12:42
How to set the default workspace dir for SoapUI

How to set the default workspace dir for SoapUI

  1. Locate the SoapUI installation dir
  2. Edit the SoapUI-X.X.X.vmoptions (X.X.X is the SoapUI version) and add the -Duser.home=<YOUR_NEW_WORKSPACE_DIR>.
  3. Restart SoapUI
  4. Done
@nmarley
nmarley / curl-websocket.sh
Created September 8, 2017 09:50 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@1kastner
1kastner / reflect.py
Last active April 3, 2024 13:52 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):