From b5a8bf39ded946702d66997c41e60e6a43eb43fc Mon Sep 17 00:00:00 2001 From: wallentx Date: Sun, 5 Mar 2023 18:48:41 -0600 Subject: [PATCH] fix --- .github/README.md | 81 ------------------------ .github/updateMd | 2 +- bin/README.md | 16 ++++- bin/config-management/almanac | 45 ++++++------- bin/extra/proofdistrib | 11 ++-- bin/final-plot-management/plot/Excavator | 11 ++-- bin/mm/xplot | 2 +- 7 files changed, 49 insertions(+), 119 deletions(-) delete mode 100644 .github/README.md diff --git a/.github/README.md b/.github/README.md deleted file mode 100644 index 1d5ac0a..0000000 --- a/.github/README.md +++ /dev/null @@ -1,81 +0,0 @@ -## Tools I made for Chia - -#### Auto-updating README.md - -The Supplies Index of this `README.md` file updates automatically when an Actions Script is added, or modified. In order for the description of an item to be displayed, the file must contain the following string on a single line anywhere within the file: - -`## Description: ` - -# Supply Index - -- 📂 __bin__ - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/chsrc__ - - 📄 [.bash_functions](//home/william/src/farm-and-ranch-supply-depot/bin/chsrc/.bash_functions) - - 📄 [README.md](//home/william/src/farm-and-ranch-supply-depot/bin/chsrc/README.md) - - 📄 [ch\-activate](//home/william/src/farm-and-ranch-supply-depot/bin/chsrc/ch-activate) - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/vanilla-phaseControl__ - - 📄 [phasegate](//home/william/src/farm-and-ranch-supply-depot/bin/vanilla-phaseControl/phasegate) - - 📄 [phaseadd](//home/william/src/farm-and-ranch-supply-depot/bin/vanilla-phaseControl/phaseadd) - - 📄 [chpids](//home/william/src/farm-and-ranch-supply-depot/bin/vanilla-phaseControl/chpids) - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management__ - - 📄 [replot](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/replot) - - _replot - This script is not to be ran directly (but it can), and is called by 'replotd'. This script analyzes the chia plot directories, and determines the best drive to move the plot to from the -d buffer drive._ - - 📄 [README.md](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/README.md) - - 📄 [replotd](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/replotd) - - _replotd - This script runs like a daemon. Upon completion of a new plot, it analyzes the chia plot directories, locates an OG plot, deletes it, and moves the new plot in it's place. You need to pass it the path to the final directory of your newly created plots._ - - 📄 [Foreman](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/Foreman) - - _Foreman - This script assumes a few things - That your -d is a fast buffer volume to momentarily hold your plots until the Excavator script moves it to one of many HDDs mounted at /mnt/plots* (/mnt/plots, /mnt/plots2, /mnt/plots3, etc.). The purpose of this is to take away the task of moving the final plot to slower storage, from the plotting task. Time spent moving final plots can instead be spent on starting new plotting tasks. This script uses https://github.com/z3bra/wendy to watch your buffer directory, and trigger the Excavator upon inotify event 128 - a file rename - which is the last task of the plot creation. This is runs like a daemon._ - - 📄 [Excavator](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/Excavator) - - _Excavator - This script is not to be ran directly (but it can), and is called by 'Foreman'. This script analyzes the chia plot directories, and determines the best drive to move the plot to from the -d buffer drive._ - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/replot__ - - 📄 [replot](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/replot/replot) - - _replot - This script is not to be ran directly (but it can), and is called by 'replotd'. This script analyzes the chia plot directories, and determines the best drive to move the plot to from the -d buffer drive._ - - 📄 [README.md](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/replot/README.md) - - 📄 [replotd](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/replot/replotd) - - _replotd - This script runs like a daemon. Upon completion of a new plot, it analyzes the chia plot directories, locates an OG plot, deletes it, and moves the new plot in it's place. You need to pass it the path to the final directory of your newly created plots._ - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/plot__ - - 📄 [Foreman](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/plot/Foreman) - - _Foreman - This script assumes a few things - That your -d is a fast buffer volume to momentarily hold your plots until the Excavator script moves it to one of many HDDs mounted at /mnt/plots* (/mnt/plots, /mnt/plots2, /mnt/plots3, etc.). The purpose of this is to take away the task of moving the final plot to slower storage, from the plotting task. Time spent moving final plots can instead be spent on starting new plotting tasks. This script uses https://github.com/z3bra/wendy to watch your buffer directory, and trigger the Excavator upon inotify event 128 - a file rename - which is the last task of the plot creation. This is runs like a daemon._ - - 📄 [Excavator](//home/william/src/farm-and-ranch-supply-depot/bin/final-plot-management/plot/Excavator) - - _Excavator - This script is not to be ran directly (but it can), and is called by 'Foreman'. This script analyzes the chia plot directories, and determines the best drive to move the plot to from the -d buffer drive._ - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/config-management__ - - 📄 [README.md](//home/william/src/farm-and-ranch-supply-depot/bin/config-management/README.md) - - 📄 [almanac](//home/william/src/farm-and-ranch-supply-depot/bin/config-management/almanac) - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/mm__ - - 📄 [xplot](//home/william/src/farm-and-ranch-supply-depot/bin/mm/xplot) - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/vanilla-maxParallel__ - - 📄 [OxPlow](//home/william/src/farm-and-ranch-supply-depot/bin/vanilla-maxParallel/OxPlow) - - _OxPlow - Plot creation task. This is executed automatically by the systemd LandBureau service. Please review this file and make changes appropriate for your system._ - - 📂 __/home/william/src/farm-and-ranch-supply-depot/bin/extra__ - - 📄 [btable](//home/william/src/farm-and-ranch-supply-depot/bin/extra/btable) - - 📄 [ppht](//home/william/src/farm-and-ranch-supply-depot/bin/extra/ppht) - - 📄 [proofdistrib](//home/william/src/farm-and-ranch-supply-depot/bin/extra/proofdistrib) - - _Show (or graph) eligible plot distribution per Proof Check, by occurrence._ - - 📄 [chia\-conf\-diff](//home/william/src/farm-and-ranch-supply-depot/bin/extra/chia-conf-diff) - - 📄 [logo.txt.zst](//home/william/src/farm-and-ranch-supply-depot/bin/extra/logo.txt.zst) - - 📄 [sunblock](//home/william/src/farm-and-ranch-supply-depot/bin/extra/sunblock) - - 📄 [xhyper](//home/william/src/farm-and-ranch-supply-depot/bin/extra/xhyper) - - 📄 [chia\-oom\-protect](//home/william/src/farm-and-ranch-supply-depot/bin/extra/chia-oom-protect) - - 📄 [chiaconf\-diff](//home/william/src/farm-and-ranch-supply-depot/bin/extra/chiaconf-diff) - - 📄 [farmgraph](//home/william/src/farm-and-ranch-supply-depot/bin/extra/farmgraph) - - _ A pretty graph that shows your eligible plot distribution._ - - 📄 [ptable](//home/william/src/farm-and-ranch-supply-depot/bin/extra/ptable) - - 📄 [add\-nodes](//home/william/src/farm-and-ranch-supply-depot/bin/extra/add-nodes) - - 📄 [dfcsort](//home/william/src/farm-and-ranch-supply-depot/bin/extra/dfcsort) - - 📄 [.bash_aliases](//home/william/src/farm-and-ranch-supply-depot/bin/extra/.bash_aliases) - - 📄 [windistrib](//home/william/src/farm-and-ranch-supply-depot/bin/extra/windistrib) - - _Show (or graph) eligible plot distribution per Proof Check, by occurrence._ - - 📄 [landSurvey](//home/william/src/farm-and-ranch-supply-depot/bin/extra/landSurvey) - - 📄 [x2m2x](//home/william/src/farm-and-ranch-supply-depot/bin/extra/x2m2x) - - 📄 [pph](//home/william/src/farm-and-ranch-supply-depot/bin/extra/pph) - - _shows proofs found per hour, over the past 'n' hours_ - - 📄 [bench\-chia](//home/william/src/farm-and-ranch-supply-depot/bin/extra/bench-chia) - - 📄 [spinwrap](//home/william/src/farm-and-ranch-supply-depot/bin/extra/spinwrap) - - _Shows a spinner while another command is running._ - - -## Author - -👤 **William Allen** - -* Github: [@wallentx](https://github.com/wallentx) diff --git a/.github/updateMd b/.github/updateMd index a61d5fd..68c3baf 100755 --- a/.github/updateMd +++ b/.github/updateMd @@ -53,7 +53,7 @@ while read -r AISLE; do GHFILENAME=$(basename "$CRATE") AISLE_NUM=$(basename "$AISLE") DESCRIPTION=$(sed -n 's/^## Description: //p' "$CRATE") - echo -e " - 📄 [${GHFILENAME//-/\\-}](/$AISLE_NUM/$GHFILENAME)" >> "$PROJECT_ROOT"/README.md + echo -e " - 📄 [${GHFILENAME//-/\\-}](bin/$AISLE_NUM/$GHFILENAME)" >> "$PROJECT_ROOT"/README.md if [[ -n "$DESCRIPTION" ]]; then echo -e " - _${DESCRIPTION}_" >> "$PROJECT_ROOT"/README.md fi diff --git a/bin/README.md b/bin/README.md index 68ba6a3..3472ee6 100644 --- a/bin/README.md +++ b/bin/README.md @@ -1,3 +1,15 @@ -# to-do: +## Usage -1. Descriptions +#### Adding Supplies + +Add a script to the `bin` directory + +#### Auto-updating README.md + +The Supplies Index of this `README.md` file updates automatically when an Actions Script is added, or modified. In order for the description of an item to be displayed, the file must contain the following string on a single line anywhere within the file: + +`## Description: ` + +# Supply Index + +- 📂 __bin__ diff --git a/bin/config-management/almanac b/bin/config-management/almanac index dd04a35..39d7aa6 100755 --- a/bin/config-management/almanac +++ b/bin/config-management/almanac @@ -57,30 +57,25 @@ yq '.pool.pool_list' "$CH_CFG_PATH" -s '"/tmp/tmppool"' python -m pyaml "$TMPNOPOOL" > "$TMPCUR" python -m pyaml "$CH_CFG_INIT" > "$TMPNEW" -VIMDIFF_CONTROLS=$(cat <<- EOF - - - VIMDIFF CONTROLS - - - -]c - advance to the next block with differences -[c - reverse search for the previous block with differences -do (diff obtain) - bring changes from the other file to the current file -dp (diff put) - send changes from the current file to the other file -zo - unfold/unhide text -zc - refold/rehide text -zr - unfold both files completely -zm - fold both files completely - -NOTE ABOUT DIFF OBTAIN/PUT CONTROL: -- Normal Mode: Use "do" and "dp" controls when your cursor is on, or just one line under a block. -- Visual Mode: Use ":'<,'>diffget" and ":'<,'>diffput" when selecting lines of text. -See also ":h copy-diffs". - -":diffupdate" will re-scan the files for changes. - -When you are finished editing, press "escape", and enter ":wqa" and press "enter". +VIMDIFF_CONTROLS=$(bat -Ppl cmd-help <<- EOF + +^[[38;5;186mVIMDIFF CONTROLS ~^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m ]c | advance to the next block with differences |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m [c | reverse search for the previous block with differences |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m do | bring changes from the other file to the current file |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m dp | send changes from the current file to the other file |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m zo | unfold/unhide text |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m zc | refold/rehide text |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m zr | unfold both files completely |^[[0m +^[[38;5;203m|^[[0m^[[38;5;231m zm | fold both files completely |^[[0m + +^[[38;5;203mNOTE ABOUT DIFF OBTAIN/PUT CONTROL^[[0m^[[38;5;231m:^[[0m +^[[38;5;231m-^[[0m^[[38;5;231m ^[[0m^[[38;5;203mNormal Mode^[[0m^[[38;5;231m:^[[0m^[[38;5;231m ^[[0m^[[38;5;186mUse "do" and "dp" controls when your cursor is on, or just one line under a block.^[[0m +^[[38;5;231m-^[[0m^[[38;5;231m ^[[0m^[[38;5;203mVisual Mode^[[0m^[[38;5;231m:^[[0m^[[38;5;231m ^[[0m^[[38;5;186mUse ":'<,'>diffget" and ":'<,'>diffput" when selecting lines of text.^[[0m +^[[38;5;231m ^[[0m^[[38;5;186mSee also ":h copy-diffs".^[[0m + +^[[38;5;186m"^[[0m^[[38;5;186m:diffupdate^[[0m^[[38;5;186m"^[[0m^[[38;5;231m ^[[0m^[[38;5;186mwill re-scan the files for changes.^[[0 +^[[38;5;186mWhen you are finished editing, press "escape", and enter ":wqa" and press "enter".^[[0m EOF ) @@ -91,7 +86,7 @@ echo "and" echo "$CH_CFG_INIT" echo "This will open in $TOOL." if [[ $TOOL == "vimdiff" ]]; then - echo "$VIMDIFF_CONTROLS" + echo -e "$VIMDIFF_CONTROLS" echo "" fi read -rp "Press enter to continue." diff --git a/bin/extra/proofdistrib b/bin/extra/proofdistrib index 9eebf95..e7eea15 100755 --- a/bin/extra/proofdistrib +++ b/bin/extra/proofdistrib @@ -3,14 +3,14 @@ ## Description: Show (or graph) eligible plot distribution per Proof Check, by occurrence. # Manually set this if you want to display plot count -COUNT=true -CHIAPATH="$HOME/chia-blockchain" +COUNT=false +CHIAPATH="$HOME/chia-blockchain-1.2.11" if [[ $COUNT == true ]] && [[ ! -z $CHIAPATH ]]; then source $CHIAPATH/activate PLOTCOUNT=$(chia farm summary | grep 'plots of size' | grep -o '[^$(printf '\t') ].*') fi -LOGPATH="$HOME/.chia/mainnet/log/debug.log*" +LOGPATH="$HOME/.chia/mainnet/log/harvester-debug.log*" if [[ ! $(ls -A $LOGPATH) ]]; then echo "No files found at $LOGPATH" @@ -29,7 +29,7 @@ plottery() { grep -o 'Found.*proofs' | \ sort | \ uniq -c | \ - awk -F" " '{print " ", $3"\t", "┃ ", $1}' + awk -F" " '{print "", $3"\t", "┃ ", $1}' # grep -o 'Found.*proofs' "$LOGPATH" | \ # sort | \ @@ -51,7 +51,10 @@ showdistrib() { ━━━━╋━━━━ EOF +#sort | uniq -c | awk -F" " '{print " ", $3"\t", "┃ ", $1}' | column -t + plottery | column -t | \ +# sort | uniq -c | awk -F" " '{print " ", $3"\t", "┃ ", $1}' | column -t # awk '{print $1}' | \ # tail +4 | \ # sort -n | \ diff --git a/bin/final-plot-management/plot/Excavator b/bin/final-plot-management/plot/Excavator index ef0d9e6..954367a 100755 --- a/bin/final-plot-management/plot/Excavator +++ b/bin/final-plot-management/plot/Excavator @@ -60,7 +60,8 @@ MOUNT_LIST="/tmp/$(basename "$0")-mounts.$$.list" FindMounts() { echo "Finding plot locations..." "$CHIA_ROOT"/venv/bin/chia plots show | \ - grep 'solo\|pool' | \ + grep 'mnt' | xargs -I {} bash -c 'find {} -type d -name "plots*"' | \ +# grep 'solo\|pool' | \ # sed 's,/*[^/]\+/*$,,' | \ sort -R >"$MOUNT_LIST" } @@ -135,10 +136,10 @@ IterateMounts() { PLOTCOUNT="$((AVAIL / PLOTSIZE))" echo "Evaluating mount..." if [[ $PLOTCOUNT -gt 0 ]]; then - echo "Moving $WENDY_INODE to $TARGET/..." - rsync -a --remove-source-files "$WENDY_INODE" "$TARGET"/"$PLOTNAME" - if [[ -f "$TARGET"/"$PLOTNAME" ]]; then - echo "$PLOTNAME has been moved to $TARGET/, and is ready for farming!" + echo "Moving $WENDY_INODE to $TARGET/pool/..." + rsync -a --remove-source-files "$WENDY_INODE" "$TARGET"/pool/"$PLOTNAME" + if [[ -f "$TARGET"/pool/"$PLOTNAME" ]]; then + echo "$PLOTNAME has been moved to $TARGET/pool/, and is ready for farming!" exit 0 fi break 2 diff --git a/bin/mm/xplot b/bin/mm/xplot index d2400f8..f3ecaf5 100755 --- a/bin/mm/xplot +++ b/bin/mm/xplot @@ -9,4 +9,4 @@ TEMP2=${4:-$TEMP1} SCK=$(cat ~/.ssh/sck) FPK=$(cat ~/.ssh/fpk) -nohup chia_plot -c "$SCK" -f "$FPK" -n "$COUNT" -r "$CORES" -K 2 -u 512 -v 512 -t "$TEMP1" -2 "$TEMP2" -d "$TEMP1" | systemd-cat -t xplot & +nohup chia_plot -c "$SCK" -f "$FPK" -n "$COUNT" -r "$CORES" -K 2 -u 512 -v 512 -t "$TEMP1" -2 "$TEMP2" -d "$TEMP1" -D true | systemd-cat -t xplot &