From 4f8e48cea3601a5cc8ffd6a1fc327f56a9c2837c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Mon, 15 Aug 2022 20:37:03 +0800 Subject: [PATCH] Remove more unused scripts --- bash/bashrc/sources/50_blog | 16 ---- bash/bashrc/sources/60_diagnostics | 21 ----- bash/cygxcolors/Solarized | 32 -------- bash/cygxcolors/Xdefaults | 3 - bash/cygxcolors/applyXColors.sh | 80 ------------------- bash/dumpcolors | 26 ------ bash/{bashrc => }/rbashrc | 2 +- bash/{bashrc => }/sources/09_ssh-agent | 0 bash/{bashrc => }/sources/10_aliases | 0 bash/{bashrc => }/sources/12_shortcuts | 0 bash/{bashrc => }/sources/15_gpg-agent | 0 bash/{bashrc => }/sources/16_keystore | 0 bash/{bashrc => }/sources/20_fast-greps | 0 bash/{bashrc => }/sources/21_win-greps | 0 bash/{bashrc => }/sources/22_win-setups | 0 .../11_vs_env => sources/23_win-vsenv} | 0 bash/{bashrc => }/sources/30_mysql | 0 bash/{bashrc => }/sources/31_git-utils | 0 bash/{bashrc => }/sources/40_go-command | 0 bash/{bashrc => }/sources/41_pivot-command | 0 bash/sources/60_diagnostics | 21 +++++ 21 files changed, 22 insertions(+), 179 deletions(-) delete mode 100755 bash/bashrc/sources/50_blog delete mode 100755 bash/bashrc/sources/60_diagnostics delete mode 100644 bash/cygxcolors/Solarized delete mode 100644 bash/cygxcolors/Xdefaults delete mode 100755 bash/cygxcolors/applyXColors.sh delete mode 100644 bash/dumpcolors rename bash/{bashrc => }/rbashrc (99%) rename bash/{bashrc => }/sources/09_ssh-agent (100%) rename bash/{bashrc => }/sources/10_aliases (100%) rename bash/{bashrc => }/sources/12_shortcuts (100%) rename bash/{bashrc => }/sources/15_gpg-agent (100%) rename bash/{bashrc => }/sources/16_keystore (100%) rename bash/{bashrc => }/sources/20_fast-greps (100%) rename bash/{bashrc => }/sources/21_win-greps (100%) rename bash/{bashrc => }/sources/22_win-setups (100%) rename bash/{bashrc/sources/11_vs_env => sources/23_win-vsenv} (100%) rename bash/{bashrc => }/sources/30_mysql (100%) rename bash/{bashrc => }/sources/31_git-utils (100%) rename bash/{bashrc => }/sources/40_go-command (100%) rename bash/{bashrc => }/sources/41_pivot-command (100%) create mode 100755 bash/sources/60_diagnostics diff --git a/bash/bashrc/sources/50_blog b/bash/bashrc/sources/50_blog deleted file mode 100755 index c3d8e75..0000000 --- a/bash/bashrc/sources/50_blog +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -function blog () { - if [[ -z `command -v cj` ]]; then - echo "Cannot find cj" - return 1 - fi - - if [[ -z "$1" ]]; then - __func_head "CONTENT(CJ)" - echo - else - FILE=$(date +%Y%m%d) - echo "$1 " | xargs -d' ' cj >> ~/blog/$FILE - fi -} diff --git a/bash/bashrc/sources/60_diagnostics b/bash/bashrc/sources/60_diagnostics deleted file mode 100755 index ce40af3..0000000 --- a/bash/bashrc/sources/60_diagnostics +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -function catlog () { - if [[ -z "$1" ]]; then - __func_head "FILE" - echo " Will exclude:" - cat ~/.settings/checklog_exclude | awk '{ print " "$1 }' - echo - else - GZIP= - file "$1" | grep gzip > /dev/null && GZIP=true - - EXCLUDE=$(awk '{ printf("(%s)|", $1) }' ~/.settings/checklog_exclude | sed 's/|$//') - - if [ $GZIP ]; then - gunzip -c $1 | egrep -v $EXCLUDE - else - egrep -v $EXCLUDE $1 - fi - fi -} diff --git a/bash/cygxcolors/Solarized b/bash/cygxcolors/Solarized deleted file mode 100644 index 4afa8a0..0000000 --- a/bash/cygxcolors/Solarized +++ /dev/null @@ -1,32 +0,0 @@ -! Common - -#define S_yellow #b58900 -#define S_orange #cb4b16 -#define S_red #dc322f -#define S_magenta #d33682 -#define S_violet #6c71c4 -#define S_blue #268bd2 -#define S_cyan #2aa198 -#define S_green #859900 - -! Dark - -#define S_base03 #222222 -#define S_base02 #073642 -#define S_base01 #586e75 -#define S_base00 #657b83 -#define S_base0 #839496 -#define S_base1 #93a1a1 -#define S_base2 #eee8d5 -#define S_base3 #fdf6e3 - -! Light - -! #define S_base03 #fdf6e3 -! #define S_base02 #eee8d5 -! #define S_base01 #93a1a1 -! #define S_base00 #839496 -! #define S_base0 #657b83 -! #define S_base1 #586e75 -! #define S_base2 #073642 -! #define S_base3 #002b36 diff --git a/bash/cygxcolors/Xdefaults b/bash/cygxcolors/Xdefaults deleted file mode 100644 index 4f81afe..0000000 --- a/bash/cygxcolors/Xdefaults +++ /dev/null @@ -1,3 +0,0 @@ -XTerm*font: 9x15 -XTerm*saveLines: 1000 -XTerm*geometry: 145x35 diff --git a/bash/cygxcolors/applyXColors.sh b/bash/cygxcolors/applyXColors.sh deleted file mode 100755 index 82563ac..0000000 --- a/bash/cygxcolors/applyXColors.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -CONF_FILE=$1 -TARGET_X=~/.Xdefaults - -[ ! -f $CONF_FILE ] && exit; - -function getColor() { - if [[ -n "$1" ]]; then - grep -E "^[ ]*#define.+S_$1[ ]+" $CONF_FILE | awk '{print $3}' - fi -} - -X_BEGIN_STR="!! ~~~~ BEGIN COLOR SETTINGS ~~~~ !!" -X_END_STR="!! ~~~~ END COLOR SETTINGS ~~~~ !!" -ORIGX="" - -if [ -f $TARGET_X ]; then - SKIP=false - while read line; - do - if [ "$line" = "$X_BEGIN_STR" ]; then - SKIP=true - continue - elif [ "$line" = "$X_END_STR" ]; then - SKIP=false - continue - fi - - if [ $SKIP = false ] && [ -n "$line" ]; then - ORIGX="$ORIGX$line\n" - fi - - done < $TARGET_X -fi - -CNAMES=( yellow orange red magenta violet blue cyan green base0 base1 base2 base3 base00 base01 base02 base03 ) -declare -A COLORS=() - -for i in "${CNAMES[@]}" -do - COLORS[$i]=$( getColor $i ) -done - - -SETTINGS="" - -function push_val() { - SETTINGS=$SETTINGS"$1\n" -} - -push_val -push_val "$X_BEGIN_STR" -push_val "*VT100*background: ${COLORS['base03']}" -push_val "*VT100*foreground: ${COLORS['base0']}" -push_val "*VT100*fading: 40" -push_val "*VT100*fadeColor: ${COLORS['base08']}" -push_val "*VT100*cursorColor: ${COLORS['base1']}" -push_val "*VT100*pointerColorBackground: ${COLORS['base01']}" -push_val "*VT100*pointerColorForeground: ${COLORS['base1']}" - -push_val "*VT100*color0: ${COLORS['base02']}" -push_val "*VT100*color1: ${COLORS['red']}" -push_val "*VT100*color2: ${COLORS['green']}" -push_val "*VT100*color3: ${COLORS['yellow']}" -push_val "*VT100*color4: ${COLORS['blue']}" -push_val "*VT100*color5: ${COLORS['magenta']}" -push_val "*VT100*color6: ${COLORS['cyan']}" -push_val "*VT100*color7: ${COLORS['base2']}" -push_val "*VT100*color8: ${COLORS['base03']}" -push_val "*VT100*color9: ${COLORS['orange']}" -push_val "*VT100*color10: ${COLORS['base01']}" -push_val "*VT100*color11: ${COLORS['base00']}" -push_val "*VT100*color12: ${COLORS['base0']}" -push_val "*VT100*color13: ${COLORS['violet']}" -push_val "*VT100*color14: ${COLORS['base1']}" -push_val "*VT100*color15: ${COLORS['base3']}" -push_val "$X_END_STR" - -echo -e "$ORIGX\n$SETTINGS" > $TARGET_X diff --git a/bash/dumpcolors b/bash/dumpcolors deleted file mode 100644 index 8b0f839..0000000 --- a/bash/dumpcolors +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# This file echoes a bunch of color codes to the -# terminal to demonstrate what's available. Each -# line is the color code of one forground color, -# out of 17 (default + 16 escapes), followed by a -# test use of that color on all nine background -# colors (default + 8 escapes). -# - -T='gYw' # The test text - -echo -e "\n 40m 41m 42m 43m\ - 44m 45m 46m 47m"; - -for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ - '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ - ' 36m' '1;36m' ' 37m' '1;37m'; - do FG=${FGs// /} - echo -en " $FGs \033[$FG $T " - for BG in 40m 41m 42m 43m 44m 45m 46m 47m; - do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; - done - echo; -done -echo diff --git a/bash/bashrc/rbashrc b/bash/rbashrc similarity index 99% rename from bash/bashrc/rbashrc rename to bash/rbashrc index c825dea..dddeab5 100644 --- a/bash/bashrc/rbashrc +++ b/bash/rbashrc @@ -12,7 +12,7 @@ RBASH_SOURCES="$RBASH_HOME/sources" RBASH_CONFIG="$RBASH_HOME/config" RBASH_REMOTE="https://git.k8s.astropenguin.net" RBASH_REPO="penguin/utils" -RBASH_PATH="bash/bashrc" +RBASH_PATH="bash" # Source global definitions if [ -f /etc/bashrc ]; then diff --git a/bash/bashrc/sources/09_ssh-agent b/bash/sources/09_ssh-agent similarity index 100% rename from bash/bashrc/sources/09_ssh-agent rename to bash/sources/09_ssh-agent diff --git a/bash/bashrc/sources/10_aliases b/bash/sources/10_aliases similarity index 100% rename from bash/bashrc/sources/10_aliases rename to bash/sources/10_aliases diff --git a/bash/bashrc/sources/12_shortcuts b/bash/sources/12_shortcuts similarity index 100% rename from bash/bashrc/sources/12_shortcuts rename to bash/sources/12_shortcuts diff --git a/bash/bashrc/sources/15_gpg-agent b/bash/sources/15_gpg-agent similarity index 100% rename from bash/bashrc/sources/15_gpg-agent rename to bash/sources/15_gpg-agent diff --git a/bash/bashrc/sources/16_keystore b/bash/sources/16_keystore similarity index 100% rename from bash/bashrc/sources/16_keystore rename to bash/sources/16_keystore diff --git a/bash/bashrc/sources/20_fast-greps b/bash/sources/20_fast-greps similarity index 100% rename from bash/bashrc/sources/20_fast-greps rename to bash/sources/20_fast-greps diff --git a/bash/bashrc/sources/21_win-greps b/bash/sources/21_win-greps similarity index 100% rename from bash/bashrc/sources/21_win-greps rename to bash/sources/21_win-greps diff --git a/bash/bashrc/sources/22_win-setups b/bash/sources/22_win-setups similarity index 100% rename from bash/bashrc/sources/22_win-setups rename to bash/sources/22_win-setups diff --git a/bash/bashrc/sources/11_vs_env b/bash/sources/23_win-vsenv similarity index 100% rename from bash/bashrc/sources/11_vs_env rename to bash/sources/23_win-vsenv diff --git a/bash/bashrc/sources/30_mysql b/bash/sources/30_mysql similarity index 100% rename from bash/bashrc/sources/30_mysql rename to bash/sources/30_mysql diff --git a/bash/bashrc/sources/31_git-utils b/bash/sources/31_git-utils similarity index 100% rename from bash/bashrc/sources/31_git-utils rename to bash/sources/31_git-utils diff --git a/bash/bashrc/sources/40_go-command b/bash/sources/40_go-command similarity index 100% rename from bash/bashrc/sources/40_go-command rename to bash/sources/40_go-command diff --git a/bash/bashrc/sources/41_pivot-command b/bash/sources/41_pivot-command similarity index 100% rename from bash/bashrc/sources/41_pivot-command rename to bash/sources/41_pivot-command diff --git a/bash/sources/60_diagnostics b/bash/sources/60_diagnostics new file mode 100755 index 0000000..73f075f --- /dev/null +++ b/bash/sources/60_diagnostics @@ -0,0 +1,21 @@ +#!/bin/bash + +function dumpcolors { + # Reference: https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html + T='gYw' # The test text + + echo -e "\n 40m 41m 42m 43m\ + 44m 45m 46m 47m"; + + for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ + '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ + ' 36m' '1;36m' ' 37m' '1;37m'; + do FG=${FGs// /} + echo -en " $FGs \033[$FG $T " + for BG in 40m 41m 42m 43m 44m 45m 46m 47m; + do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; + done + echo; + done + echo +}