-Subproject commit e2a56e5d54d7fd05f0ec51ee27737d411a05655c
+Subproject commit 4c954717c286c85f491907c90822975c8f26d568
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-02-08T22:21Z
-
-# Author: Steven Baltakatei Sandoval
-
-# License: This bash script, 'bkcc', is licensed under GPLv3 or
-# later by Steven Baltakatei Sandoval:
-#
-# 'bkcc', a Creative Commons HTML tag generator.
-# Copyright (C) 2020 Steven Baltakatei Sandoval (baltakatei.com)
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# A copy of the GNU General Public License may be found at
-# <https://www.gnu.org/licenses/>.
-#
-# The structure of this script was modeled after the following
-# Creative Commons license choosers:
-#
-# https://creativecommons.org/choose/
-# https://chooser-beta.creativecommons.org/
-
-# Description: bkcc - A tool that creates a machine-readable (RDFa
-# XML) Creative Commons license tag. The tag is generated using
-# information prompted from the user and exported to stdout.
-
-# Usage: bkcc [ OPTIONS ]
-
-
-#==DEFINITIONS==
-
-# regular expression for identifying valid URLs (source: http://regexlib.com/REDetails.aspx?regexp_id=1051 )
-regexURL="((http\://|https\://|ftp\://)|(www.))+(([a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9%:/-_\?\.'~]*)?"
-
-# Define 'echoerr' function which outputs text to stderr
- # Note: function copied from https://stackoverflow.com/a/2990533
-echoerr() {
- echo "$@" 1>&2;
-}
-
-promptAttribute() {
- ###echoerr "Note: RECOMMENDED options promote \"Free Cultural Works\" as defined by creativecommons.org"
- echoerr "======================================================="
- echoerr "Do you want to require attribution for your work? (y/n)"
- echoerr " y) Yes, anyone using my work must give me appropriate credit (RECOMMENDED)."
- echoerr " n) No, anyone can use my work even without attribution."
- read m
- case $m in
- y | Y | yes | 1) OPTION_BY="true";;
- n | N | no | 2)
- echoerr "======================================================="
- echoerr "I hereby waive all copyright and related or neighboring rights together with all"
- echoerr "associated claims and causes of action with respect to this work to the extent"
- echoerr "possible under law according to"
- echoerr "https://creativecommons.org/publicdomain/zero/1.0/ ."
- echoerr ""
- echoerr "I have read and understood the terms and intended legal effect of CC0, and"
- echoerr "hereby voluntarily elect to apply it to this work (y/n):"
- read m
- case $m in
- y | Y | yes | 1) OPTION_BY="false";
- echoerr "DEBUG: OPTION_BY set to $OPTION_BY"
- return 1
- ;;
- n | N | no | 2) echoerr "No license selected. Exiting."; exit 1;;
- *) echoerr "Invalid CC0 release option. Exiting."; exit 1;;
- esac ;;
- *) echoerr "Invalid attribution requirement option. Exiting."; exit 1;;
- esac
-}
-
-promptCommercial() {
- echoerr "======================================================="
- echoerr "Do you want to prohibit others commercial use of your work? (y/n)"
- echoerr " y) Yes, others cannot use my work for commercial purposes."
- echoerr " n) No, others can use my work for commercial purposes (RECOMMENDED)."
- read m
- case $m in
- y | Y | yes | 1) OPTION_NC="true"; echoerr "DEBUG: OPTION_NC set to $OPTION_NC";;
- n | N | no | 2) OPTION_NC="false"; echoerr "DEBUG: OPTION_NC set to $OPTION_NC";;
- *) echoerr "Invalid commercial use permission option. Exiting."; exit 1;;
- esac
-}
-
-promptDerivatives() {
- echoerr "======================================================="
- echoerr "Do you want to prohibit others from distributing your work if they remix, transform, or build upon it?"
- echoerr " y) Yes, others can use and share my work only as is, without modifications."
- echoerr " n) No, others may share modified versions of my work (RECOMMENDED)."
- read m
- case $m in
- y | Y | yes | 1) OPTION_ND="true"; echoerr "DEBUG: OPTION_ND set to $OPTION_ND";;
- n | N | no | 2) OPTION_ND="false"; echoerr "DEBUG: OPTION_ND set to $OPTION_ND";;
- *) echoerr "Invalid derivative use permission option. Exiting."; exit 1;;
- esac
-}
-
-promptShareAlike() {
- echoerr "======================================================="
- echoerr "Do you want to prohibit your work under other terms?"
- echoerr " y) Yes, anyone who changes your work must share their contributions under the same license as the original. (RECOMMENDED)"
- echoerr " n) No, anyone who changes your work can distribute their contributions under a different license."
- read m
- case $m in
- y | Y | yes | 1) OPTION_SA="true"; echoerr "DEBUG: OPTION_SA set to $OPTION_SA";;
- n | N | no | 2) OPTION_SA="false"; echoerr "DEBUG: OPTION_SA set to $OPTION_SA";;
- *) echoerr "Invalid sharealike requirement option. Exiting."; exit 1;;
- esac
-}
-
-promptLicenseDetails() {
- # Usage: promptLicenseDetails
- # Description: Sets LICENSE_TYPE by questioning user.
-
- echoerr "DEBUG: Beginning promptLicenseDetails function."
-
- # Evaluate BY option.
- # Ask if author wishes to be attributed.
- promptAttribute # set OPTION_BY to true or false.
- if [[ $OPTION_BY == "false" ]]; then
- LICENSE_TYPE="CC 1.0"
- echoerr "DEBUG: LICENSE_TYPE set to $LICENSE_TYPE"
- return 1;
- fi
-
- # Evaluate NC option.
- # Ask if author permits commercial use of work.
- promptCommercial # set OPTION_NC to true or false.
-
- # Evaluate ND option.
- # Ask if author permits derivative use of work.
- promptDerivatives # set OPTION_ND to true or false.
-
- # Evaluate SA option.
- # Ask if author requires derivative works to also carry same license as work.
- if [[ $OPTION_ND = "true" ]]; then
- OPTION_SA="false" # An SA work cannot be made from an ND work.
- else
- promptShareAlike # set OPTION_SA to true or false.
- fi
-
- # Check for CC BY
- if [[ $OPTION_BY == "true" ]] && \
- [[ $OPTION_NC == "false" ]] && \
- [[ $OPTION_ND == "false" ]] && \
- [[ $OPTION_SA == "false" ]]
- then
- LICENSE_TYPE="CC BY 4.0"
- return
- fi
-
- # Check for CC BY-SA
- if [[ $OPTION_BY == "true" ]] && \
- [[ $OPTION_NC == "false" ]] && \
- [[ $OPTION_ND == "false" ]] && \
- [[ $OPTION_SA == "true" ]]
- then
- LICENSE_TYPE="CC BY-SA 4.0"
- return
- fi
-
- # Check for CC BY-ND
- if [[ $OPTION_BY == "true" ]] && \
- [[ $OPTION_NC == "false" ]] && \
- [[ $OPTION_ND == "true" ]] && \
- [[ $OPTION_SA == "false" ]]
- then
- LICENSE_TYPE="CC BY-ND 4.0"
- return
- fi
-
- # Check for CC BY-NC
- if [[ $OPTION_BY == "true" ]] && \
- [[ $OPTION_NC == "true" ]] && \
- [[ $OPTION_ND == "false" ]] && \
- [[ $OPTION_SA == "false" ]]
- then
- LICENSE_TYPE="CC BY-NC 4.0"
- return
- fi
-
- # Check for CC BY-NC-SA
- if [[ $OPTION_BY == "true" ]] && \
- [[ $OPTION_NC == "true" ]] && \
- [[ $OPTION_ND == "false" ]] && \
- [[ $OPTION_SA == "true" ]]
- then
- LICENSE_TYPE="CC BY-NC-SA 4.0"
- return
- fi
-
- # Check for CC BY-NC-ND
- if [[ $OPTION_BY == "true" ]] && \
- [[ $OPTION_NC == "true" ]] && \
- [[ $OPTION_ND == "true" ]] && \
- [[ $OPTION_SA == "false" ]]
- then
- LICENSE_TYPE="CC BY-NC-ND 4.0"
- return
- fi
-
- # Error message if none of the above if statements returned out of function.
- echoerr "ERROR: Invalid license specified or LICENSE_TYPE not set."; exit 1;
-
-}
-
-selectLicense() {
- # Usage: selectLicense
- # Description: Sets LICENSE_TYPE variable according to a set of user prompts.
-
- # Prompt license type
- echoerr "Select license type:"
- echoerr " 0) I don't know. Guide me."
- echoerr " 1) CC0 1.0 \"CC0 1.0 Universal\""
- echoerr " 2) CC BY 4.0 \"Attribution 4.0 International\""
- echoerr " 3) CC BY-SA 4.0 \"Attribution-ShareAlike 4.0 International\""
- echoerr " 4) CC BY-ND 4.0 \"Attribution-NoDerivatives 4.0 International\""
- echoerr " 5) CC BY-NC 4.0 \"Attribution-NonCommercial 4.0 International\""
- echoerr " 6) CC BY-NC-SA 4.0 \"Attribution-NonCommercial-ShareAlike 4.0 International\""
- echoerr " 7) CC BY-NC-ND 4.0 \"Attribution-NonCommercial-NoDerivatives 4.0 International\""
- read n
- case $n in
- 0) promptLicenseDetails; return;; # Sets LICENSE_TYPE via many questions to user.
- 1) LICENSE_TYPE="CC 1.0";;
- 2) LICENSE_TYPE="CC BY 4.0";;
- 3) LICENSE_TYPE="CC BY-SA 4.0";;
- 4) LICENSE_TYPE="CC BY-ND 4.0";;
- 5) LICENSE_TYPE="CC BY-NC 4.0";;
- 6) LICENSE_TYPE="CC BY-NC-SA 4.0";;
- 7) LICENSE_TYPE="CC BY-NC-ND 4.0";;
- *) echoerr "Invalid option selected. Exiting."; exit 1;;
- esac
-
-}
-
-#==MAIN PROGRAM==
-selectLicense # Sets LICENSE_TYPE via simple prompt.
-
-# Display value of $LICENSE_TYPE
-echoerr "======================================================="
-echoerr "$LICENSE_TYPE"" license selected."
-
-# Prompt metadata
-echoerr "======================================================="
-echoerr "Specify metadata (leave blank if not needed):"
-read -p " Title of work [title]:" workTitle
-read -p " Attribute work to [author]:" workAuthor
-
-read -p " Attribute work to (ex: author's website) [URL]:" workAuthorURL
-if [[ -n $workAuthorURL ]]; then
- while [[ ! $workAuthorURL =~ $regexURL ]]; do
- echoerr "WARNING: URL may contain error (ex: does not begin with \"https://\"."
- echoerr " Preappend \"http://\" to URL? (y/n)"
- read m
- case $m in
- y | Y | yes | 1) workAuthorURL="http://""$workAuthorURL" ;;
- n | N | no | 2) read -p " Attribute work to (ex: author's website) [URL]:" workAuthorURL ;;
- *) ;;
- esac
- done
-fi
-
-read -p " Source work from which work was derived (leave blank if original work) [URL]:" workSourceURL
-if [[ -n $workSourceURL ]]; then
- while [[ ! $workSourceURL =~ $regexURL ]]; do
- echoerr "WARNING: URL may contain error (ex: does not begin with \"https://\."
- echoerr " Preappend \"http://\" to URL? (y/n)"
- read m
- case $m in
- y | Y | yes | 1) workSourceURL="http://""$workSourceURL" ;;
- n | N | no | 2) read -p " Source work from which work was derived (leave blank if original work) [URL]:" workSourceURL ;;
- *);;
- esac
- done
-fi
-
-read -p " Webpage where more additional permissions may be requested (OPTIONAL) [URL]:" morePermissionsURL
-if [[ -n $morePermissionsURL ]]; then
- while [[ ! $morePermissionsURL =~ $regexURL ]]; do
- echoerr "WARNING: URL may contain error (ex: does not begin with \"https://\."
- echoerr " Preappend \"http://\" to URL? (y/n)"
- read m
- case $m in
- y | Y | yes | 1) morePermissionsURL="http://""$morePermissionsURL";;
- n | N | no | 2) read -p " Webpage where more additional permissions may be requested (OPTIONAL) [URL]:" morePermissionsURL ;;
- esac
- done
-fi
-
-#===CONSTRUCT RDFA TAG===
-#====RDFA:Handle workTitle, workAuthor, workAuthorURL====
-###echoerr "DEBUG: workTitle is --$workTitle--"
-###echoerr "DEBUG: workAuthor is --$workAuthor--"
-###echoerr "DEBUG: workAuthorURL is --$workAuthorURL--"
-###echoerr "DEBUG: workSourceURL is --$workSourceURL--"
-###echoerr "DEBUG: morePermissionsURL is --$morePermissionsURL--"
-###echoerr "DEBUG: LICENSE_TYPE is --$LICENSE_TYPE--"
-
-# Exit early if critical parameters not provided
-if [[ -z "$workTitle" ]] || \
- [[ ! -v LICENSE_TYPE ]];
-then
- echoerr "ERROR: Problem with workTitle or LICENSE_TYPE."
- exit 1;
-fi
-
-# Add workTitle to OUTPUT variable
-OUTPUT=$OUTPUT"<span xmlns:dct=\"http://purl.org/dc/terms/\" property=\"dct:title\">$workTitle</span>"
-
-# Add workAuthor and/or workAuthorURL to OUTPUT variable (if applicable)
-if [[ -v workAuthor ]]; then
- if [[ -v workAuthorURL ]]; then
- # workAuthor set, workAuthorURL set
- OUTPUT=$OUTPUT" by <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"$workAuthorURL\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">$workAuthor</a>"
- else
- #workAuthor set, workAuthorURL not set
- OUTPUT=$OUTPUT" by <span xmlns:cc=\"http://creativecommons.org/ns#\" property=\"cc:attributionName\">$workAuthor</span>"
- fi
-fi
-
-#====RDFA:Handle LICENSE_TYPE====
-# Add selected license to OUTPUT variable
-
-# Add boilerplate
-OUTPUT=$OUTPUT" is licensed under "
-
-# Add license text
-case $LICENSE_TYPE in
- "CC 1.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/publicdomain/zero/1.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC0 1.0</a><a href=\"https://creativecommons.org/publicdomain/zero/1.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-cc0_icon.svg\" /></a>"
- ;;
- "CC BY 4.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/licenses/by/4.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC BY 4.0</a><a href=\"https://creativecommons.org/licenses/by/4.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-by_icon.svg\" /></a>"
- ;;
- "CC BY-SA 4.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/licenses/by-sa/4.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC BY-SA 4.0</a><a href=\"https://creativecommons.org/licenses/by-sa/4.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-by_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-sa_icon.svg\" /></a>"
- ;;
- "CC BY-ND 4.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/licenses/by-nd/4.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC BY-ND 4.0</a><a href=\"https://creativecommons.org/licenses/by-nd/4.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-by_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-nd_icon.svg\" /></a>"
- ;;
- "CC BY-NC 4.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC BY-NC 4.0</a><a href=\"https://creativecommons.org/licenses/by-nc/4.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-by_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-nc_icon.svg\" /></a>"
- ;;
- "CC BY-NC-SA 4.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/licenses/by-nc-sa/4.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC BY-NC-SA 4.0</a><a href=\"https://creativecommons.org/licenses/by-nc-sa/4.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-by_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-nc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-sa_icon.svg\" /></a>"
- ;;
- "CC BY-NC-ND 4.0")
- OUTPUT=$OUTPUT"<a href=\"https://creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\" rel=\"license noopener noreferrer\" style=\"display: inline-block;\">CC BY-NC-ND 4.0</a><a href=\"https://creativecommons.org/licenses/by-nc-nd/4.0/\"><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-by_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-nc_icon.svg\" /><img style=\"height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;\" src=\"https://search.creativecommons.org/static/img/cc-nd_icon.svg\" /></a>"
- ;;
- *) echoerr "Error."; exit 1;;
-esac
-# End sentence.
-OUTPUT=$OUTPUT"."
-
-
-#====RDFA:Handle workSourceURL, morePermissionsURL (if applicable)====
-# Add workSourceURL to OUTPUT (if applicable)
-if [[ -n "$workSourceURL" ]]; then
- OUTPUT=$OUTPUT"<br />$workTitle is based on a work at <a xmlns:dct=\"http://purl.org/dc/terms/\" href=\"$workSourceURL\" rel=\"dct:source\">$workSourceURL</a>"
- # End sentence.
- OUTPUT=$OUTPUT"."
-fi
-
-# Add morePermissionsURL to OUTPUT (if applicable)
-if [[ -n "$morePermissionsURL" ]]; then
- OUTPUT=$OUTPUT"<br />Permissions beyond the scope of this license may be available at <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"$morePermissionsURL\" rel=\"cc:morePermissions\">$morePermissionsURL</a>"
- #End sentence
- OUTPUT=$OUTPUT"."
-fi
-
-
-
-#====Deliver output====
-# Send OUTPUT to stdout.
-echo $OUTPUT
+++ /dev/null
-~/Desktop/cryptomator/cryptomator-1.4.15-x86_64.AppImage
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-02-06T22:51Z
-
-# Description: A simple command line tool to dispay the date in ISO-8601 format.
-
-DATE="$(date --iso-8601=seconds)"
-
-if [[ $DATE =~ "+00:00"$ ]]; then
- DATE2=${DATE::-6}"Z"
- echo $DATE2
- exit 0
-else
- echo $DATE
- exit 0
-fi
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-05-10T15:27Z
-# Author: Steven Baltakatei Sandoval
-# License: GPLv3+
-# Ref./Attrib:
-# [1]: John1024 (2014-08-06). ["linux-shell: renaming files to creation time"](https://stackoverflow.com/a/25153352). Licensed CC BY-SA 4.0.
-# [2]: Computer Hope (2019-05-04). ["Bash read builtin command"](https://www.computerhope.com/unix/bash/read.htm).
-
-# Description: Preappends modification time to all files in current
-# working directory.
-
-# Usage: bkdatename
-
-# Prompt to change filenames for all files in working directory.
-read -p "Append each file's modification date & time to the start of its name in the current working directory? (y/n)" -n 1 -r
-echo
-if [[ $REPLY =~ ^[Yy]$ ]] # see [2]
-then
- #Perform renaming operation.
- for f in *
- do
- FILE_NAME="$f"
- FILE_MDATE="$(date -r "$f" +"%Y%m%dT%H%M%S")" # See [1].
- FILE_NAME_NEW="$FILE_MDATE".."$FILE_NAME"
- # Display new file name
- echo "Renaming $f to:""$FILE_NAME_NEW"
- cp -p ./"$f" ./"$FILE_NAME_NEW"
- rm ./"$f"
- done
- echo "Done."
-fi
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-01-02T03:21Z
-
-# Description: A bash script to perform the `git-status` command on
-#all subdirectories within the working directory.
-
-# Source: https://gist.github.com/mzabriskie/6631607
-
-#for d in ./*/ ; do (cd "$d" && echo "========================" && pwd && git status); done
-
-for d in ./*/ ; do
- (
- cd "$d"
- if [ -d ./.git ];
- then
- #echo "========================"
- pwd
- git status -s
- else
- echo "ERR:No .git dir: "$(pwd)
- fi
- );
-done
+++ /dev/null
-#!/bin/bash
-echo "type a hex number"
-read hexNum
-echo -n "The binary value of $hexNum="
-echo "obase=2; ibase=16; $hexNum" | bc
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-03-09T04:51Z
-
-# Description: A bash script showing recent edits to a given
-# directory.
-
-# Usage: bkidle [dir]
-
-TARGET_DIR="$1"
-
-while true;
-do
- find "$1" -readable -mmin -1 -type f -exec b2sum -l 32 '{}' \;;
- echo "$(date +%Y%m%dT%H%M%S.%N%z)========";
- sleep 60;
-done
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-04-28T18:31Z
-# Author: Steven Baltakatei Sandoval
-# Description: Runs mpv to listen to custom playlist generated by cron_vensagusni_day.sh
-
-TARGET_PLAYLIST="/home/baltakatei/Music/music_library_playlist.m3u"
-OUTPUT_LOG_PATH="/home/baltakatei/Sync/kodawkuori-07/2020/archive-PERS/logs/activity/$(date +%Y%m%dT%H%M%S.%N%z)..mpv_history.log"
-OUTPUT_LOG_DIR="$(dirname $OUTPUT_LOG_PATH)"
-
-if ! [ -d "$OUTPUT_LOG_DIR" ]; then
- echo "ERROR: Output log directory not found:""$OUTPUT_LOG_DIR" 1>&2 ; exit 1;
-fi
-
-if ! [ -f "$TARGET_PLAYLIST" ]; then
- echo "ERROR: Playlist file not found:""$TARGET_PLAYLIST" 1>&2 ; exit 1;
-fi
-
-mpv "$TARGET_PLAYLIST" --no-video --log-file="$OUTPUT_LOG_PATH" --msg-time;
-
-exit 0
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-01-20T16:34Z
-#
-# Author: Steven Baltakatei Sandoval (baltakatei.com)
-#
-# License: This bash script, `bknpass`, is licensed under GPLv3 or
-# later by Steven Baltakatei Sandoval:
-#
-# `bknpass`, an alphanumeric password generator
-# Copyright (C) 2020 Steven Baltakatei Sandoval (baltakatei.com)
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# A copy of the GNU General Public License may be found at
-# <https://www.gnu.org/licenses/>.
-#
-# Description: This bash script generates alphanumeric passphrases
-# with a char-count determined by a user-provided number of bits of
-# entropy. The passphrase is then outputted to stdout with a trailing
-# newline. It works as follows:
-#
-# - Prompt user for an integer. This integer is the number of bits
-# of entropy that the generated password should have.
-#
-# - Check if user-provided string is an integer using `bash` regular
-# expression test.
-#
-# - Calculate the minimum number of alphanumeric characters required
-# to encode the specified number of bits of entropy.
-#
-# - This step uses `bc` to calculate a logarithm float string
-# and `awk` to convert the float into an integer, rounding up.
-#
-# - Use `tr`, `/dev/urandom`, and `head` to generate a random
-# alphanumeric string with the length calculated in the previous
-# step.
-#
-# - Use `echo` to display the passphrase in stdout with a trailing
-# newline.
-#
-# Dependencies: bash, echo, bc, awk, tr, head. See end of file
-#
-# Tested on:
-#
-# - GNU/Linux Debian 10
-
-
-#==Initialization==
-
-let ALPHABET_SIZE="26+26+10" # number of unique chars in [:alnum:], argument fed to `tr -c` in 'Generate passphrase' step)
-LOG_BASE=2 # Set logarithm base to 2
-
-# Define `echoerr` function which outputs text to stderr
- # Note: function copied from https://stackoverflow.com/a/2990533
-function echoerr {
- echo "$@" 1>&2;
-}
-
-# Define `rpass` function which generates an alphanumeric passphrase of length $1 (ex: `rpass 22` generates a 22-char string)
- # Note: function adapted from https://www.thegeekstuff.com/2010/04/unix-bash-function-examples/
-function rpass {
- cat /dev/urandom | LC_ALL=C tr -cd "[:alnum:]" | head -c ${1:-22}
-}
-
-
-#==Main Program==
-
-# Define $ENTROPY_BIT_COUNT1 as argument $1 or prompt user if $1 is not defined.
- # note: argument test adapted from https://stackoverflow.com/a/6482403
-if [ -z "$1" ]
-then
- echo "Entropy bit count argument (\$1) not supplied."
- # Get from user the number of bits of entropy.
- echoerr -n "Please specify the required strength of the password in bits of entropy (ex: 256):" # prompt via stderr
- read ENTROPY_BIT_COUNT1
-else
- ENTROPY_BIT_COUNT1="$1"
-fi
-
-# Check if $ENTROPY_BIT_COUNT1 is an non-negative integer
- # Note: Regular expression test is adapted from https://stackoverflow.com/a/806923
-RETEST1='^[0-9]+$'
-if ! [[ $ENTROPY_BIT_COUNT1 =~ $RETEST1 ]] ; then
- echo "error: Not an integer." >&2; exit 1
-fi
-
-# Calculate minimum count of chars needed to encode $ENTROPY_BIT_COUNT1 with alphabet size of $ALPHABET_SIZE as float
- # Solve ln(a^n)/ln(2)=b for n using `bc` where
- # a=$ALPHABET_SIZE
- # n=$CHAR_COUNT1_FLOAT
- # b=$ENTROPY_BIT_COUNT1
- # Note: `bc` logarithm usage adapted from http://phodd.net/gnu-bc/bcfaq.html#bashlog
-CHAR_COUNT1_FLOAT=$(echo "$ENTROPY_BIT_COUNT1*l($LOG_BASE)/l($ALPHABET_SIZE)" | bc -l)
- # Note: Float will be of form "21.49744370650136860806". This particular float should be rounded to "22" later.
-
-# Round $CHAR_COUNT1_FLOAT1 up to next highest integer for use as argument in later bash functions.
- # Note: awk expression from https://bits.mdminhazulhaque.io/linux/round-number-in-bash-script.html
-CHAR_COUNT1=$(echo "$CHAR_COUNT1_FLOAT" | awk '{print ($0-int($0)>0)?int($0)+1:int($0)}')
-
-# Generate passphrase
-PASS1=$(rpass "$CHAR_COUNT1")
-echo -e "$PASS1"
-
-
-#==References==
-#
-# - How to echo a string as stderr instead of stdout.
-# https://stackoverflow.com/a/2990533
-# Author: James Roth
-# Date: 2010-06-07T14:52Z
-# Date Accessed: 2020-01-20
-#
-# - How to check if script argument exists or not.
-# https://stackoverflow.com/a/6482403
-# Author: phoxix
-# Date: 2011-06-26T05:55Z
-# Date Accessed: 2020-01-20
-#
-# - How to check that a string is an integer using regular expression test.
-# https://stackoverflow.com/a/806923
-# Author: Charles Duffy
-# Date: 2009-04-30T13:32Z
-# Date Accessed: 2020-01-20
-#
-# - How to use `bc` to calculate logarithms in Bash
-# http://phodd.net/gnu-bc/bcfaq.html#bashlog
-# Author: unknown
-# Date Accessed: 2020-01-20
-#
-# - How to use `awk` to convert and round up a float to an integer.
-# https://bits.mdminhazulhaque.io/linux/round-number-in-bash-script.html
-# Author: Md. Minhazul Haque
-# Date: 2015-01-09
-# Date Accessed: 2020-01-20
-#
-# - How to use `/dev/urandom`, `tr`, and `head` to generate a random password in Bash.
-# https://www.thegeekstuff.com/2010/04/unix-bash-function-examples/
-# Author: SASIKALA, Ramesh Natarajan
-# Date: 2010-04-21
-# Date Accessed: 2020-01-20
-#
-# - Dependencies: bash, echo, bc, awk, tr, head.
-#
-# - GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
-# Copyright (C) 2019 Free Software Foundation, Inc.
-# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
-# This is free software; you are free to change and redistribute it.
-# There is NO WARRANTY, to the extent permitted by law.
-#
-# - echo (GNU coreutils) 8.30
-# Copyright (C) 2018 Free Software Foundation, Inc.
-# License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
-# This is free software: you are free to change and redistribute it.
-# There is NO WARRANTY, to the extent permitted by law.
-#
-# Written by Brian Fox and Chet Ramey.
-#
-# - bc 1.07.1
-# Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
-#
-# - GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.1.2)
-# Copyright (C) 1989, 1991-2018 Free Software Foundation.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# - tr (GNU coreutils) 8.30
-# Copyright (C) 2018 Free Software Foundation, Inc.
-# License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
-# This is free software: you are free to change and redistribute it.
-# There is NO WARRANTY, to the extent permitted by law.
-#
-# Written by Jim Meyering.
-#
-# - head (GNU coreutils) 8.30
-# Copyright (C) 2018 Free Software Foundation, Inc.
-# License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
-# This is free software: you are free to change and redistribute it.
-# There is NO WARRANTY, to the extent permitted by law.
-#
-# Written by David MacKenzie and Jim Meyering.
+++ /dev/null
-#!/bin/bash
-# usage: bkrandlujvo
-
-INPUT_FILE="/home/baltakatei/Sync/kodawkuori-07/2020/reference-PERS/lojban/20190626..gismu_english_order.txt"
-if [ ! -f "$INPUT_FILE" ]; then echo "ERROR: gismu list text file not found." 2>&1 ; exit 1; fi
-
-randGismuDef () {
- # usage: randGismuDef [gismu.txt file]
- # output: <<gismu>>,<<def>>
- FILE="$1"
- randLineNum=$(shuf -n1 -i2-$(cat "$FILE" | wc -l)) # Generate random line number of FILE
- # Output random 2nd space-delimted field (gismu) from file
- #echo $(cat "$FILE" | cut -d' ' -f2-3 | head -n"$randLineNum" | tail -n1 )
- echo $(cat "$FILE" | awk '{print $1 "," $3}' | head -n"$randLineNum" | tail -n1 )
-}
-
-randGismu () {
- # usage: randGismu [gismu.txt file]
- # output: <<gismu>>
- FILE="$1"
- randLineNum=$(shuf -n1 -i2-$(cat "$FILE" | wc -l)) # Generate random line number of FILE
- # Output random 2nd space-delimted field (gismu) from file
- echo $(cat "$FILE" | awk '{print $1}' | head -n"$randLineNum" | tail -n1 )
-}
-
-GISMU1=$(randGismu "$INPUT_FILE")
-GISMU2=$(randGismu "$INPUT_FILE")
-GISMU3=$(randGismu "$INPUT_FILE")
-
-#RAW1=$(randGismuDef "$INPUT_FILE")
-#RAW2=$(randGismuDef "$INPUT_FILE")
-#RAW3=$(randGismuDef "$INPUT_FILE")
-
-#GISMU1=$(echo "$RAW1" | cut -d',' -f1)
-#GISMU2=$(echo "$RAW2" | cut -d',' -f1)
-#GISMU3=$(echo "$RAW3" | cut -d',' -f1)
-
-#DEF1=$(echo "$RAW1" | cut -d',' -f2)
-#DEF2=$(echo "$RAW2" | cut -d',' -f2)
-#DEF3=$(echo "$RAW3" | cut -d',' -f2)
-
-echo "$GISMU1 $GISMU2 $GISMU3"
-#echo "$DEF1 $DEF2 $DEF3"
-
-if command -v jbofihe 1>/dev/null 2>&1; then
- echo "$GISMU1" | jbofihe -x
- echo "$GISMU2" | jbofihe -x
- echo "$GISMU3" | jbofihe -x
-else
- echo "ERROR: jbofihe command not available." 2>&1;
-fi
-
-if command -v jvocuhadju 1>/dev/null 2>&1; then
- jvocuhadju "$GISMU1" "$GISMU2" "$GISMU3";
-else
- echo "ERROR: jvocuhadju command not available." 2>&1;
-fi
-
-exit 0
+++ /dev/null
-watch -d -n 1 cat /proc/sys/kernel/random/entropy_avail
+++ /dev/null
-#!/bin/bash
-
-# A script that outputs a random 8-digit hexadecimal number to stdout.
-
-LC_ALL=C tr -dc "0123456789abcdef" < /dev/urandom | head -c ${1:-8}
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-05-24T00:47Z
-
-# Author: Steven Baltakatei Sandoval
-
-# Description: A bash script that creates a gpg signature using
-# default key.
-
-# Usage: bksign [ file ]
-
-FILEIN="$1"
-
-# Check that provided argument is a file.
-if ! [ -f "$FILEIN" ]; then
- echo "ERROR: Invalid filename provided." 2>&1;
- exit 1;
-fi
-
-# Determine output file name
-FILEOUT="$FILEIN".asc
-gpg --armor --verbose --output "$FILEOUT" --detach-sign "$FILEIN"
-
-exit 1
+++ /dev/null
-#!/bin/bash
-# script to force reset USB devices
-# soruce: http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/
-
-
-if [[ $EUID != 0 ]] ; then
- echo This must be run as root!
- exit 1
-fi
-
-for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
-
- if ! cd $xhci ; then
- echo Weird error. Failed to change directory to $xhci
- exit 1
- fi
-
- echo Resetting devices from $xhci...
-
- for i in ????:??:??.? ; do
- echo -n "$i" > unbind
- echo -n "$i" > bind
- done
-done
+++ /dev/null
-#!/bin/bash
-
-# 2019-08-14T21:58:08Z; baltakatei>
-
-# The purpose of this script is to open a session of firefox dedicated
-# to editing wikipedia from a remote machine with a public IP address
-# not on Wikipedia's blocklist.
-
-# This script:
-# 1. Creates ssh proxy to remote server
-# 2. Starts Firefox by calling a local installation of firefox via
-# its own startup script.
-
-# Note: This script does not automatically initialize the default
-# Firefox profile with the correct SOCKS5 settings as can be seen in
-# "Connection Settings" ("Manual proxy configuration", SOCKS
-# Host="127.0.0.1", Port="8080"). These changes must be made manually
-# until an automated method for applying SOCKS settings via edits to
-# `prefs.js` in the default Firefox profile.
-
-# Reference:
-
-# SSH CONNECTION SETTINGS
-REMOTE_USER=baltakatei
-REMOTE_IP=76.102.50.36
-REMOTE_PORT=63865
-LOCAL_PROXY_PORT=8080
-
-# STEP 1: Start an SSH master connection (-M)
-# in the background (-f)
-# without running a remote command (-N)
-ssh -p $REMOTE_PORT -M -o ControlPath=/tmp/socks.%r@%h:%p -f -N -D $LOCAL_PROXY_PORT -C $REMOTE_USER@$REMOTE_IP
-
-# STEP 2: Launch Firefox in the foreground
-#/home/baltakatei/Desktop/firefox/firefox -P -no-remote
-/home/baltakatei/Desktop/firefox/firefox -no-remote
-
-# STEP 3: When user is done with Firefox, send an "exit" command to the master connection
-ssh -p $REMOTE_PORT -o ControlPath=/tmp/socks.%r@%h:%p -O exit $REMOTE_USER@$REMOTE_IP
+++ /dev/null
-#!/bin/bash
-
-# Date: 2020-04-09T00:09Z
-
-# Author: Steven Baltakatei Sandoval
-
-# Description: Compresses a file or directory using xz at max
-# settings. Saves compressed .tar.xz file in the same directory as the
-# original file.
-
-# Usage: bkxz [ file or dir ]
-
-echoerr() { echo "$@" 1>&2; } # Define error display function.
-
-TARGET="$1" # Identify first argument as target file or directory.
-
-if ! command -v tar >/dev/null 2>&1; then # Check that 'tar' command exists.
- echoerr "ERROR: Command doesn't exist: tar";
-fi
-
-if ! command -v xz >/dev/null 2>&1; then # check that 'xz' command exist.
- echoerr "ERROR: Command doesn't exist: xz. Suggestion: Install 'xz-utils' package.";
- exit 1;
-fi
-
-if ! ( [ -f "$TARGET" ] || [ -d "$TARGET" ] ); then # check that TARGET is a file or dir.
- echoerr "ERROR: Target is not a file or dir."; exit 1;
-fi
-
-
-TARGET_BASENAME="$(basename "$TARGET")" # Save name of target's basename (ex: 'input.txt' from '/tmp/input.txt').
-TARGET_DIRNAME="$(dirname "$TARGET")" # Save name of target's directory (ex: '/tmp' from '/tmp/input.txt').
-
-OUTPUT="$TARGET_DIRNAME"/"$TARGET_BASENAME".tar.xz # Define output file to be in same location as target but with .tar.xz extension.
-
-pushd "$TARGET_DIRNAME" 1>/dev/null 2>&1 # Temporarily navigate to directory holding TARGET.
-tar cf - "$TARGET_BASENAME" | xz -9e --lzma2=dict=1536MiB,mf=bt4,nice=273,depth=1000 > "$OUTPUT"
-echoerr "Archive saved at: $OUTPUT"
-popd 1>/dev/null 2>&1 # Return to original working directory.
+++ /dev/null
-#!/bin/bash
-
-youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o '%(upload_date)s_%(id)s..%(channel)s,_%(title)s.%(ext)s' --restrict-filenames $@
+++ /dev/null
-#!/bin/bash
-
-#Sync Youtube playlist "cukta-2019Q4"
-#bash ~/Sync/baltakatei_bin/youtube-playlist-sync -l https://www.youtube.com/playlist?list=PL840bf-Yx7uabEhowgn-e2CYoqdVOJ8uF -d ~/Sync/kodawkuori-07/2019/videos-PERS/internet/youtube
-
-#Sync Youtube playlist "cukta-2020Q1"
-#bash ~/Sync/baltakatei_bin/youtube-playlist-sync -l https://www.youtube.com/playlist?list=PL840bf-Yx7uY8JAHFfBJ1poRfWHy25AUE -d ~/Sync/kodawkuori-07/2020/videos-PERS/internet/youtube
-
-#Sync Youtube playlist "cukta-2020Q2"
-bash ~/Sync/baltakatei_bin/youtube-playlist-sync -l https://www.youtube.com/playlist?list=PL840bf-Yx7uaW5cj_l24b8v2DZek5Nwv5 -d ~/Sync/kodawkuori-07/2020/videos-PERS/internet/youtube/cukta-2020Q2