🐌 useful scripts for making developer's everyday life easier and happier, involved java, shell etc.
cp-into-docker-run
🗂show-duplicate-java-classes
: ☕️
print_duplicate_classes_info
Have Fun! 💕
2021-4-26
show-duplicate-java-classes
:
show-duplicate-java-classes
:
find-in-jars
:
grep -c
option reduce internal outputshow-busy-java-threads
:
i
to update_round_num
Have Fun! 💕
2021-4-5
show-busy-java-threads
:
update_delay/update_count/pid_list
option value validationshow-duplicate-java-classes
:
-R, --no-find-progress
, do not display responsive find progress 🔇find-in-jars
:
-L, --files-not-contained-found
and -l, --files-contained-found
options-R, --no-find-progress
, do not display responsive find progress 🔇uq
:
-XM, --max-input
⛑show-busy-java-threads
: fix top
extract error by process name 👓
COMMAND
column of top -H
output can be thread name not process nametop
output sample and env info:
$ uname -a
Linux 33e449b39f66 4.19.121-linuxkit #1 SMP Thu Jan 21 15:36:34 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ java -version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04, mixed mode, sharing)
$ top -v
procps-ng 3.3.12
Usage:
top -hv | -bcHiOSs -d secs -n max -u|U user -p pid(s) -o field -w [cols]
$ top -H
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7012 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 java
7014 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.62 GC Thread#0
7015 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 G1 Main Marker
7017 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 G1 Refine#0
7018 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.06 G1 Young RemSet
7019 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.67 VM Thread
7020 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 Reference Handl
7021 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 Finalizer
7022 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 Signal Dispatch
7023 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.34 C2 CompilerThre
7024 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.03 C1 CompilerThre
7025 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 Sweeper thread
7026 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.00 Service Thread
7027 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.26 VM Periodic Tas
7032 jerry 20 0 3492604 79492 27096 S 0.0 3.9 0:00.52 GC Thread#1
...
show-busy-java-threads
:
show-duplicate-java-classes
:
build_index__class_to_class_paths
to 2 small functions:
collect_class_path_to_classes
invert_as_class_to_class_paths
find-in-jars
:
searchJarFiles
functionBash
Traps and Pitfalls:
Have Fun! 💕
2021-4-1
show-duplicate-java-classes
:
-L
/-J
option) 🌀java
9 module-info
files 📦BadZipFile
for jar files 🙅♀️uq
: make it standalone 🧩find-in-jars
: improve output, display responsive message on stderrc
: fix absence of redEcho functionecho-args
: change output colorshow-duplicate-java-classes
tcp-connection-state-counter
MacOS
and multiply linux
distributions in travis-ci 👨🚒Have Fun! 💕
2021-3-25
uq
🦄
https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-uq
show-busy-java-threads
:
set -eEuo pipefail
$*
instead of $@
in stringif-else
instead of &&
/||
$()
instead of ``shUnit2
lib for Unit Test #39 ☂️.gitignore
/.editorconfig
Have Fun! 💕
2021-2-28
Have Fun! 💕 2019-12-02
show-busy-java-threads
find-in-jars
show-busy-java-threads
find-in-jars
Have Fun! 💕 2019-06-01
show-busy-java-threads
:
find-in-jars
:
coat
& a2l
show-busy-java-threads
:
logAndRun
, logAndCat
satisfy condition or die
pattern<()
, improve readability. 😋find-in-jars
:
satisfy condition or die
pattern<()
, improve readability.Have Fun! 💕
2019-01-28
show-busy-java-threads
:
jsvc
to find java process #72 🌀show-busy-java-threads
:
show-busy-java-threads
:
-a
option #70 ☔find-in-jars
:
wc -l
, ensure no extra whitespace for jar file total count.show-busy-java-threads
:
<()
, improve readability. 😋find-in-jars
:
<()
, improve readability.Have Fun! 💕
2018-6-17
show-busy-java-threads
:
top
command to get percent of thread cpu usage 🎩 🎉
you can use -P, --use-ps
option so as to use ps command to find busy thead(cpu usage) instead of top command.-S, --jstack-file-dir
option to specify the dir for storing jstack output files, and keep files. 🛐-d, --top-delay
option to specifies the delay between top samples. 😋xpf/xpl
:
getopt
#66 🍡show-busy-java-threads
:
show-busy-java-threads
:
show-busy-java-threads
:
ARITHMETIC EVALUATION
explicitly instead of -gt
etc 🔢Have Fun! 💕
2018-5-22