--- /dev/null
+#!/bin/sh
+
+#Open ports
+
+sudo ufw allow 8080/tcp
+sudo ufw allow ssh
+
+
+##Added
+sudo add-apt-repository ppa:ultradvorka/ppa
+sudo add-apt-repository ppa:aacebedo/fasd
+sudo apt-get update -y
+sudo apt install screen -y
+sudo apt install p7zip-full -y
+sudo apt install whois -y
+sudo apt install arp-scan -y
+sudo apt-get install dh-autoreconf -y
+sudo apt-get install tree -y
+sudo apt install hardinfo -y
+sudo apt install inetutils-traceroute -y
+sudo apt install xclip -y
+#hh command for history
+#https://github.com/dvorka/hstr
+sudo apt-get install hh -y
+
+sudo apt-get install ranger caca-utils highlight atool w3m poppler-utils mediainfo -y
+#eval "$(fasd --init auto)" >> .bashrc
+sudo apt-get install fasd -y
+
+#Obtain currently installed packages
+## sudo dpkg --get-selections|grep -v deinstal > Documents/all-packages.installed
+#Reinstall previously installed packages
+sudo apt install $(cat all-packages.installed|awk '{print $1}') -y
+
+#Install dev libraries
+sudo apt install libtool-bin libncurses-dev libxt-dev libgtk2.0-dev libatk1.0-dev libq-dev -y
+
+#Install old kernel file purger
+sudo apt-get install byobu -y
+#Activate sensors on hardware
+#To install --> sudo apt-get install lm-sensors
+sudo sensors-detect
+sudo apt install dateutils -y
+#File preview in shell
+sudo apt install bat -y
+sudo apt install vim -y
+sudo apt install git -y
+sudo apt install glances -y
+sudo apt install pgp -y
+sudo apt install keepassxc -y
+
+sudo apt install ssh -y
+sudo apt install sqlite -y
+#Hardware releveant into utility
+sudo apt install hwloc -y
+sudo apt install hunspell -y
+
+#Install fuzzy finder
+git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
+~/.fzf/install --all
+#
+sudo apt install suckless-tools -y
+sudo apt install mpv -y
+
+sudo apt install powerline -y
+sudo apt install pv jq suckless-tools -y
+sudo apt install python3-pip
+sudo apt install python3-q-text-as-data ffmpeg -y
+python3 -m pip install -U yt-dlp -y
+
+
--- /dev/null
+#!/bin/bash
+
+if ! cd ~/dev; then
+mkdir ~/dev
+fi
+
+
+sudo add-apt-repository ppa:bashtop-monitor/bashtop
+sudo apt update
+sudo apt install bashtop
+
+git clone https://github.com/MatMoul/g810-led.git
+cd g810-led
+make bin # for hidapi
+sudo make install
+cd
+cat > ~/.keyboard_rgp <<EOL
+# Slap that keyboard bitch with rainbow colours, place in ~/.profile the following: g213-led -p .keyboard_rgb
+r 1 00FFFF
+r 2 FFFF00
+r 3 FFFFFF
+r 4 FF0000
+r 5 78FFFF
+EOL
+
+
--- /dev/null
+# Internet Math Base 22 Number
+
+Storage and conversion from int decimal to base 22 number creates an alternative to using current form of 127.0.0.1.
+Former being more human readable. The IMB22 format is yet shorter in length and faster to compare, to store and operate.
+
+Notice - This document is not part of any know standards to author. It has been put in public domain, for better understanding any further works or research.
+
+## Obtaining the IMB22 Number
+
+* The following script shows how to convert to and from an localhost 127.0.0.1 address.
+
+```perl
+
+perl -le ' use Math::Int2Base qw(int2base base2int);
+ $i=3;
+ $u += ($_<<8*$i--) for "127.0.0.1" =~ /(\d+)/g;
+ print "INTIP:$u";
+ $imb=int2base($u,22);
+ print "IMB22:$imb";
+ $int10=base2int($imb, 22);
+ print "INT10:$int10";
+'
+```
+
+* The above prints:
+
+```bash
+INTIP:2130706433
+IMB22:IH9DK09
+INT10:2130706433
+```
+
+* Where INTIP: *2130706433* is the decimal number of the 127.0.0.1, and IMB22: *IH9DK09* is the base 22 one version.
+* 255.255.255.255 Example:
+
+```bash
+echo "255.255.255.255" | perl -le '
+use Math::Int2Base qw(int2base base2int);
+ $i=3;while(<STDIN>){print $ADR.=$_};
+ $u += ($_<<8*$i--) for $ADR =~ /(\d+)/g;
+ print "INTIP:$u";
+ $imb=int2base($u,22);
+ print "IMB22:$imb";
+'
+255.255.255.255
+
+INTIP:4294967295
+IMB22:1FJ8B183
+
+```
+
+* So -> 255.255.255.255 == *1FJ8B183*
+* How about 192.168.0.1?
+
+```bash
+echo "192.168.0.1" | perl -le '
+use Math::Int2Base qw(int2base base2int);
+$i=3;while(<>){print $ADR.=$_};
+$u += ($_<<8*$i--) for $ADR =~ /(\d+)/g;
+print "INTIP:$u";
+$imb=int2base($u,22);
+print "IMB22:$imb";
+$int10=base2int($imb, 22);
+print "INT10:$int10";
+'
+192.168.0.1
+
+INTIP:3232235521
+IMB22:16B3J6C9
+INT10:3232235521
+```
+
+* 192.168.0.1 == *16B3J6C9*, And *1FJ8B183* > *16B3J6C9*
+ * Check:
+
+ ```bash
+ perl -le "use Math::Int2Base qw(int2base base2int);
+ print base2int('1FJ8B183',22) > base2int('16B3J6C9',22)?'true':'false'"
+
+ ```
+
+## Valid Internet Host Mask Number Range
+
+**Sorry -> This Section Is Under Development**
+
+## Historical Significance of Twenty-Two
+
+* logₐ(X) -> X=10, a=10, b=22 == 1 (From x=1..10, is 0..1 *10* numbers with up to 3 decimal places precision.
+* logₐ(X) -> X=100, a=10, b=22 == 2 (From x=1..100, is 0..2 *100* numbers with up to 3 decimal places precision.
+* logₐ(X) -> X=1000, a=10, b=22 == 3
+
+
+### General
+(For following the origin source was -> <https://www.ridingthebeast.com/numbers/nu22.php>)
+
+* The 22 elements by which God created the world.
+* At his Ascension, by twenty-two times Jesus blesses the creation.
+* The Word of God is at the 22th level of conscience. The cosmic conscience would subdivide indeed into 24 dimensional or spiritual levels. The maximal conscience level, the 24th, would be attributable only to the God-Father and the 23th level would be considered as being an energy protective area surrounding the level 24. The 22th level of conscience would be also that of the antique Elohim also named the 24 Ancients.
+* Twenty-two is the number of biblical books of the Old Testament - Hebrews and Protestants. This number is obtained by counting for only one book the twelve minor prophets, as well as the Judges, the Kings, Ezra, the Chronicles (each one being generally divided into two books). It is also necessary to integrate Ruth with the Judges and the Lamentations with Jeremiah. And it is thanks to this last restriction that we obtain finally 22 instead of 24. Flavius Joseph (Against Apion, I, 8, 1st s.) is the first one to have proposed a distribution in 22 books.
+* The Mezuzah contains fifteen verses of the last book the Old Testament, the Deuteronomy, VI, 4-9 and XI, 13-21, for a total of 170 words, always written in 22 lines. This small roll is inserted in a tube of wood or metal and is attached to the superior right side on the frame of a door, according to the commandment of the Bible: "And you will write them on the frame of the door of your house" .
+
+* The 22 chapters of the Vendidad, book of the Avesta, written by Zarathustra.
+
+* The 22 prayers ("Yeshts") of the "Khorda-Avesta".
+
+* The Chronos god was surrounded by 22 main assistants and 22 secondary, according to the Phoenician Sanchoniaton.
+
+* For the Muslives, the Koran is the recording of the oral revelation authorized by the grace of God to the Prophet of Islam during almost 22 years, in the beginning of the seventh century of the Christian era - from 610 to 632.
+
+* According to S. Doucet and J.-P. Larosee, the man is composed twenty-two evolutionary bodies gathered in four categories: subtle body, energy body, galactic body and temporal body. Each one of these 22 bodies is formed of 1296 "partitions" that they call circumferences, vibrating each one at a precise frequency. This number 1296 is called "Energizing number", since it is the product of 12 (Cosmic number) and 108 (Universal number). By multiplying 22 by 1296, they obtain the total number of 28512 circumferences composing the 22 evolutionary bodies of the man, that is according to them the number of the man and also that of Infinite Energy.
+
+* Several old alphabets had twenty-two letters: Chaldean, Sabean, Roman, Copt and Hebraic. The letters of the Hebraic alphabet are divided into three mother letters (Aleph, Mem, Shin), seven double letters (Beth, Guimel, Daleth, Kaph, Phe, Resh, Tau) twelve simple letters (He, Waw, Zain, Heth, Teth, Yod, Lamed, Nun, Samekh, Ayin, Tzade, Qoph).
+
+* According to saint Yves of Alveydre, the primitive alphabet of all the humanity, at the period of "Ram" (adam alphabet or "Watan"), would have comprised 22 signs.
+
+* Salemi points out that the Hebrew Candelabra includes 22 chalices, 22 apples and 22 flowers by counting the point superior of the axis.
+
+* "From the twenty-two great Masters that counted the "Templiers Order" since its creation to its term, seven lost the life in combats; five died of their wounds, one of voluntary fast, having fallen to hands of infidels. Finally, James Molay had to be burnt alive under Philip the Bel, but the Order was dissolved when this crime occurred. It is therefore on the whole thirteen great Masters in function who paid of their existence the honor to command the soldiers of Christ." (John Carpentier)
+
+* The 22 cards of the Tarot - 22 mysteries major.
+
+* The Cosmos would shelter 22 Super-Universe.
+
+* The totality of mystical knowledge is contained in the symbolic of the first twenty-two numbers, according to Bambaras.
+
+* The initiation of Pythagoras with the Egyptian priests lasted 22 years.
+
+* The twenty-two channels linking the ten "Sephiroth" between them in the "sephirotic Tree" of the Cabal.
+
+* According to some mediumnic revelations, it would exist 22 main stars where all the entities will pass to achieve the complete cycle of their evolution.
+
+* Twenty-two is the number of writable regular polygons in an Euclidiean circle: 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360. These are twenty-two of the twenty-four dividers of 360, the two first, 1 and 2, not defining polygons.
+
+* Length of the cubit in number of fingers, for Bambaras, which corresponds to the totality of the categories of the creation: this cubit from Bambaras represents therefore the universe.
+
+* Number of total stars of which is composed the Little Bear. However, only seven of them are visible to the naked eye.
+
+* 22 divided by 7 gives the number "pi", which represents the mysterious and approximate ratio of the perimeter of a circle to its diameter.
+
+* The head of the man is constituted of 22 bones: 8 for the cranium and 14 for the face.
+
+* Anniversary of marriage: weddings of ebony.
+
+### Gematria
+
+The shout of alert "22!" was used by the typographers warning thus the arrival of the chief of workshop.
+The number is obtained by addition of the numerical value of each letter of the French word "chef" (chief)
+according to their position in the Latin alphabet: C=3, H=8, E=5 and F=6.
+
+### Released: v.1.0 Date:20210629
+
+ This document has been written by Will Budic and is from the project -> <https://github.com/wbudic/wb-shell-scripts>
\ No newline at end of file
--- /dev/null
+{
+ "gitlens.gitCommands.skipConfirmations": [
+ "fetch:command",
+ "stash-push:command",
+ "switch:command",
+ "push:command"
+ ],
+ "go.useLanguageServer": true,
+ "workbench.startupEditor": "newUntitledFile",
+ "C_Cpp.updateChannel": "Insiders",
+ "erd-preview.dotPath": "/home/will/.local/graphviz-dot-linux-x64",
+ "erd-preview.erdPath": "/home/will/.local/linux_amd64_erd-go",
+ "git.autofetch": true,
+ "perl.perlInc": "/home/will/perl5/bin",
+ "perl.perlInc2": ["/home/will/perl5/bin","/usr/lib/x86_64-linux-gnu/perl/5.30.0/"],
+ "perlSyntax.includePaths": ["/home/will/perl5/", "/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/"],
+ "perl.ignoreDirs": [
+ null
+ ],
+ "perl.perltidyArgs": [
+
+ "-q",
+ "-et=4",
+ "-t",
+ "-ce",
+ "-l=0",
+ "-bar",
+ "-naws",
+ "-blbs=2",
+ "-mbl=2"
+ ],
+ "perl.pls": "perl",
+ "editor.fontSize": 12,
+ "files.autoSave": "afterDelay",
+ "diffEditor.ignoreTrimWhitespace": false,
+ "workbench.preferredDarkColorTheme": "Monokai Dimmed",
+ "workbench.colorCustomizations": {
+ "window.activeBorder":"#6b3232",
+ "tab.activeBackground": "#352121",
+ "!activityBar.background": "#6b3232",
+ "!contrastBorder":"#6b3232",
+ "editor.background": "#221919"
+ },
+ "[html]": {
+ "editor.defaultFormatter": "HookyQR.beautify"
+ },
+ "terminal.integrated.shell.linux": "bash",
+ "go.toolsManagement.autoUpdate": true,
+ "git.ignoredRepositories": [
+ ".history",
+ ".history/*",
+ ".vscode"
+ ],
+ "warmUp.changeCount": "15",
+ "telemetry.enableCrashReporter": false,
+ "beautify.ignore": "",
+ "window.zoomLevel": 1,
+ "security.workspace.trust.untrustedFiles": "open"
+
+}
+
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+require Schedule::Cron::Events;
+use POSIX qw(strftime);
+
+my $cronlist = `crontab -l`;
+foreach (split '\n', $cronlist) {
+ my $cron = new Schedule::Cron::Events($_);
+ if($cron){
+ $cron->setCounterToNow; $cron->previousEvent;
+ my $prev = strftime("%F %T", $cron->nextEvent);
+ my $next = strftime("%F %T", $cron->nextEvent);
+
+ print "$prev prev => ", $cron->commandLine, "\n";
+ print "$next next\n";
+ }
+ }
+__END__
+#Requirments:
+sudo cpan -i Schedule::Cron::Events
\ No newline at end of file
--- /dev/null
+ssh nuc hostname; ip -h -c -f inet address | grep global; \
+uptime | awk -F, '{print $1,$2}' | sed 's/:/h /g;s/^.*up *//; s/ *[0-9]* user.*//;s/[0-9]$/&m/;s/ day. */d /g' | \
+awk '{print "Uptime:",$1,$2,$3, $4}'
+df -h /
+nmap -n nuc elite
+ping -c 5 -M dont yuotube.com
+speedtest
--- /dev/null
+#!/bin/bash
+export XDG_RUNTIME_DIR=/run/user/$(id -u)
+export DISPLAY=":0"
+export XAUTHORITY="$HOME/.Xauthority"
+export BACKUP_VERBOSE=0
+export HOME=/home/will
+export USER=will
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Started"
+
+rsync -chavzP --stats will@nuc:thttpd_dev/dbLifeLog/ "$HOME/backups/NUC_dbLifeLog"
+rm -f "$HOME/backups/NUC_dbLifeLog/cgisess_*"
+# Let's synch perl and its modules while we at it.
+rsync -Pacz --stats /home/will/localperl will@nuc:backups
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Ended\n"
+
+exit;
--- /dev/null
+#!/bin/bash
+export XDG_RUNTIME_DIR=/run/user/$(id -u)
+export DISPLAY=":0"
+export XAUTHORITY="$HOME/.Xauthority"
+export BACKUP_VERBOSE=0
+export HOME=/home/will
+export USER=will
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Started"
+
+cd /home/will/dev/B_L_R_via_sshfs
+./backup.sh
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Ended\n"
+
+exit;
--- /dev/null
+#!/bin/bash
+export XDG_RUNTIME_DIR=/run/user/$(id -u)
+export DISPLAY=":0"
+export XAUTHORITY="$HOME/.Xauthority"
+export CRON_DISABLED_STDIN=1
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Started"
+
+stor=$($HOME/uvar.sh -r BITCOIN_PRICE);
+grab=$(curl -s rate.sx./1btc | cut -d. -f1)
+record=0
+if [ -z $stor ] || [ $stor -ne $grab ]; then
+ $HOME/uvar.sh -n BITCOIN_PRICE -v $grab;
+ stor=$grab; record=1;
+fi
+grab=$(printf "US $%'.2f", $grab)
+/usr/bin/notify-send "BITCON PRICE" "$grab"
+if [ $record == 1 ]; then
+cd ~/dev/LifeLog
+./log.pl -db_src "DBI:Pg:host=localhost;port=5433;" -alias lifelog -database lifelog -sys_table=BITCOIN:VALUE:INTEGER -system -insert "$stor"
+cd
+fi
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Ended\n"
+exit;
--- /dev/null
+#!/bin/bash
+export XDG_RUNTIME_DIR=/run/user/$(id -u)
+export DISPLAY=":0"
+export XAUTHORITY="$HOME/.Xauthority"
+export CRON_DISABLED_STDIN="1"
+
+echo -e $(date +"%D %T") $(basename $0) "Started"
+
+grab=$(curl -X GET https://openexchangerates.org/api/latest.json?app_id=00a1943886e24f9bb240e6aa3f7b9868)
+# Following available only with business plan:
+#https://openexchangerates.org/api/latest.json?base=AUD&prettyprint=true&show_alternative=true
+
+echo $grab
+~/uvar.sh -n EXCHANGE_JSON -v $(echo $grab | tr -s '\n' '\\n')
+~/uvar.sh -n EXCHANGE_AUD -v $(echo $grab | jq '.rates.AUD')
+~/uvar.sh -n EXCHANGE_EUR -v $(echo $grab | jq '.rates.EUR')
+
+echo -e $(date +"%D %T") $(basename $0) "Ended\n"
--- /dev/null
+#!/bin/bash
+# This is the users cron log maintenance script, trims the ~/cron.log every two days.
+# Here the logs file crtime is not checked, last check time is used via uvar CRON_LOG_CHTIME
+# Most unix file systems require inode to be checked for an files crtime which is su restricted.
+# Using uvar we bypass this as requirment as cron is an background process, not interactive.
+#
+
+chtime=$(~/uvar.sh -r CRON_LOG_LAST_MAINENANCE_TIME)
+nlines=5000
+export CRON_DISABLED_STDIN=1
+
+if [ -f ~/cron.log ]; then
+ now=$(date '+%s')
+ let "two_days_back=$now - 3600*24*2";
+ let "seven_days_back=$now - 3600*24*7";
+~/uvar.sh -n CRON_LOG_LAST_MAINENANCE_TIME -v "$now"
+ if [ -z "$chtime" ]; then
+ exit
+ fi
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Started"
+ if [ "$chtime" -lt "$two_days_back" ]; then
+ tail -n "$nlines" ~/cron.log > ~/cron.tmp.log;
+ mv ~/cron.tmp.log ~/cron.log;
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "\nTAIL TRIMED LOG to $nlines lines" >> ~/cron.log
+~/uvar.sh -n CRON_LOG_LAST_MAINENANCE_TIME -v ""
+ last_backup=$(~/uvar.sh -r LAST_BACKUP_DATE)
+ last_backup=$(date -d "$last_backup" +'%s')
+ if [ -n "$last_backup" ] && [ "$last_backup" -lt "$seven_days_back" ]; then
+ ~/cron_backup_to_nuc.sh
+ fi
+ fi
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Ended"
+fi
--- /dev/null
+#!/bin/bash
+export XDG_RUNTIME_DIR=/run/user/$(id -u)
+export DISPLAY=":0"
+export XAUTHORITY="$HOME/.Xauthority"
+export PGPASSWORD="postgres"
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Started"
+
+/usr/lib/postgresql/14/bin/pg_dump --file "/home/will/dev_new/lifelog.sql" --host "localhost" --port "5433" --username "postgres" --verbose --format=c --blobs --create --column-inserts "lifelog"
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Ended\n"
+
+exit;
--- /dev/null
+#!/bin/bash
+
+if [ -p /dev/stdin ]; then
+ echo -e "STDIN NOT AVAILABLE!"
+else
+ echo -e "STDIN AVAILABLE!"
+fi
--- /dev/null
+#!/bin/bash
+export XDG_RUNTIME_DIR=/run/user/$(id -u)
+export DISPLAY=":0"
+export XAUTHORITY="$HOME/.Xauthority"
+export CRON_DISABLED_STDIN="1"
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Started"
+
+grab=$(curl -X GET 'https://api.openweathermap.org/data/2.5/weather?q=Sydney,NSW,AU&units=metric&appid=2fc5554698ddb34d6a9eedec75b01e2f')
+json=$(echo $grab | jq '{City: .name, Weather:.weather[].description, Temp: .main.temp}')
+echo $json
+formated=$(echo $json | jq -c -j '(.City+" - "+.Weather+ " ", .Temp, " C°\n")')
+~/uvar.sh -n WEATHER -v "$formated"
+
+echo -e $(date +"%d-%b-%Y %T") $(basename $0) "Ended\n"
+
+
+
--- /dev/null
+###
+# Following is the crontab -l of user wbudic (https://github.com/wbudic/wb-shell-scripts)
+# He keeps all the shell cron files handy in his home directory prefixed with 'cron_".
+# These are NOT made chmod +x cron_*, which is handy. And possible under ubuntu and mint Linux systems.
+#
+# m h dom mon dow command
+#*/1 * * * * bash ~/cron_test.sh >> ~/cron.log 2>&1
+0 */1 * * * bash ~/cron_bitcoin.sh >> ~/cron.log 2>&1
+1 */4 * * * bash ~/cron_weather.sh >> ~/cron.log 2>&1
+3 */6 * * * bash ~/cron_exchange_rate.sh >> ~/cron.log 2>&1
+5 */8 * * * bash ~/cron_log_maintainer.sh > /dev/null 2>&1
--- /dev/null
+#!/bin/bash
+#Perl one liner code from: https://geekalicious.academy/2022/01/10/perl-one-liner-directory-tree-maker/
+(DIRMAP="directory-map-$(date +%s).html" && \
+perl -i -spe 's`(?:<a (class="DIR"))[^>]+>([^<]+)</a>`<span $1>$2</span>`g; $edit = 0 if m`</body>`; $edit = 1 if m~<hr>~; s`.*`` if $edit; BEGIN { print qq~[J\033[H\033[J~ }' \
+-- -cmd="$(tree --dirsfirst -CT 'Directory Map' -H './' -o $DIRMAP)" -- $(echo $DIRMAP))
--- /dev/null
+#!/bin/sh
+f=$1;t=$(expr $1 + 5)p;
+sed -n "$f,$t" $2
+#Install in ~/.bashrc -> alias echo_line="~/dev/wb-shell-scripts/echo_line.sh"
\ No newline at end of file
--- /dev/null
+
+#!/bin/bash
+pushd .; cd ~/Videos
+#youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' $1
+yt-dlp $1
+popd
+#Requirements:
+#sudo apt install python3-pip
+#python3 -m pip install -U yt-dlp
+#sudo apt install python3-q-text-as-data ffmpeg
+#
--- /dev/null
+#!/bin/perl
+use strict;
+use warnings;
+use Term::ANSIColor qw(:constants);
+use Term::Screen;
+use Term::Form;
+
+
+my $t = Term::Screen->new();
+my $exited = 0;
+$SIG{'INT'} = sub {
+ print RESET "\n[CTRL]+[C] <- Terminated!\r\n";
+ $t->echo();
+ $t->curvis();
+ $exited=1;
+};
+$| = 1;
+my $pos = $t->rows() - 2;
+$t->at($pos,0);
+my $enters = 0;
+my %opts = (info=>"You are in a perlted line edit buffer (.q(uit)):", clear_screen=>0, color=>1, no_echo=>0, hide_cursor=>0);
+my $new = Term::Form->new();
+my $ln;
+my @buffer=(); my %scratch=();
+my $prompt= ': '; my ($epos,$npos);
+sub list {
+ my $len = scalar @buffer;
+ for (my $i=$len; $i > 0;$i--) {
+ $t->at($pos-1-$i, 0);
+ $t->clreol();
+ my $idx = $len - $i;
+ if ($idx > -1){
+ print 1 + $idx.": ".$buffer[$idx]
+ }else{
+ print "\n"
+ }
+ }
+}
+do{
+ $ln = $new->readline( $prompt, \%opts );
+ if($ln eq ".cls"){
+ $t->clrscr();
+ &list;
+ $t->at($pos-1, 0);
+ }
+ elsif($ln =~ /^.ls*/){
+ &list;
+ $t->at($pos-1, 0);
+ }
+ elsif($ln =~ m/^\.\d+[e|n]$/){
+ $npos = 1 if $ln =~ m/n$/;
+ $ln =~ /(\d+)/;
+ my $i = $1; $prompt = "$i:"; $epos = $i-1;
+ $opts{'default'} = $buffer[$epos];
+ }
+ elsif($prompt ne ': '){
+ $buffer[$epos] = $ln;
+ if($npos && $epos < $enters){
+ $prompt = "$epos:";
+ $epos++;
+ $opts{'default'} = $buffer[$epos];
+ }
+ else{
+ $prompt = ': '; $opts{'default'} ="";
+ }
+ &list;
+ $t->at($pos-1, 0);
+ }
+ elsif($ln =~ m/^\.\d*.*\dd$/){
+ $ln =~ /^\.(\d+)|([\.\,]*\s*)(\d+)d$/;
+ my $i = $1; $prompt = "$i:"; $epos = 0;
+ $scratch{".$i"} = $buffer[--$i];
+ $opts{'default'} =""; $prompt = ': ';
+ $opts{'info'} ="Scratch bufferd line .".$i."d contents.";
+ $enters=@buffer-1;
+ for(my $j=$enters+1;$j>$i;$j--){
+ $t->at($pos-1-$j, 0); $t->clreol();
+ }
+
+
+ my @s = splice @buffer, 0, $i;
+ if($i!=$enters){
+ my @r = splice @buffer, $i, $enters;
+ push(@s, @r);
+ }
+ @buffer = @s;
+ &list;
+ $t->at($pos-1, 0);
+ }
+ elsif($ln eq '.d'){
+ $enters=@buffer-1;
+ $t->at($pos-$enters-2, 0); $t->clreol();
+ $scratch{".d"} = pop @buffer;
+ &list;
+ $t->at($pos-1, 0);
+ }
+ elsif($ln ne ".q"){
+ push (@buffer, $ln);
+ &list;
+ $t->at($pos-1, 0);
+ }
+}while($ln ne '.q');
+$t->echo(); $t->curvis(); undef $t;
+
+print '-' x 80 . "\n";
+print join ("\n", @buffer) ."\n";
+print '-' x 80 . "\n";
+
+
+1;
\ No newline at end of file
--- /dev/null
+#!/bin/perl
+
+my @N=();
+
+&pickSix for 1..28;
+
+sub pickSix{
+ $N[$_] = &uniqueRandom for 0..5;
+ @N = sort {$a <=> $b} @N;
+ print join(", ", @N), "\n";
+}
+sub uniqueRandom {
+ my $num; my $l;
+ do{
+ $l=0; $num = 1 + int rand 45;
+ for (0..5){if($N[$_]==$num){$l=1;last}}
+ }while($l);
+return $num;
+}
--- /dev/null
+#!/bin/perl
+use 5.10.0;
+use strict;
+use warnings;
+use Term::ANSIColor qw(:constants);
+use Term::Screen;
+use Term::Form;
+
+my ($pid, $ret, $parent);
+state @buffer = ();
+use POSIX 'isatty';
+
+print "stdin_isatty:".isatty(*STDIN)."\n";
+if (!isatty(*STDIN)){
+ while(my $ln = <>){
+ chomp($ln);
+ push @buffer, $ln;
+ }
+
+}
+
+if(!defined($pid = fork())) {
+ # fork returned undef, so unsuccessful
+ die "Cannot fork a child: $!";
+} elsif ($pid == 0) {
+ print "Printed by child process isatty:".isatty(*STDIN)."\n";
+ my $ln = <>;
+ print"[$ln]\n";
+ exec("date") || die "can't exec date: $!";
+} else {
+ # fork returned 0 nor undef
+ # so this branch is parent
+ print "Printed by parent process\n";
+ $ret = waitpid($pid, 0);
+ print "Completed process id: $ret\n";
+}
+
+sub addDone{
+ my $pid = shift;
+ print "Process $pid called\n"
+}
+my $THD;
+open($THD, "+<", "/dev/tty") or die "no tty: $!";
+while(my $ln = <$THD>){
+ chomp($ln);
+ last if $ln eq ".";
+}
+close $THD;
+
+
+print '-' x 80 . "\n";
+print join ("\n",@buffer)."\n";
+print '-' x 80 . "\n";
+
+1;
\ No newline at end of file
--- /dev/null
+## Compile installing vim
+```
+sudo apt install libtool-bin libncurses-dev libxt-dev -y
+
+cd ~/dev
+git clone https://github.com/vim/vim.git
+cd vim/src
+./configure --with-features=huge --enable-multibyte --enable-perlinterp=yes --enable-cscope
+make
+make test
+sudo make install
+```
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+SELPID=`ps -u $USER -o pid,%mem,%cpu,command | sort -b -k2 -r | sed -n '1!p' | dmenu -i -b -l 25 | awk '{print $1,$4}'`;
+echo $SELPID;
+if [ ! -z "$SELPID" ]; then
+ sudo kill -9 `echo $SELPID| awk '{FIELDWIDTHS = " 1"} {print $1}'`
+fi
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use DateTime; print DateTime->now()->set_time_zone("Europe/Belgrade")->strftime("Belgrade - %x %H:%M:%S"),"\n";
+#perl -MDateTime -E 'say DateTime->now()->set_time_zone("Europe/Belgrade")->strftime("%x %H:%M:%S")'
+
+
+&fzf unless @ARGV;
+
+sub fzf {
+
+my $lst = 'Cancel\n Europe/Belgrade\n Europe/Berlin\n Europe/London\n America/New_York\n America/Los_Angeles\n Australia/Sydney';
+my $cmd = qq(
+ echo '$lst'|~/.fzf/bin/fzf
+ --no-multi --cycle --height=12 --border --margin 1,1% --pointer='->' --color=dark --print-query
+ --info=inline --header='<- Please select your timezone. Check out your, ^ arrow, PgUp, PgDwn, and ESC key.'
+);
+ $cmd =~ s/[\n\r\t]//g;
+ my $sel=`$cmd`;
+ $sel =~ s/\s//g;
+ if($sel && $sel ne "Cancel"){
+ print DateTime->now()->set_time_zone($sel)->strftime("$sel - %x %H:%M:%S"),"\n";
+ }else{
+ exit;
+ }
+
+}
+
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Term::ANSIColor 2.01 qw(:constants colored);
+use Term::Screen;
+
+my ($sta,$end) = (time,undef);#my $end = $sta + 15*60;
+my ($time, $cmd);
+
+our @pos = getCPos();
+our $exited = 0; my $row = $pos[0]; my ($title,$tlo);
+our $t = Term::Screen->new();
+local $SIG{'INT'} = *interupt;
+$t->at($row,0)->clreol();
+
+if( scalar @ARGV > 0 ){
+ printf "\rActivated count down timer($$)...(Use CTRL+C to terminate!)\n";$row+=2;
+ foreach my $arg(@ARGV){
+ if ($tlo) {
+ undef $tlo; $title=$arg;
+ $row++;
+ print BOLD "\rTimer:", BRIGHT_BLUE, ON_BRIGHT_BLACK," $title \n", RESET
+ }
+ elsif ( $arg =~ /^\d+/ ) {
+ $end = $sta + $arg * 60;
+ print "\rCountdown set to minutes: $arg\n";
+ }
+ elsif ( $arg =~ /^-+t.*/ ) {
+ $tlo = 1;
+ }
+ elsif ( $arg =~ /^-+f.*/ ) {
+ &fzf;
+ }
+ elsif ( $arg =~ /^-+[^0-9]+/ ) {
+ $t->at($row-3,0)->clreol();undef $t;
+ while (<DATA>) {print transPrint($_)}
+ exit;
+ }
+ else {
+ $cmd = $arg;
+ print "\rCommand to run after -> $cmd\n";
+ $row++;
+ }
+ }
+}
+
+# Hey, let's do some Perl Language only available ANSI magic.
+my $cur_col;
+sub transPrint { my $ln = shift;
+ if($ln =~ /<\/*.*>/){
+ ($ln=~/(.*)<(.*)>(.*)<\/*(.*)>(.*)/);
+ if($2){
+ print $1, colored([$2], $3), $5, "\n" if length($2)>1;
+ undef $cur_col;
+ }else {
+ ($ln=~/<\/*(.*)>(.*)|(.*)<\/*(.*)>/);
+ if($4){
+ print colored([$cur_col], $3), "\n";
+ undef $cur_col;
+ }else{
+ $cur_col=$1;
+ print colored([$cur_col], $2), "\n"
+ }
+ }
+ }
+ elsif($cur_col){print colored([$cur_col], $ln)}
+ else{print $ln;}
+return
+}
+
+&fzf unless $end;
+
+my $stopwatch = time;
+my ($tt, $ptime, $stoptime, $tc,$cur,$sur) = 0;
+my ($stop,$stop_countdown) = (0,0);
+$t->at($row, 0)->curinvis(); die "Time not specified!" unless $end;
+
+while() {
+ $time = time;
+ last if ($time > $end);
+
+ $cur = $end - $time unless $stop_countdown;
+ $sur = $time - $stopwatch unless $stop;
+ $t->flush_input();
+ $t->clreol();
+ my $stmp1 = sprintf("%02d:%02d:%02d", $cur/(60*60), $cur/(60)%60, $cur%60);
+ $stmp1=~s/^\d//;
+ my $stmp2 = sprintf(" [%02d:%02d:%02d]", $sur/(60*60), $sur/(60)%60, $sur%60);
+ $stmp2=~s/^\d//;
+
+ if (($cur/(60)%60)>1){
+ print YELLOW "\rTimer-> ", ON_BRIGHT_BLACK, BOLD, CYAN, " $stmp1 ", RESET, GREEN, $stmp2, RESET unless $stop_countdown;
+ }else{
+ $tc=0 if $tc++>3;
+ if (($cur%60)<2){
+ print BOLD, GREEN, "\rTIMER ", "---> ", $stmp1, RESET, GREEN, $stmp2, RESET;
+ }else{
+ print RED "\rTimer ", BOLD;
+ if($tc==0){print YELLOW, "-", RED, "--"}
+ elsif($tc==1){print "-", YELLOW, "-", RED, "-"; print chr(7)}
+ elsif($tc==2){print "--", YELLOW, "-"}
+ else{print "---", YELLOW}
+ print "> ", RED, $stmp1, RESET, GREEN, $stmp2, RESET;
+ }
+ }
+
+ if($exited){exit 1}
+ if($t->key_pressed(1)){
+ my $ch = $t->getch(); $t->at($row,30);
+ if($ch eq 'p'){
+ $stop_countdown =$stop_countdown?0:1; $stop=0;
+ print RED, BLINK, " Countdown -> ".($stop_countdown?"Paused":"Running")."!", RESET;
+ if($stop_countdown){$stoptime = time}
+ else{$end += time - $stoptime;}
+ }else{
+ $stop = $stop?0:1;
+ print RED " Stopwatch -> ".($stop?"Paused":"Running")."!";
+ if($stop){$stoptime = $stopwatch = $sur}
+ else{$stopwatch = time -$stoptime}
+ }
+ }else{
+ $ptime = `date '+%r'`;
+ $ptime =~ s/\n$//;
+ print MAGENTA, " Local Time: $ptime", RESET unless $stop_countdown |$stop;
+ }
+}
+
+$t->curvis()->normal()->clreol();$title=$$ unless $title;
+my $msg = "Timer '$title' has expired!";
+
+`/usr/bin/notify-send "TIMER $title" "$msg"&`;
+
+$ptime = `date '+%r'`; $ptime =~ s/\n$//;
+print BRIGHT_RED, BLINK, "\r$msg [ $ptime ]\n", RESET;
+
+if($cmd){
+ $t->echo();
+ system('echo "\e[?25h"');
+ print YELLOW "\rResult of ->`".$cmd, "` is:\r\n";
+ my @res = qx/$cmd/;
+ foreach my $l(@res){
+ $l =~ s/\n*$//;
+ print RESET $l, "\r\n";
+ }
+}else{ #MODIFY BELLOW TO DESIRED ALARM, or move the provided ./chiming-and-alarm-beeps.wav to your Music folder.
+ system("mpv --vid=no --loop-file=3 $ENV{HOME}/Music/chiming-and-alarm-beeps.wav > /dev/null");
+ $row-=5 if $row>$t->rows();
+ $t->at($row+1, 0)->clreol()->at($row, 0); print BRIGHT_RED, "\r$msg [ $ptime ]", RESET;
+ system('echo "\e[?25h"');
+ $t->dl()->at($row+1, 0)->clreol()->echo()->curvis();
+}
+exit 1;
+
+sub fzf {
+
+my $lst = 'Cancel\n 3m\n 5m\n 10m\n 15m\n 20m\n 25m\n 30m\n 40m\n 45m\n 50m\n 60m\n 90m\n 1h\n 2h\n 3h\n 4h\n 3s\n 10s\n 30s';
+my $cmd = qq(
+ echo '$lst'|~/.fzf/bin/fzf
+ --no-multi --cycle --height=12 --border --margin 1,1% --pointer='->' --color=dark --print-query
+ --info=inline --header='<- Please select your desired timeout. Check out your, ^ arrow, PgUp, PgDwn, and ESC key.'
+);
+ $cmd =~ s/[\n\r\t]//g;
+ my $sel=`$cmd`;
+ $sel =~ s/\s//g;
+ if($sel ne "Cancel"){
+ $sta = time;
+ if($sel =~ m/m$/){
+ $sel =~ s/m$//;
+ print "Setting timer($$) to $sel minutes.\n";
+ $end = $sta + $sel * 60;
+ }
+ elsif($sel =~ m/h$/){
+ $sel =~ s/h$//;
+ print "Setting timer($$) to $sel in hours.\n";
+ $sel *= 60;
+ $end = $sta + $sel * 60;
+ }elsif($sel =~ m/s$/){
+ $sel =~ s/s$//;
+ print "Setting timer($$) to $sel in seconds.\n";
+ $end = $sta + $sel;
+ }
+ else{
+ exit 1;#<- should not be possible!
+ }
+ }else{
+ exit;
+ }
+ return $t->at($row-=5, 0)
+}
+sub interupt {
+ $exited=1;
+ system('echo "\e[?25h"');#sleep 1;
+ $row+=1;
+ $t->at($row, 0)->clreos()->echo()->curvis();
+ print RESET, "[CTRL]+[C] <- Terminated!\r\n";
+ exit 0;
+};
+
+
+#Following fckn sub took me two days to figure out.
+sub getCPos {
+my $x=q!
+exec < /dev/tty
+oldstty=$(stty -g)
+stty raw -echo min 0
+printf "\033[6n" > /dev/tty
+sleep 0.5
+IFS=';' read -r row col
+stty $oldstty
+row=$(expr $(expr substr $row 3 99) - 1) # Strip leading escape off
+col=$(expr ${col%R} - 1) # Strip trailing 'R' off
+echo $col,$row
+!;
+$x=qx($x);
+return reverse split ',', $x;
+}
+__END__
+
+<bold>THE BEST COUNTDOWN TIMER</bold>
+ by Will Budic (https://github.com/wbudic/wb-shell-scripts)
+
+<green bold>Syntax</green on_black>:
+
+$ <bold>./timer.pl</bold> {minutes} {shell_cmd} {-t 'Title of instance'}
+
+<yellow>Without any arguments, it uses the fzf utility to prompt for minute period.
+Modify line containing mpv path in script to include own alarm/music to play as default on timer expiry.
+Scroll above this script to line: 146
+System bells are unacceptable.</yellow>
+
+Also, you can now pause, for what ever reason the countdown, by pressing 'p'.
+
+<green bold>Requirements</green>:
+fzf (don't use apt to install, can be crap old version,
+ install manually for vim and from your home, and symbolik link)
+i.e. ln -s ~/.fzf/bin/fzf ~/.local/bin/fzf
+sudo apt install mvp
+Install in .bashrc alias to path (mine is):
+alias timer="~/timer.pl"
+Install chime or alarm to play:
+cp ./chiming-and-alarm-beeps.wav ~/Music/chiming-and-alarm-beeps.wav
+---
--- /dev/null
+#!/usr/bin/env bash
+# uvar.sh - Creates a User Variable that is persisted between shell invocations or when ever its value changes.
+
+function help(){
+cat <<EOF
+
+* User Variable Utility *
+
+User variables once are persisted and always available for the current user.
+Making them gloabal named values to sessions, between logins and subsequent bash calls or shells.
+
+--- Options ---
+-n - Name of variable
+-v - Value to assign.
+-e - Option turns environmental variable into a user variable or error if not defined.
+-r - Read named variable.
+-l - List all the available user variables.
+-o - Output only the value of named variable, pipes out piped in.
+-d - Delete the named uvar.
+-s - Alternative store location (not recommended option to use).
+ Default store location is ~/.config.
+ Setting it to $0 -s /var/tmp will store to temporary storage that is volatile memory.
+-f - Copy file into an named uvar. i.e. uvar -n MY_FILE -f some_sile.ext.
+
+Usage: $0 {-o,-l} -n {name} -v {value} -r {name} {value}
+$0 {name}
+$0 {name} {value}
+$0 -l
+
+---
+Uvar's are persisted as ~/.config/.uvar_* type of files.
+Get this scripts latest version at -> https://github.com/wbudic/wb-shell-scripts
+-----------------------------------------------------------------------------------------
+
+Terminal Shenanigans:
+
+? "SEXY TIME!" | uvar -n COFFEE_TIME <- Will silently set the value via pipe.
+? "SEXY TIME!" | uvar -o -n COFFEE_TIME | cat <- Will set the value and pipe it further out.
+uvar -o -n COFFEE_TIME | cat <- Will read the uvar COFFEE_TIME and pipe it further out.
+
+The '?' above is alias ? 'echo ' set in ~/.bashrc
+
+YOU@terminal:~$ uvar -o -n TEST << _end_
+Eating just three eggs a week increases risk of dying young, study.
+_end_
+Eating just three eggs a week increases risk of dying young, study.
+
+YOU@terminal:~$ uvar -n TEST << _end_| xargs -n1 | sort | xargs
+Eating just three eggs a week increases risk of dying young, study.
+_end_
+YOU@terminal:~$ uvar TEST
+a dying Eating eggs increases just of risk study. three week young,
+
+EOF
+exit;
+}
+#20211102 Disabled following stdin pipe checking [[ ! -t 0]]] before,
+# as it rises access errors in cron jobs.
+[[ -z $CRON_DISABLED_STDIN ]] && [[ ! -t 0 ]] && value=$(</dev/stdin)
+
+function readUVAR(){
+var=$STORE/.uvar_$1;
+if [ -f $var ]; then
+ var=$(<$var);
+ echo -e "$var";
+fi
+exit;
+}
+function writeUVAR(){
+[[ -z "$print" ]] && echo -e "$1=$2"
+echo -e "$2" > $STORE/.uvar_$1
+if (( $(grep -c . <<<"$2") < 2 )); then
+ export $1="$2";
+fi
+[[ "$print" -eq "1" ]] && echo "$2"
+exit;
+}
+function list(){
+for file in $STORE/.uvar_*
+do
+#echo $file
+n=$(echo $file | sed "s/$EXP//")
+if [[ -f $file ]]; then
+ v=$(awk '{if (NR<6) print}END{if(NR > 5) \
+ print "---> THE VALUE DISPLAY OFF HAS BEEN CUT AT LINE 5 FOR [" ARGV[1] "] <---\n\n"}' \
+ $file)
+ echo -e "$n=$v"
+fi
+done
+}
+function delUVAR(){
+ val=$STORE/.uvar_$1;
+if [ -f $val ]; then
+ rm -f "$val";
+ echo -e "Deleted $val";
+else
+ echo -e "Not found $val";
+fi
+exit;
+}
+
+STORE=$HOME/.config;
+EXP=".*config\/.uvar_"
+
+argc=$#
+argv=("$@")
+print=0
+
+while getopts ":e:d:r:n:v:s:f:lo" opt
+do
+ case "${opt}" in
+ s) if [[ -d "${OPTARG}" ]]; then
+ if [[ ${OPTARG} =~ ^\/ ]]; then
+ export STORE=${OPTARG}/${USER}; [[ ! -d $STORE ]] && mkdir $STORE
+ else
+ STORE=${OPTARG}
+ fi
+ EXP=`echo "$STORE" | sed -e "s:\/:\\\\\/:g"`
+ EXP=".*$EXP\/.uvar_";# echo -e "[[[[$EXP]]"
+ [[ $? > 0 ]] && echo "Err: $? with store location: $STORE" && STORE=$HOME/.config
+ else
+ echo -e "Err: Invalid store location: ${OPTARG}"
+ fi;;
+ n) name=${OPTARG};;
+ v) value=${OPTARG};;
+ r) readUVAR ${OPTARG};;
+ l) list;;
+ f) [[ -f $STORE/.uvar_$name ]] && $(rm -f $STORE/.uvar_$name);
+ while read line; do
+ echo -e "$line" >> $STORE/.uvar_$name
+ done <${OPTARG}
+ exit;;
+ d) delUVAR ${OPTARG};;
+ o) print="1";;
+ e) envnam=$OPTARG
+ value=`printenv ${envnam}`
+ echo "[[[$envnam = $value]]]]"
+ if [[ -z "$value" ]]; then
+ echo "Environment variable is not set: $OPTARG."
+ exit 1
+ else
+ writeUVAR "$envnam" "$value"
+ fi
+ ;;
+ :) echo "Invalid option: $OPTARG, requires an argument.";;
+ \?) help;;
+ esac
+done
+
+[[ -n $value ]] && [[ -n name ]] && writeUVAR "$name" "$value"
+# So fall through, when no options issued or have been shifted out:
+[[ -n $name ]] && readUVAR $name
+[[ $# -eq 1 ]] && readUVAR $1;
+if [[ $# > 1 ]]; then
+ name=$1; shift; value="$@"
+ writeUVAR $name "$value"
+fi
+exit;
\ No newline at end of file
--- /dev/null
+#!/usr/bin/perl -w
+#
+# vim open fuzzy find selected list of files, with many options.
+# by default filters for *.sh, *.txt, *.pl.
+#
+# Programed by: Will Budic
+# Open Source License -> https://choosealicense.com/licenses/isc/
+#
+use v5.10;
+use strict;
+use warnings;
+
+use IPC::Run qw( run );
+
+my $TITLE = "FILE SELECTOR FOR VIM v.2.1";
+
+my (@VIM, @vim_arguments, @ext_arguments , @prn_arguments) = (("vim"), (),(),());
+my $HOME = $ENV{'HOME'};
+my $PRNS = "-path '$HOME/.' -o -path '$HOME/.cpan'";
+my $EXTS = '-iname "*.sh" -o -iname "*.txt" -o -iname "*.pl" -o -iname "*.cnf" -o -iname "*.config" -o -iname "*.cgi" ! -name ".*"';
+my $NOTS = '-path "*/go/*" -o -path "*/goroot/*" -o -path "*/.cache/*" -o -path "*/Steam/*" -o -path "*/.vscode/*" -o -path "*/.history/*"';
+my $help = qq(
+$TITLE
+
+Syntax: $0 {_} {-vim_option}... \${ext_name}... !{path}... +{path}...
+
+This utility helps to preselect, filter and find files to open with the vim text editor.
+To select a desired and searched file to be opened, use the [TAB] key.
+By default this program will filter for *.sh, *.txt, *.pl and *.py type of file extensions in your home directory.
+See bellow further available argument options, to go beyond the basics and extend your search selection.
+
+Argument Options:
+
+Use the {_} option, is to instruct to open in vim into open_in_vim_tabs selected files or file.
+Use the {@} dir_path, to directly open inside vim the the whole search of files. Not a wise thing to do on a large directory structure.
+Use {!}{path}, to exclude whole folder paths from to be displayed.
+ i.e. !Videos !Music/lyrics - Will not search for files and folders to display in the ~/Videos and ~/Music/lyrics folders.
+
+The {+}{path} option will search further addional folder paths for you. These have to be valid and accessible.
+
+The {^}{ext} option is instruction which extension(s) to search for, and not use the defaults.
+ i.e ^.txt - Will search only by extension name for text files.
+ i.e ^.c ^cpp - Will search only for c and cpp source files.
+
+
+Usage Examples:
+
+To find to select and open in open_in_vim_tabs with read only mode text files:
+ $0 _ -R txt
+
+To find and open selected files in buffers, by extension type of *.c, *.sh and *.pl:
+ $0 _ c sh pl
+To buffer open all found by default extensions:
+ $0 @ .
+);
+my $PATHS = $HOME; my ($select_all,$cmd) = (0,"");
+processArguments();
+$cmd = "find -H $PATHS \\( $PRNS \\) -a -type d -prune -o -type f \\( $EXTS \\) -a ! \\( $NOTS \\) ";
+
+if($select_all){
+ $cmd .= '| sort -n';
+}
+else{
+ $cmd .= "| fzf -m --tac --preview 'batcat --color=always {}'"
+}
+ $cmd =~ s/\s+/ /g;
+my $lst = qx($cmd);
+my @lst = split(/\n/, $lst);
+print "\nFile selector -> [$cmd]\n";
+print "VIM arguments -> ".join (' ', @VIM)."\n";
+if(@lst>0){
+ foreach(@lst){
+ push @VIM, $_;
+ }
+ print join (' ', @VIM), "\n";
+ ###
+ run \@VIM;
+ ###
+}else{
+ print "$0 has been abruptly terminated.\n"
+}
+
+sub processArguments {
+ my ($open_in_vim_tabs, $translate, $explicit) = (0, "", 0);
+ if (@ARGV>0) {
+ foreach my $argument(@ARGV){
+ #print "{{{$argument}}}";
+ if($argument =~ /~/){
+ die '~'
+ }elsif($argument eq '@'){
+ $select_all = 1; print "\nAll found files will be vim buffered.";
+ $PATHS = $ENV{'PWD'};
+ next;
+ }elsif($argument eq '.'){
+ print "\nLocal directory type scan from ", $ENV{'PWD'};
+ $PATHS = $ENV{'PWD'};
+ next;
+ }
+
+ if($argument =~ /^\-/){
+ if($argument=~/(^\-*\?)/){
+ print $help;
+ exit;
+ }
+ push @vim_arguments, $argument;
+ }elsif($argument =~ /^_/){
+ $open_in_vim_tabs = 1;
+ }elsif($argument ne $ENV{'HOME'}){
+ if($argument=~/^\^\w+/ ){
+ print "\nTranslating ext -> $argument\n";
+ $translate = substr $argument,1; $translate = $translate = substr $argument, 2 if $translate =~ /^\*/;
+ push @ext_arguments, "-iname *.\"$translate\" -o";
+ }elsif($argument=~/^E\:\w+/ ){
+ print "\nTranslating ext -> $argument\n";
+ $translate = substr $argument, 2; $translate = $translate = substr $argument, 2 if $translate =~ /^\*/;
+ push @ext_arguments, "-iname *.\"$translate\" -o";
+ }
+ elsif($argument=~/^P\:(\/)*\w+/){
+ $translate = substr $argument, 2;
+ $translate =~ s/\/$//;
+ print "\nTranslated folder path to prune '$argument' to -> $translate";
+ if(not -e $translate){
+ print "\nWARNING! The translated prune path for '$argument' as folder doesn't exsist -> $translate, prepending slash to autofix.\n";
+ $translate = '/'.$translate; $translate =~ s/\/\//\//;
+ if(not -e $translate || not -d $translate){
+ $translate = "$HOME/$translate";
+ print "\nWARNING! The translated path for '$argument' resolved to -> $translate.";
+ }
+ die "\nERROR Resolved -> $translate is not a valid path!\n" if(not -d $translate);
+ }
+ if(not -d $translate){
+
+ }
+ push @prn_arguments, "-path \"$translate\" -o";
+ }
+ elsif($argument=~/^A\:(\/\/)*\w+/i){ die "Error, not a full path '$argument', we are very, very, sorry." if $argument !~/^A\:\/\w+/;
+ print "\nTranslating additional folder path to search -> $argument\n";
+ $translate = substr $argument, 2;
+ if(not -e $translate){
+ die "\nERROR!$!\nThe translated path for '$argument' as folder doesn't exsist -> $translate."
+ }
+ else{
+ $PATHS .= ' '.$translate;
+ }
+ }
+ elsif($argument=~/^\w+\./){
+ print "\nIgnoring -> $argument\n";
+ next;
+ }
+ elsif($argument=~/^\*/){
+ print "\nWARNING! Not a valid syntax -> $argument, if it is an extension, you do not need a wildcard prefix.";
+ push @ext_arguments, "-iname \"$argument\" -o";
+ }
+ elsif($argument=~/^\//){ #explicit path requested, don't home in too, you mf.
+ if($explicit){$PATHS .= ' '.$argument}else{$PATHS = $argument; $explicit = 1}
+ }
+ else{
+ print "\nTranslating argument as file extension -> *$argument\n";
+ push @ext_arguments, "-iname \"*.$argument\" -o";
+ }
+ }
+ }#rof
+ }
+ #$PRNS = "-path '$ENV{'HOME'}/.' -o -path '$ENV{'HOME'}/.cpan'";
+ if (@prn_arguments > 0){
+ $PRNS = join (' ', @prn_arguments); $PRNS =~ s/ \-o$/ /;
+ }
+ if (@ext_arguments > 0){
+ $EXTS = join (' ', @ext_arguments); $EXTS =~ s/ \-o$/ /;
+ }
+ push @vim_arguments, "-p" if $open_in_vim_tabs;
+ push @VIM, @vim_arguments;
+}
+1;
+__DATA__
+The original of this file is from:
+https://github.com/wbudic/wb-shell-scripts
+It is not advised to use this utility, if from there can't compare.
--- /dev/null
+#!/bin/perl
+use strict;
+use warnings;
+use POSIX 'isatty';
+#Intersect piped input with vim for editing and further output.
+if (isatty(*STDIN)){
+ print "No STDIN piped in, enter it then manually, end feed with ctrl+d!\n"
+}
+my $stm = `date +\%s`; $stm =~ s/\n$//;
+my $tmp = ".__tmp__vimpiped_$stm.tmp";
+my $lmd = `cat > $tmp; stat --printf='%z' $tmp`;
+####################################################################
+
+system("vim -n $tmp < /dev/tty > /dev/tty");
+
+####################################################################
+# ~ Notice !
+# If it was a quit in vim, there is no modifications of the STDIN.
+# i.e. an :wq was not issued. We then don't pipe nothing further out.
+#
+if($lmd ne `stat --printf='%z' $tmp`){
+ my $THD;
+ open($THD, "<", $tmp) or exit 0;
+ while(<$THD>){print STDOUT $_}
+ close $THD;
+
+}
+system("rm $tmp");
+exit 1;
\ No newline at end of file
--- /dev/null
+#!/bin/perl
+# XSPELL program by Will Budic.
+#Requirments:
+#sudo cpan install Clipboard
+#sudo cpan install Term:Menus
+use Clipboard;
+use Term::Menus;
+my ($w,$spell)=@ARGV;
+if (!$w){
+ print "\e[31m\e[1mError ->\e[0m You didn't include which word to xspell.\nEnter -h for help.\n";
+ exit 0;
+}elsif($w=~/^-/){
+print qq/
+\e[96m\e[1mXSPELL v.2.0\e[0m\e[94m
+
+Spellcheck and copy to system clipboard some complicated word.
+---------------------------------------------------------------------\e[0m
+This program uses aspel to spell check a provided word.
+If the word is correct, it will also provide you its dictionary
+definintion before exiting.
+Examples:
+
+\e[94m$0 \e[92m{word}\e[0m
+Will spell check and copy only the word,
+
+and if correct will display definition.
+If incorrect will provide you with alternatives.
+
+\e[94m$0 \e[92mspell {word}\e[0m
+Will spell check and correct the word for you.
+Try:
+>\$ $0 gnnarly
+---------------------------------------------------------------------\e[0m
+/;
+exit 0;
+}
+$w=$spell if $spell;
+my $list = `echo \"$w\" | aspell -a`;
+my $banner =qq(
+The following list of alternatives for [$w],
+will been copied to clipboard however,
+maybe you want to select the right word from bellow.
+To cancel press [ctrl-c], and nothing will be copied:
+);
+if($list=~/\*$/gm) {
+ copy($w);
+ exec("curl dict://dict.org:/d:\"$w\":* | less");
+}
+else{
+ $list=~s/^(.*\s+)*0:\s*//; $list=~s/\s*$//;
+ my @lst = split(', ',$list);
+ if($spell){
+ copy($lst[0]);
+ }else{
+ my $sel=&pick(\@lst,$banner);
+ if($sel ne "]quit["){
+ copy($sel)
+ }else{
+ copy($list)
+ }
+ }
+}
+
+sub copy{
+ $w = shift;
+ Clipboard->copy_to_all_selections($w);
+ print "Copied to clipboard -> [$w]\n";
+}
+1;