Releases: oldratlee/useful-scripts
Releases · oldratlee/useful-scripts
v2.4.0 🗂☕️
New Features
- add
cp-into-docker-run
🗂
Improvements
show-duplicate-java-classes
: ☕️- improve jar in jar index marker
- improve sort logic in
print_duplicate_classes_info
Have Fun! 💕
2021-4-26
v2.3.1 🎱📶📚
New Features
- add version option for scripts #73 🎱
show-duplicate-java-classes
:- show duplicate class paths total count 🔢
- output class path index
Improvements
show-duplicate-java-classes
:- improve output sort 📶
- sort by multiple keys:
- class paths count, descending
- duplicate classes count, descending
- class paths, ascending
- sort also ensure output consistent for same input.
- sort by multiple keys:
- improve output sort 📶
find-in-jars
:- performance improvement, use
grep -c
option reduce internal output
- performance improvement, use
show-busy-java-threads
:- rename
i
toupdate_round_num
- rename
- improve help and docs 📚
- code refactor/cleanup
Have Fun! 💕
2021-4-5
v2.3.0 📭⛑🛎
New Features
show-busy-java-threads
:- add "No java process found" check, output in error message 📭
- add
update_delay/update_count/pid_list
option value validation
show-duplicate-java-classes
:- show duplicate classes total count 🔢
- output responsive progress info at console 🛎
- add option
-R, --no-find-progress
, do not display responsive find progress 🔇 - validate lib/class dir
find-in-jars
:- add
-L, --files-not-contained-found
and-l, --files-contained-found
options - add option
-R, --no-find-progress
, do not display responsive find progress 🔇
- add
uq
:- add max input defensive check option
-XM, --max-input
⛑
- add max input defensive check option
BugFix
show-busy-java-threads
: fixtop
extract error by process name 👓COMMAND
column oftop -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 ...
Improvements
show-busy-java-threads
:- improve self rerun command line in output
show-duplicate-java-classes
:- refactor: split function
build_index__class_to_class_paths
to 2 small functions:collect_class_path_to_classes
invert_as_class_to_class_paths
- refactor: split function
find-in-jars
:- improve responsive output, output jars searching message 👓
- extract
searchJarFiles
function
- fix
Bash
Traps and Pitfalls:- DO NOT combine var declaration and assignment which value supplied by sub-shell!
- improve help and docs
- code refactor/cleanup
Have Fun! 💕
2021-4-1
v2.2.0 🌀📦👓
New Features
show-duplicate-java-classes
:- support find jar files in lib sub-dir and jar file recursively(add
-L
/-J
option) 🌀 - skip
java
9module-info
files 📦 - ignore
BadZipFile
for jar files 🙅♀️
- support find jar files in lib sub-dir and jar file recursively(add
Improvements
uq
: make it standalone 🧩find-in-jars
: improve output, display responsive message on stderrc
: fix absence of redEcho functionecho-args
: change output color- improve output format, more human readable 👓
show-duplicate-java-classes
tcp-connection-state-counter
- add
MacOS
and multiplylinux
distributions in travis-ci 👨🚒 - fix typo in document: buildin -> builtin
Have Fun! 💕
2021-3-25
v2.1.0 🦄👨🚒
New Features
- add new script
uq
🦄
https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-uq show-busy-java-threads
:- support: set count 0 to show all threads
Improvements
- bash strict mode ⛑
- use
set -eEuo pipefail
- use
$*
instead of$@
in string - use
if-else
instead of&&
/||
- use
$()
instead of ``
- use
- add travis-ci 👨🚒
- add/use
shUnit2
lib for Unit Test #39 ☂️ - improve multiply var declaration/read
- read multiply var instead array
- simplify the multiply local var deceleration
Code Cleanup
- add
.gitignore
/.editorconfig
Have Fun! 💕
2021-2-28
Release 2.0.0 - Normalized directory structure, New beginning! 🆕✨💖
Normalized directory structure, New beginning!
- normalize directory structure: bin, lib, doc, etc #87 🆕✨💖
Have Fun! 💕
2019-12-02
Release 1.5.2(a cleanup release) 🎶📚🤡
Code Cleanup
- improve help message: one line contains less 80 chars 🎶
show-busy-java-threads
find-in-jars
- improve docs 📚
- fix typo: seperator -> separator 🤡
show-busy-java-threads
find-in-jars
Have Fun! 💕
2019-06-01
Release 1.5.1 ✍️😋🐾
Improvements
show-busy-java-threads
:- check before write file ✍️
find-in-jars
:- check dirs
coat
&a2l
- reorder color, avoid first line is red
Code Cleanup
show-busy-java-threads
:- extract util functions:
logAndRun
,logAndCat
- use
satisfy condition or die
pattern - use printf instead of print in awk script.
- use pipe instead
<()
, improve readability. 😋 - reorder/extract functions/variables.
- extract util functions:
find-in-jars
:- use arithmetic operation
- use
satisfy condition or die
pattern - use pipe instead
<()
, improve readability.
- documentation:
- compress png files 🐾
- improve docs of coat, find-in-jars
- improve format of markdown
Have Fun! 💕
2019-01-28
Release 1.5.0 🍭😋🎩
New Features
show-busy-java-threads
:
Bug Fix
show-busy-java-threads
:- fix bug for top v3.2 #71 🎩
Improvements
show-busy-java-threads
:find-in-jars
:- reecho
wc -l
, ensure no extra whitespace for jar file total count.
- reecho
Code Cleanup
show-busy-java-threads
:- use printf instead of print in awk script.
- use pipe instead
<()
, improve readability. 😋 - reorder/extract functions/variables.
find-in-jars
:- use pipe instead
<()
, improve readability.
- use pipe instead
Have Fun! 💕
2018-6-17
Release 1.4.0 🎩🎉🍡
New Features
show-busy-java-threads
:- use
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. - support
-S, --jstack-file-dir
option to specify the dir for storing jstack output files, and keep files. 🛐
default store jstack output files at tmp dir, and auto remove after run.
use this option to keep files so as to review jstack output later. - support
-d, --top-delay
option to specifies the delay between top samples. 😋
get thread cpu percentage during this delay interval.
- use
xpf/xpl
:- support mac, parse option by hand instead of
getopt
#66 🍡
- support mac, parse option by hand instead of
Bug Fix
show-busy-java-threads
:- should re-jstack when next update
- option parse fail should exit
Improvements
show-busy-java-threads
:- improve show-busy-java-threads help format 📚
- improve output color 🌈
- improve docs
Code Cleanup
show-busy-java-threads
:- main function style 💅
- reorder functions
- use
ARITHMETIC EVALUATION
explicitly instead of-gt
etc 🔢
Have Fun! 💕
2018-5-22