Skip to content

Instantly share code, notes, and snippets.

@vishiy
vishiy / AzureMonitorContainers-Metrics-Loganalytics.csv
Last active July 3, 2024 22:49
Gist for metrics collected by Azure monitor for containers
MetricCategory MetricName MetricDimensions MetricType MetricTable MetricNamespace MetricOrigin Comments
Node-CPU cpuAllocatableNanoCores Objectname='K8SNode', Instancename=<nodename> Gauge Perf Amount of cpu that is allocatable by Kubernetes to run pods, expressed in nanocores/nanocpu unit
Node-CPU cpuCapacityNanocores Objectname='K8SNode', Instancename=<nodename> Gauge Perf Total CPU capacity of the node in nanocore/nanocpu unit
Node-CPU cpuUsageNanocores Objectname='K8SNode', Instancename=<nodename> Gauge Perf CPU used by node in nanocore/nanocpu unit
Node-Memory memoryAllocatableBytes Objectname='K8SNode', Instancename=<nodename> Gauge Perf Amount of memory in bytes that is allocatable by kubernetes to run pods
Node-Memory memoryCapacityBytes Objectname='K8SNode', Instancename=<nodename> Gauge Perf Total memory capacity of the node in bytes
Node-Memory memoryRssBytes Objectname='K8SNode', Instancename=<nodename> Gauge Perf Rss memory used by the node in bytes. Collected only for L

Maven Archetypes

Choose archetype:
1: remote -> am.ik.archetype:elm-spring-boot-blank-archetype (Blank multi project for Spring Boot + Elm)
2: remote -> am.ik.archetype:graalvm-blank-archetype (Blank project for GraalVM)
3: remote -> am.ik.archetype:graalvm-springmvc-blank-archetype (Blank project for GraalVM + Spring MVC)
4: remote -> am.ik.archetype:graalvm-springwebflux-blank-archetype (Blank project for GraalVM + Spring MVC)
5: remote -> am.ik.archetype:maven-reactjs-blank-archetype (Blank Project for React.js)
6: remote -> am.ik.archetype:msgpack-rpc-jersey-blank-archetype (Blank Project for Spring Boot + Jersey)
@gatanaso
gatanaso / http-client.jsh
Created May 13, 2020 07:59
JShell http client example
import java.net.http.*;
var client = HttpClient.newHttpClient();
var uri = new URI("https://riimusolutions.com");
var request = HttpRequest.newBuilder().uri(uri).build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
/exit
@soberich
soberich / ZipUtils.java
Last active April 17, 2025 17:16
Java 7 NIO2 Download ZIP from URL and Unzip, select/filter entries [and decrypt! if needed] **on the fly** with Channels (WITHOUT CREATING INTIMIDATE COPY OF DATA BYTES)
package com.example;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.zip.ZipEntry;
@guycalledseven
guycalledseven / manual-uninstall-parallels.sh
Last active March 4, 2025 06:08
Manually remove Parallels Desktop v15 leftovers MacOS
# used different forum posts/guides to figure this out like:
# The uninstall script is located at /Library/Parallels/Parallels Service.app/Contents/Resources
# https://github.com/danijeljw/remparallels/blob/master/remprls.sh
# https://kb.parallels.com/122461
# sudo find / -iname "*parallels*"
# sudo find / -iname "*prl*"
#before uninstalling deactivate your licencse - this won't be possible after uninstall
prlsrvctl deactivate-license
@calexandre
calexandre / merge-zsh-history.sh
Last active April 28, 2025 02:39
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1
@SergejIsbrecht
SergejIsbrecht / enumset
Last active September 6, 2020 22:18
EnumSet
sergej@sergej-P50:~/Development/IdeaProjects/playground$ /home/sergej/.sdkman/candidates/java/13.0.1.hs-adpt/bin/java -version
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)
sergej@sergej-P50:~/Development/IdeaProjects/playground$ uname -a
Linux sergej-P50 4.18.0-25-generic #26-Ubuntu SMP Mon Jun 24 09:32:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
jol >> java.util.RegularEnumSet, size=1584
jol >> org.eclipse.collections.impl.set.mutable.UnifiedSet, size=976
@devops-school
devops-school / maven-proxy-internet1
Created February 18, 2020 14:04
Working with Internet Proxy for Maven
$ $ mvn archetype:generate -DgroupId=com.benz.software -DartifactId=chat -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DproxySet=true -DproxyHost=53.244.194.32 -DproxyPort=3128 -DproxyUsername=<USER> -DproxyPassword=<PASSWOR
$ mvn clean package -DproxySet=true -DproxyHost=53.244.194.32 -DproxyPort=3128 -DproxyUsername=<USER> -DproxyPassword=<PASSWORD>
$ mvn [COMMAND] -Dhttp.proxyHost=[PROXY_SERVER] -Dhttp.proxyPort=[PROXY_PORT] -Dhttp.nonProxyHosts=[PROXY_BYPASS_IP]
$ mvn install -Dhttp.proxyHost=10.10.0.100 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.0.0.1
# You can create alias for convenient uses:
$ alias proxy-mvn=”mvn -Dhttp.proxyHost=SERVER -Dhttp.proxyPort=PORT -Dhttp.nonProxyHosts=BYPASS_PROXY_IPS
@mjameswh
mjameswh / rename_es_index.sh
Last active August 18, 2023 20:59
Demonstration of how to rename an ElasticSearch index using the Index Clone API, introduced in ES 7.4. This is the cUrl based version. See here for details: https://stackoverflow.com/a/59397746/2887657 .
source_index=source_index
target_index=target_index
elastic_search_server=elasticsearch:9200
# Make sure the source index is actually open
curl -X POST "${elastic_search_server}/${source_index}/_open"
# Put the source index in read-only mode
curl -X PUT "${elastic_search_server}/${source_index}/_settings" \
@paulscott
paulscott / git-lfs-candidates
Created December 6, 2019 23:05
A script to find files that aren't under git-lfs, but should be
#!/bin/bash
if [ "$#" != "1" ]; then
echo "$0 requires a size argument. ex: 100k."
exit 1
fi
sizeParam="+${1}"
filesOverSize=$( find . -size ${sizeParam} | grep -v /.git | sed 's/^.\///g' )