Skip to content

Instantly share code, notes, and snippets.

View jdbranham's full-sized avatar
🤓
Coding like a madman

Jeremy jdbranham

🤓
Coding like a madman
View GitHub Profile
@jdbranham
jdbranham / index.md
Created October 27, 2022 03:25
go-lang practices
@jdbranham
jdbranham / Dockerfile
Created September 29, 2022 19:29
Open Telemetry java agent with Kafka
FROM bitnami/kafka:3.2
ENV OLTP_AGENT_URL=https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.18.0/opentelemetry-javaagent.jar
ADD --chown=1001:1001 ${OLTP_AGENT_URL} /opt/bitnami/kafka/libs/opentelemetry-javaagent.jar
-- create a table ready for partitions
CREATE TABLE IF NOT EXISTS public.mytable (
dob date NULL
--other columns...
) PARTITION BY RANGE (dob)
WITH (
OIDS = FALSE
);
@jdbranham
jdbranham / gist:a8aba33153e469101d65665757b0c421
Last active March 10, 2021 06:32
Helpful JVM CLI Commands
# source - https://stackoverflow.com/a/52897164/1308685
# Get total Java memory usage from PS
ps -eo size,pid,user,command --sort -size | egrep -i "*/bin/java *" | egrep -v grep | awk '{ hr=$1/1024 ; printf("%.2f MB ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | cut -d "" -f2 | cut -d "-" -f1
# Get heap size in MB
jstat -gc $(ps axf | egrep -i "*/bin/java *" | egrep -v grep | awk '{print $1}') | tail -n 1 | awk '{split($0,a," "); sum=(a[3]+a[4]+a[6]+a[8]+a[10])/1024; printf("%.2f MB\n",sum)}'
# Print Heap information
jcmd pid GC.heap_info
jcmd pid VM.system_properties
jcmd pid VM.flags
@jdbranham
jdbranham / example-diagram.txt
Created February 20, 2021 17:45
Example remote Grafana Diagram definition
graph LR
A-remote --> B-remote
@jdbranham
jdbranham / 2017-09-28T19_34_50_601Z-debug.log
Created September 28, 2017 19:54
npm debug missing '@' from scoped package path
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'publish' ]
2 info using npm@5.4.2
3 info using node@v6.11.3
4 verbose npm-session d9997f23381beff5
5 verbose publish [ '.' ]
6 info lifecycle @savantly/ngx-menu@1.1.12~prepublish: @savantly/ngx-menu@1.1.12
7 info lifecycle @savantly/ngx-menu@1.1.12~prepare: @savantly/ngx-menu@1.1.12