Useful Scripts Versions Save

๐ŸŒ useful scripts for making developer's everyday life easier and happier, involved java, shell etc.

v3.0.0-Alpha

1 month ago

repo-icon

[!NOTE] This is a WIP/cleanup release for upgrading version to 3.x

  • remove legacy bin ๐Ÿšฎ
  • rename dir test-cases to test ๐Ÿ†™

It's time to say goodbye, legacy bin my friend

It's been a long day without you my friend And I'll tell you all about it when I see you again We've come a long way from where we began Oh I'll tell you all about it when I see you again


Have Fun! ๐Ÿ’• 2024-04-15

v2.5.4

1 month ago

repo-icon

โ˜˜๏ธ Features

  • [c]: ensure using command on PATH, and check the command existence on PATH ๐Ÿ‘ฃ
  • [coat/taoc]: add --help/--version options ๐Ÿšฉ

๐Ÿฌ Improvements

  • [find-in-jars]: add IFS= for read, more robust ๐Ÿ’ช
    • file paths may contain leading spaces
  • [show-busy-java-threads]:
    • improve separator blank line output ๐Ÿ’… fix wrong blank line logic
    • extract timestamp var to avoid inconsistency โŒš๏ธ
  • unify error message format and refactor related functions โ„น๏ธ
    • keep usage function simple
    • use -s/-h option for optional argument of die function
  • use ${var##*/} instead of basename to assign PROG var ๐ŸŽ›๏ธ
    • faster, no subprocess fork
  • use command realpath instead of function portableReadLink ๐Ÿ”—
    • faster and without losing portability
  • use bash builtin type -P instead of which command, faster ๐Ÿš

๐Ÿ› ๏ธ Refactor

  • [show-busy-java-threads]: rename global var USER -> WHOAMI ๐Ÿ‘ค
  • [uq]: use exponential operation instead of multiplication to calculate size ๐Ÿงฎ
  • [c]: rename functions ๐Ÿ”ก
  • use Shell Arithmetic comparison instead of Conditional Expressions ๐Ÿ”ข
  • use = instead of == in Conditional Expressions
  • use ||/&& instead of one branch/one line if ๐ŸŽฐ
  • merge colorPrint function if only one caller
  • variable related refactors:
    • extract UNAME var ๐Ÿ” 
    • rename var, use COLOR_INDEX instead of COUNT
    • remove declare keyword for global vars, more consistent
    • use upper-case var name for global readonly vars
    • unset temp global vars after use
    • remove unnecessary {} when use var
    • remove local nl=$'\n' declaration if only one usage
  • small code cleanup
    • remove unnecessary file descriptor number 1 in redirections โžก๏ธ
    • remove section comments for simple section
    • improve/fix/add code comments

๐Ÿ“š Documentation

  • update manual pages links to manned.org ๐Ÿ“š
  • use shellcheck item doc link instead of prolixity comments โœจ

๐Ÿšœ Build/CI

  • upgrade GitHub actions; add dependabot.yml ๐Ÿค–
  • upgrade shunit2 lib

Have Fun! ๐Ÿ’• 2024-04-12

v2.5.3

2 months ago

repo-icon

๐Ÿฌ Improvements

  • [show-busy-java-threads] support Java21 ๐Ÿ†• โ˜•๏ธ
    • missing stack on Java21, because Java21 changed the format of stack title line (issue #120 submmited by @jianyun)
  • [show-busy-java-threads] improve separator blank line output format ๐Ÿ’…

Have Fun! ๐Ÿ’•
2024-02-18

v2.5.2

3 months ago

repo-icon

๐Ÿž BugFix

  • coat/taoc: missing last line if thereโ€™s no newline at the end of the file ๐ŸŒ— ๐Ÿ™€
  • xpl: wrong exit code when file not existed or open file failure ๐Ÿ”ข

๐Ÿ› ๏ธ Improvements/Refactor

  • find bash with /usr/bin/env in shebang (by @hyperupcall in #119) ๐Ÿš
  • coat/taoc: ๐Ÿˆ
    • remove pipe when naked cat(more straightforward and faster) ๐Ÿ˜ธ
    • extract colorLines function ๐ŸŒˆ
  • a2l: merge function colorPrint into rotateColorPrint ๐Ÿ› ๏ธ
  • improve readability
    • remove var interpolation in printf format if possible
    • rename vars, e.g. message -> content, normal -> color_reset ๐Ÿ‘“
    • use \e instead of \033
    • improve comments for -t check
  • simplify var usage
    • remove unnecessary {} when use var
    • remove quote of values in simple assignment

๐Ÿšœ Build/CI

  • upgrade shunit2 lib

Have Fun! ๐Ÿ’• 2024-01-25

v2.5.1

5 months ago

repo-icon

๐Ÿž BugFix

  • c: wrong exit code with -q option ๐Ÿž

๐Ÿ› ๏ธ Improvements/Refactor

  • use ${array[@]:-}/${array[@]:+} to simplify codes ๐Ÿšž
  • use file descriptor number instead of /dev/std* (issue #114 summitted by @wushengde)
  • console-text-color-themes.sh, improve robustness/portability:
    • use BASH_SOURCE array to detect whether this script is sourced or not ๐Ÿ•ต๏ธ
    • use printf ๐Ÿ’ช instead of echo
    • use if instead of &&
    • remove global var declare if possible

๐Ÿ“š Documentation

  • add more resources of bash ๐Ÿ“š

Have Fun! ๐Ÿ’•
2023-12-05

v2.5.0

8 months ago

repo-icon

โ˜˜๏ธ Features

  • add taoc ๐Ÿซด ๐Ÿˆ
  • echo-args: align the index number

๐Ÿ› ๏ธ Improvements/Refactor

  • c, improve readable: ๐Ÿ‘“
    • simplify teeAndCopy function
    • use boolean option parse value holder
    • reanme vars
  • improve shell robustness/portability ๐Ÿ’ช
    • use printf instead of echo
    • use if-else instead of &&-||
    • involved almost all scripts:
      c/coat/a2l/echo-args/ap/rp/xpl/xpf/uq
      cp-into-docker-run/tcp-connection-state-counter/console-text-color-themes.sh
      find-in-jars/show-busy-java-threads
  • fix shellcheck issues

๐Ÿ“š Documentation

  • update logo and image links in docs ๐ŸŒ
  • disable default link of github images

๐Ÿšœ Build/CI

  • update ci.yaml, test on latest MacOS ๐ŸŽ
  • upgrade shunit2 lib

Have Fun! ๐Ÿ’•
2023-09-06

v2.4.4

1 year ago

Improvements/Refactor

Style

  • style: adjust file format ๐Ÿ’…
    • update .editorconfig
    • shell files
      • use 2 spaces indentation
      • use $() instead of ``

Docs

  • add dev guide #64 ๐ŸŽ“
  • add logo ๐ŸŽจ
  • add TOC for README
  • improve wording/format

Build/CI

  • add github action ci.yaml(remove travis) ๐Ÿ‘ทโ€โ™€๏ธ
  • add MacOS CI ๐ŸŽ

Have Fun! ๐Ÿ’•
2022-12-24

v2.4.3

2 years ago

Improvements

  • show-duplicate-java-classes:
    • fix wrong CPU percentage order under ps from procps-ng 3.3.12 ๐Ÿข
    • use one option --cpu-sample-interval instead of --top-delay/--use-ps โณ

Cleanup

  • code cleanup
    • remove unused var
    • reorder parameters of function
  • improve documentations
    • update travis badge to travis.com

Have Fun! ๐Ÿ’•
2021-7-21

v2.4.2

2 years ago

Improvements

  • show-duplicate-java-classes:
    • output duplicate ratio and class number of class path #59 ๐Ÿ•ต๏ธโ€โ™‚๏ธ
    • improve percent output format
  • cp-into-docker-run:
    • check required option -c/--container ๐Ÿ—‚
  • code cleanup
  • improve documentations: fix broken link #98

Have Fun! ๐Ÿ’•
2021-5-16

v2.4.1

3 years ago

Improvements

  • show-busy-java-threads: ๐Ÿ•ต๏ธโ€โ™‚๏ธ
    • improve jstack command search order, JAVA_HOME before PATH
  • find-in-jars:
    • check list zip entries fail, especially common case "Empty zipfile" ๐Ÿ“ญ
    • improve command to list zip entries search ๐Ÿ•ต๏ธโ€โ™‚๏ธ
  • improve scripts cp-into-docker-run/ap/xpf: use portableReadLink ๐Ÿ”—

BugFix

  • xpl: fix unbound variable args[@] โ™พ

Have Fun! ๐Ÿ’•
2021-4-30