From ac9052a9c538042d67de10d8c10ff0b635d4d694 Mon Sep 17 00:00:00 2001 From: Astraxical Date: Mon, 18 May 2026 19:53:58 +0900 Subject: [PATCH 1/4] feat: Safety Close, Close Workspace -- Unfinished --- .config/hypr/source/keybinds.lua | 14 ++ .../tools/workspace/close-workspace.sh | 71 +++++++++ user_scripts/tools/workspace/countdown.sh | 136 +++++++++++++++++ user_scripts/tools/workspace/safety-close.sh | 144 ++++++++++++++++++ 4 files changed, 365 insertions(+) create mode 100755 user_scripts/tools/workspace/close-workspace.sh create mode 100755 user_scripts/tools/workspace/countdown.sh create mode 100755 user_scripts/tools/workspace/safety-close.sh diff --git a/.config/hypr/source/keybinds.lua b/.config/hypr/source/keybinds.lua index d1e236b1..87803f67 100644 --- a/.config/hypr/source/keybinds.lua +++ b/.config/hypr/source/keybinds.lua @@ -536,6 +536,20 @@ hl.bind( { description = "Close Window" } ) +-- /user_scripts/tools/workspace/close-workspace.sh -- Not Done/Forgotten +-- hl.bind( +-- "SUPER + SHIFT + C", +-- hl.dsp.exec_cmd(dusky_scripts .. "tools/workspace/close-workspace.sh"), +-- { description = "Close Workspace" } +-- ) + +-- /user_scripts/tools/workspace/close-workspace.sh -- Not Done/Forgotten +-- hl.bind( +-- "SUPER + SHIFT + B", +-- hl.dsp.exec_cmd(dusky_scripts .. "tools/workspace/close-workspace.sh"), +-- { description = "Safety Close Window" } +-- ) + hl.bind( "SUPER + A", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), diff --git a/user_scripts/tools/workspace/close-workspace.sh b/user_scripts/tools/workspace/close-workspace.sh new file mode 100755 index 00000000..284324e9 --- /dev/null +++ b/user_scripts/tools/workspace/close-workspace.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "${SCRIPT_DIR}/countdown.sh" + +# Returns the active workspace ID, or returns 1 with a notification on failure +get_workspace_id() { + local ws_id + ws_id=$(hyprctl -j activeworkspace 2>/dev/null | jq -r '.id // empty') + if [[ -z "$ws_id" ]] || [[ "$ws_id" == "null" ]]; then + notify-send "Error" "Could not get workspace ID" -t 3000 + return 1 + fi + echo "$ws_id" +} + +close_workspace_windows() { + local ws_id + ws_id=$(get_workspace_id) || return 1 + + local addresses + addresses=$(hyprctl -j clients 2>/dev/null | jq -r ".[] | select(.workspace.id == $ws_id) | .address") + + if [[ -z "$addresses" ]]; then + notify-send "Workspace Empty" "No windows to close" -t 2000 + return 0 + fi + + local count=0 + for address in $addresses; do + hyprctl dispatch closewindow "address:$address" 2>/dev/null + ((count++)) + sleep 0.05 + done + + notify-send "Workspace Closed" "Closed $count windows" -t 3000 +} + +main() { + countdown_init "workspace-close" + + # 5-second cooldown to prevent accidental double-triggers + if countdown_is_disabled "workspace-close"; then + local remaining + remaining=$(countdown_status "workspace-close" "%S remaining") + notify-send "Cooldown Active" "Wait ${remaining}s before closing workspace again" -t 2000 + return 0 + fi + + local workspace_name ws_id window_count + workspace_name=$(hyprctl -j activeworkspace 2>/dev/null | jq -r '.name // "Main"') + ws_id=$(get_workspace_id) || return 1 + window_count=$(hyprctl -j clients 2>/dev/null | jq "[.[] | select(.workspace.id == $ws_id)] | length") + + if [[ "$window_count" -eq 0 ]]; then + notify-send "Workspace Empty" "No windows to close" -t 2000 + return 0 + fi + + local confirm + confirm=$(echo -e "Cancel\nClose $window_count windows" | rofi -dmenu \ + -p "Close all in workspace $workspace_name?" \ + -mesg "This will close all windows in this workspace") + + if [[ "$confirm" == "Close $window_count windows" ]]; then + countdown_set "workspace-close" 5 s + close_workspace_windows + fi +} + +main "$@" diff --git a/user_scripts/tools/workspace/countdown.sh b/user_scripts/tools/workspace/countdown.sh new file mode 100755 index 00000000..ea27d8ca --- /dev/null +++ b/user_scripts/tools/workspace/countdown.sh @@ -0,0 +1,136 @@ +#!/usr/bin/env bash + +COUNTDOWN_DIR="${HOME}/.local/share/countdowns" +mkdir -p "$COUNTDOWN_DIR" + +# Internal: get the file path for a named countdown +_countdown_file() { + echo "$COUNTDOWN_DIR/${1:-default}.countdown" +} + +# Internal: read and validate the end timestamp from a countdown file +# Returns the integer end_time, or returns 1 if missing/invalid/expired +_countdown_read() { + local file + file=$(_countdown_file "$1") + [[ -f "$file" ]] || return 1 + + local end_time + end_time=$(< "$file") + + # Validate it's a plain integer + [[ "$end_time" =~ ^[0-9]+$ ]] || { rm -f "$file"; return 1; } + + local now + now=$(date +%s) + + if (( now >= end_time )); then + rm -f "$file" + return 1 + fi + + echo "$end_time" +} + +# Set a countdown by name. +# Usage: countdown_set [s|m|h] +# Unit defaults to seconds. Examples: +# countdown_set my-lock 5 → 5 seconds +# countdown_set my-lock 5 s → 5 seconds +# countdown_set my-lock 5 m → 5 minutes +# countdown_set my-lock 1 h → 1 hour +countdown_set() { + local name="${1:-default}" + local duration="${2:-5}" + local unit="${3:-s}" + local secs + + case "$unit" in + s|sec|secs|second|seconds) secs=$(( duration )) ;; + m|min|mins|minute|minutes) secs=$(( duration * 60 )) ;; + h|hr|hrs|hour|hours) secs=$(( duration * 3600 )) ;; + *) + echo "countdown_set: unknown unit '$unit' (use s, m, or h)" >&2 + return 1 + ;; + esac + + echo $(( $(date +%s) + secs )) > "$(_countdown_file "$name")" +} + +# Legacy alias so existing callers of countdown_disable still work. +# countdown_disable +countdown_disable() { + countdown_set "${1:-default}" "${2:-5}" m +} + +# Clear a countdown (re-enable whatever it was blocking) +countdown_clear() { + rm -f "$(_countdown_file "${1:-default}")" +} + +# Legacy alias +countdown_enable() { countdown_clear "$@"; } + +# Check if a countdown is active. +# Returns 0 (active) and prints seconds remaining, or returns 1 (inactive/expired). +countdown_check() { + local end_time + end_time=$(_countdown_read "${1:-default}") || return 1 + echo $(( end_time - $(date +%s) )) +} + +# Returns 0 if countdown is active, 1 if not. No output. +countdown_is_disabled() { + _countdown_read "${1:-default}" &>/dev/null +} + +# Display remaining time in a formatted string. +# Format tokens: +# %H — total hours remaining +# %h — remainder hours (within days, not useful here but included) +# %M — total minutes remaining +# %m — remainder minutes (after subtracting full hours) +# %S — total seconds remaining +# %s — remainder seconds (after subtracting full minutes) +# Default format: %m:%s (e.g. "04:32") +countdown_display() { + local name="${1:-default}" + local fmt="${2:-%m:%s}" + + local remaining + remaining=$(countdown_check "$name") || return 1 + + local total_secs=$remaining + local total_mins=$(( total_secs / 60 )) + local total_hours=$(( total_secs / 3600 )) + local rem_secs=$(( total_secs % 60 )) + local rem_mins=$(( total_mins % 60 )) + + # Pad single digits with leading zero for display + local pad_rem_secs pad_rem_mins + printf -v pad_rem_secs "%02d" "$rem_secs" + printf -v pad_rem_mins "%02d" "$rem_mins" + + local out="$fmt" + out="${out//%H/$total_hours}" + out="${out//%M/$total_mins}" + out="${out//%S/$total_secs}" + out="${out//%m/$pad_rem_mins}" + out="${out//%s/$pad_rem_secs}" + + echo "$out" +} + +# Convenience alias +countdown_status() { countdown_display "${1:-default}" "${2:-%m:%s}"; } + +# Cleans up expired countdown files. Call at script start if you want housekeeping, +# but it's not required — _countdown_read self-cleans on every access. +countdown_init() { + local name="${1:-default}" + _countdown_read "$name" &>/dev/null || true +} + +# Get the file path (for external scripts that need to write directly) +countdown_get_file() { _countdown_file "$@"; } diff --git a/user_scripts/tools/workspace/safety-close.sh b/user_scripts/tools/workspace/safety-close.sh new file mode 100755 index 00000000..1ea10dae --- /dev/null +++ b/user_scripts/tools/workspace/safety-close.sh @@ -0,0 +1,144 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "${SCRIPT_DIR}/countdown.sh" + + +get_active_window_info() { + local wininfo + wininfo=$(hyprctl -j activewindow 2>/dev/null) + + if [[ -z "$wininfo" ]] || [[ "$wininfo" == "null" ]]; then + return 1 + fi + + local address pid title class + address=$(echo "$wininfo" | jq -r '.address // empty') + pid=$(echo "$wininfo" | jq -r '.pid // empty') + title=$(echo "$wininfo" | jq -r '.title // empty' | cut -c1-50) + class=$(echo "$wininfo" | jq -r '.class // empty') + + echo "$address|$pid|$title|$class" +} + +get_workspace_id() { + local ws_id + ws_id=$(hyprctl -j activeworkspace 2>/dev/null | jq -r '.id // empty') + if [[ -z "$ws_id" ]] || [[ "$ws_id" == "null" ]]; then + notify-send "Error" "Could not get workspace ID" -t 3000 + return 1 + fi + echo "$ws_id" +} + +close_address() { + local address="$1" + hyprctl dispatch closewindow "address:$address" 2>/dev/null +} + +close_workspace_windows() { + local ws_id + ws_id=$(get_workspace_id) || return 1 + + local addresses + addresses=$(hyprctl -j clients 2>/dev/null | jq -r ".[] | select(.workspace.id == $ws_id) | .address") + + if [[ -z "$addresses" ]]; then + notify-send "Workspace Empty" "No windows to close" -t 2000 + return 0 + fi + + local count=0 + for address in $addresses; do + hyprctl dispatch closewindow "address:$address" 2>/dev/null + ((count++)) + sleep 0.05 + done + + notify-send "Workspace Closed" "Closed $count windows" -t 3000 +} + +show_close_menu() { + local win_info="$1" + + # Parse the pipe-delimited window info + local address pid title class + address="${win_info%%|*}" + local rest="${win_info#*|}" + pid="${rest%%|*}" + rest="${rest#*|}" + title="${rest%%|*}" + class="${rest##*|}" + + # Guard: no PID or process already dead — just close + if [[ -z "$pid" ]] || [[ "$pid" == "null" ]] || ! kill -0 "$pid" 2>/dev/null; then + close_address "$address" + return + fi + + # Safety close is disabled (countdown active) — bypass confirmation + if countdown_is_disabled "safety-close"; then + close_address "$address" + notify-send "Safety Close Bypassed" "Closed window (safety timer active)" -t 2000 + return + fi + + local workspace_name + workspace_name=$(hyprctl -j activeworkspace 2>/dev/null | jq -r '.name // "Main"') + + # Build menu — show remaining time if a countdown file exists but isn't active + # (i.e., the "Disable Safety Close" option shows how long is left if re-triggered) + local disable_label="Disable Safety Close (5 min)" + if [[ -f "$(countdown_get_file "safety-close")" ]]; then + local status + status=$(countdown_display "safety-close" "%m:%s") + [[ -n "$status" ]] && disable_label="Disable Safety Close (5 min) — ($status remaining)" + fi + + local choice + choice=$(printf "No\n%s\nClose All In Workspace\nYes" "$disable_label" | rofi -dmenu \ + -p "Close $class (PID: $pid)?" \ + -mesg "Title: $title | Workspace: $workspace_name") + + case "$choice" in + "No" | "") + return 0 + ;; + "Disable Safety Close"*) + countdown_disable "safety-close" 5 + notify-send "Safety Close Disabled" "Close confirmation disabled for 5 minutes" -t 3000 + ;; + "Close All In Workspace") + local ws_name confirm + confirm=$(echo -e "Cancel\nClose All" | rofi -dmenu \ + -p "Close all in workspace $workspace_name?" \ + -mesg "This will close all windows in this workspace") + if [[ "$confirm" == "Close All" ]]; then + close_workspace_windows + fi + ;; + "Yes") + countdown_set "safety-close-recent" 5 s + close_address "$address" + ;; + esac +} + +main() { + countdown_init "safety-close" + + local win_info + win_info=$(get_active_window_info) || { + # No active window — nothing to do + return 0 + } + + local address="${win_info%%|*}" + if [[ -z "$address" ]]; then + return 0 + fi + + show_close_menu "$win_info" +} + +main "$@" From 192a03795eeb31aa9df994e48aa934380695c6ad Mon Sep 17 00:00:00 2001 From: Astraxical Date: Mon, 18 May 2026 20:24:31 +0900 Subject: [PATCH 2/4] feat: Safety Close, Close Workspace -- Unfinished feat: Safety Close, Close Workspace -- Working --- user_scripts/tools/.unsorted/aesdec.sh | 3 +++ user_scripts/tools/.unsorted/aesenc.sh | 3 +++ user_scripts/tools/.unsorted/argon2.sh | 3 +++ user_scripts/tools/.unsorted/base642str.sh | 3 +++ user_scripts/tools/.unsorted/bcrypt.sh | 3 +++ user_scripts/tools/.unsorted/bin2dec.sh | 3 +++ user_scripts/tools/.unsorted/bin2hex.sh | 4 ++++ user_scripts/tools/.unsorted/caesar.sh | 3 +++ user_scripts/tools/.unsorted/charcount.sh | 3 +++ user_scripts/tools/.unsorted/chardist.sh | 3 +++ user_scripts/tools/.unsorted/checkport.sh | 3 +++ user_scripts/tools/.unsorted/checksum.sh | 6 ++++++ user_scripts/tools/.unsorted/countsubstr.sh | 4 ++++ user_scripts/tools/.unsorted/crlf2lf.sh | 4 ++++ user_scripts/tools/.unsorted/cronvalidate.sh | 3 +++ user_scripts/tools/.unsorted/dec2bin.sh | 3 +++ user_scripts/tools/.unsorted/dec2hex.sh | 3 +++ user_scripts/tools/.unsorted/dec2oct.sh | 3 +++ user_scripts/tools/.unsorted/diff.sh | 3 +++ user_scripts/tools/.unsorted/entropy.sh | 12 ++++++++++++ user_scripts/tools/.unsorted/epoch.sh | 2 ++ user_scripts/tools/.unsorted/epoch2date.sh | 3 +++ user_scripts/tools/.unsorted/factors.sh | 15 +++++++++++++++ user_scripts/tools/.unsorted/filestat.sh | 4 ++++ user_scripts/tools/.unsorted/filetype.sh | 4 ++++ user_scripts/tools/.unsorted/gcd.sh | 3 +++ user_scripts/tools/.unsorted/gencert.sh | 4 ++++ user_scripts/tools/.unsorted/genkey.sh | 3 +++ user_scripts/tools/.unsorted/genpass.sh | 3 +++ user_scripts/tools/.unsorted/genrsa.sh | 5 +++++ user_scripts/tools/.unsorted/hex2bin.sh | 4 ++++ user_scripts/tools/.unsorted/hex2str.sh | 3 +++ user_scripts/tools/.unsorted/hmac.sh | 3 +++ user_scripts/tools/.unsorted/ipsort.sh | 4 ++++ user_scripts/tools/.unsorted/json2csv.sh | 4 ++++ user_scripts/tools/.unsorted/jsontokv.sh | 3 +++ user_scripts/tools/.unsorted/linecount.sh | 4 ++++ user_scripts/tools/.unsorted/md5file.sh | 4 ++++ user_scripts/tools/.unsorted/md5str.sh | 3 +++ user_scripts/tools/.unsorted/md5sum.sh | 4 ++++ user_scripts/tools/.unsorted/mime.sh | 4 ++++ user_scripts/tools/.unsorted/now.sh | 2 ++ user_scripts/tools/.unsorted/nowepoch.sh | 2 ++ user_scripts/tools/.unsorted/openssldec.sh | 3 +++ user_scripts/tools/.unsorted/opensslenc.sh | 3 +++ user_scripts/tools/.unsorted/pbkdf2.sh | 3 +++ user_scripts/tools/.unsorted/prime.sh | 3 +++ user_scripts/tools/.unsorted/primes.sh | 3 +++ user_scripts/tools/.unsorted/randhex.sh | 3 +++ user_scripts/tools/.unsorted/randint.sh | 3 +++ user_scripts/tools/.unsorted/repeat.sh | 3 +++ user_scripts/tools/.unsorted/replacestr.sh | 3 +++ user_scripts/tools/.unsorted/rot13.sh | 3 +++ user_scripts/tools/.unsorted/rsadec.sh | 3 +++ user_scripts/tools/.unsorted/rsaenc.sh | 3 +++ user_scripts/tools/.unsorted/scrypt.sh | 3 +++ user_scripts/tools/.unsorted/sha1file.sh | 4 ++++ user_scripts/tools/.unsorted/sha256str.sh | 3 +++ user_scripts/tools/.unsorted/sha256sum.sh | 4 ++++ user_scripts/tools/.unsorted/sha512file.sh | 4 ++++ user_scripts/tools/.unsorted/shebang.sh | 4 ++++ user_scripts/tools/.unsorted/spacestr.sh | 3 +++ user_scripts/tools/.unsorted/str2base64.sh | 3 +++ user_scripts/tools/.unsorted/str2hex.sh | 3 +++ user_scripts/tools/.unsorted/titlecase.sh | 3 +++ user_scripts/tools/.unsorted/topwords.sh | 4 ++++ user_scripts/tools/.unsorted/totalsize.sh | 4 ++++ user_scripts/tools/.unsorted/uniqueletters.sh | 3 +++ user_scripts/tools/.unsorted/uptime.sh | 2 ++ user_scripts/tools/.unsorted/vernam.sh | 11 +++++++++++ user_scripts/tools/.unsorted/wordfreq.sh | 4 ++++ user_scripts/tools/.unsorted/wrap.sh | 3 +++ user_scripts/tools/.unsorted/xor.sh | 3 +++ 73 files changed, 269 insertions(+) create mode 100755 user_scripts/tools/.unsorted/aesdec.sh create mode 100755 user_scripts/tools/.unsorted/aesenc.sh create mode 100755 user_scripts/tools/.unsorted/argon2.sh create mode 100755 user_scripts/tools/.unsorted/base642str.sh create mode 100755 user_scripts/tools/.unsorted/bcrypt.sh create mode 100755 user_scripts/tools/.unsorted/bin2dec.sh create mode 100755 user_scripts/tools/.unsorted/bin2hex.sh create mode 100755 user_scripts/tools/.unsorted/caesar.sh create mode 100755 user_scripts/tools/.unsorted/charcount.sh create mode 100755 user_scripts/tools/.unsorted/chardist.sh create mode 100755 user_scripts/tools/.unsorted/checkport.sh create mode 100755 user_scripts/tools/.unsorted/checksum.sh create mode 100755 user_scripts/tools/.unsorted/countsubstr.sh create mode 100755 user_scripts/tools/.unsorted/crlf2lf.sh create mode 100755 user_scripts/tools/.unsorted/cronvalidate.sh create mode 100755 user_scripts/tools/.unsorted/dec2bin.sh create mode 100755 user_scripts/tools/.unsorted/dec2hex.sh create mode 100755 user_scripts/tools/.unsorted/dec2oct.sh create mode 100755 user_scripts/tools/.unsorted/diff.sh create mode 100755 user_scripts/tools/.unsorted/entropy.sh create mode 100755 user_scripts/tools/.unsorted/epoch.sh create mode 100755 user_scripts/tools/.unsorted/epoch2date.sh create mode 100755 user_scripts/tools/.unsorted/factors.sh create mode 100755 user_scripts/tools/.unsorted/filestat.sh create mode 100755 user_scripts/tools/.unsorted/filetype.sh create mode 100755 user_scripts/tools/.unsorted/gcd.sh create mode 100755 user_scripts/tools/.unsorted/gencert.sh create mode 100755 user_scripts/tools/.unsorted/genkey.sh create mode 100755 user_scripts/tools/.unsorted/genpass.sh create mode 100755 user_scripts/tools/.unsorted/genrsa.sh create mode 100755 user_scripts/tools/.unsorted/hex2bin.sh create mode 100755 user_scripts/tools/.unsorted/hex2str.sh create mode 100755 user_scripts/tools/.unsorted/hmac.sh create mode 100755 user_scripts/tools/.unsorted/ipsort.sh create mode 100755 user_scripts/tools/.unsorted/json2csv.sh create mode 100755 user_scripts/tools/.unsorted/jsontokv.sh create mode 100755 user_scripts/tools/.unsorted/linecount.sh create mode 100755 user_scripts/tools/.unsorted/md5file.sh create mode 100755 user_scripts/tools/.unsorted/md5str.sh create mode 100755 user_scripts/tools/.unsorted/md5sum.sh create mode 100755 user_scripts/tools/.unsorted/mime.sh create mode 100755 user_scripts/tools/.unsorted/now.sh create mode 100755 user_scripts/tools/.unsorted/nowepoch.sh create mode 100755 user_scripts/tools/.unsorted/openssldec.sh create mode 100755 user_scripts/tools/.unsorted/opensslenc.sh create mode 100755 user_scripts/tools/.unsorted/pbkdf2.sh create mode 100755 user_scripts/tools/.unsorted/prime.sh create mode 100755 user_scripts/tools/.unsorted/primes.sh create mode 100755 user_scripts/tools/.unsorted/randhex.sh create mode 100755 user_scripts/tools/.unsorted/randint.sh create mode 100755 user_scripts/tools/.unsorted/repeat.sh create mode 100755 user_scripts/tools/.unsorted/replacestr.sh create mode 100755 user_scripts/tools/.unsorted/rot13.sh create mode 100755 user_scripts/tools/.unsorted/rsadec.sh create mode 100755 user_scripts/tools/.unsorted/rsaenc.sh create mode 100755 user_scripts/tools/.unsorted/scrypt.sh create mode 100755 user_scripts/tools/.unsorted/sha1file.sh create mode 100755 user_scripts/tools/.unsorted/sha256str.sh create mode 100755 user_scripts/tools/.unsorted/sha256sum.sh create mode 100755 user_scripts/tools/.unsorted/sha512file.sh create mode 100755 user_scripts/tools/.unsorted/shebang.sh create mode 100755 user_scripts/tools/.unsorted/spacestr.sh create mode 100755 user_scripts/tools/.unsorted/str2base64.sh create mode 100755 user_scripts/tools/.unsorted/str2hex.sh create mode 100755 user_scripts/tools/.unsorted/titlecase.sh create mode 100755 user_scripts/tools/.unsorted/topwords.sh create mode 100755 user_scripts/tools/.unsorted/totalsize.sh create mode 100755 user_scripts/tools/.unsorted/uniqueletters.sh create mode 100755 user_scripts/tools/.unsorted/uptime.sh create mode 100755 user_scripts/tools/.unsorted/vernam.sh create mode 100755 user_scripts/tools/.unsorted/wordfreq.sh create mode 100755 user_scripts/tools/.unsorted/wrap.sh create mode 100755 user_scripts/tools/.unsorted/xor.sh diff --git a/user_scripts/tools/.unsorted/aesdec.sh b/user_scripts/tools/.unsorted/aesdec.sh new file mode 100755 index 00000000..9bfb13ab --- /dev/null +++ b/user_scripts/tools/.unsorted/aesdec.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl enc -aes-128-cbc -d -in "$1" -out "$3" -pass pass:"$2" 2>/dev/null || echo "OpenSSL required" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/aesenc.sh b/user_scripts/tools/.unsorted/aesenc.sh new file mode 100755 index 00000000..9af8d1e9 --- /dev/null +++ b/user_scripts/tools/.unsorted/aesenc.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl enc -aes-128-cbc -salt -in "$1" -out "$3" -pass pass:"$2" -e 2>/dev/null || echo "OpenSSL required" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/argon2.sh b/user_scripts/tools/.unsorted/argon2.sh new file mode 100755 index 00000000..d05f842f --- /dev/null +++ b/user_scripts/tools/.unsorted/argon2.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import argon2; print(argon2.PasswordHasher().hash('$1'))" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/base642str.sh b/user_scripts/tools/.unsorted/base642str.sh new file mode 100755 index 00000000..87ed79fd --- /dev/null +++ b/user_scripts/tools/.unsorted/base642str.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | base64 -d \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/bcrypt.sh b/user_scripts/tools/.unsorted/bcrypt.sh new file mode 100755 index 00000000..ed0d1935 --- /dev/null +++ b/user_scripts/tools/.unsorted/bcrypt.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import bcrypt; print(bcrypt.hashpw('$1'.encode(), bcrypt.gensalt()).decode())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/bin2dec.sh b/user_scripts/tools/.unsorted/bin2dec.sh new file mode 100755 index 00000000..7ee5e870 --- /dev/null +++ b/user_scripts/tools/.unsorted/bin2dec.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "print(int('$1',2))" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/bin2hex.sh b/user_scripts/tools/.unsorted/bin2hex.sh new file mode 100755 index 00000000..38249f13 --- /dev/null +++ b/user_scripts/tools/.unsorted/bin2hex.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +xxd -p "$1" | tr -d '\n' \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/caesar.sh b/user_scripts/tools/.unsorted/caesar.sh new file mode 100755 index 00000000..66187880 --- /dev/null +++ b/user_scripts/tools/.unsorted/caesar.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 '' "; exit 1; } +echo "$1" | tr 'A-Z' "$(echo {A..Z} | tr ' ' '\n' | sed -n "$2,\$p;1,$(( $2 - 1 ))p" | tr '\n' ' ' | sed 's/ //g')" | tr 'a-z' "$(echo {a..z} | tr ' ' '\n' | sed -n "$2,\$p;1,$(( $2 - 1 ))p" | tr '\n' ' ' | sed 's/ //g')" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/charcount.sh b/user_scripts/tools/.unsorted/charcount.sh new file mode 100755 index 00000000..a8758877 --- /dev/null +++ b/user_scripts/tools/.unsorted/charcount.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | sed 's/\(.\)/\1\n/g' | awk 'BEGIN{OFS="\n"}{print $0}' | grep -c . \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/chardist.sh b/user_scripts/tools/.unsorted/chardist.sh new file mode 100755 index 00000000..72371c16 --- /dev/null +++ b/user_scripts/tools/.unsorted/chardist.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | sed 's/./&\n/g' | sort | uniq -c | sort -rn \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/checkport.sh b/user_scripts/tools/.unsorted/checkport.sh new file mode 100755 index 00000000..7b9379db --- /dev/null +++ b/user_scripts/tools/.unsorted/checkport.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +timeout 5 bash -c "echo '' > /dev/tcp/$1/$2" 2>/dev/null && echo "OPEN" || echo "CLOSED" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/checksum.sh b/user_scripts/tools/.unsorted/checksum.sh new file mode 100755 index 00000000..ec5b6cc9 --- /dev/null +++ b/user_scripts/tools/.unsorted/checksum.sh @@ -0,0 +1,6 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +echo "MD5: $(md5sum "$1" | cut -d' ' -f1)" +echo "SHA1: $(sha1sum "$1" | cut -d' ' -f1)" +echo "SHA256: $(sha256sum "$1" | cut -d' ' -f1)" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/countsubstr.sh b/user_scripts/tools/.unsorted/countsubstr.sh new file mode 100755 index 00000000..0e9190db --- /dev/null +++ b/user_scripts/tools/.unsorted/countsubstr.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 '' ''"; exit 1; } +count=$(echo "$1" | grep -o "$2" | wc -l) +echo "Found: $count" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/crlf2lf.sh b/user_scripts/tools/.unsorted/crlf2lf.sh new file mode 100755 index 00000000..ccb2a370 --- /dev/null +++ b/user_scripts/tools/.unsorted/crlf2lf.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed -i 's/\r$//' "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/cronvalidate.sh b/user_scripts/tools/.unsorted/cronvalidate.sh new file mode 100755 index 00000000..af870fef --- /dev/null +++ b/user_scripts/tools/.unsorted/cronvalidate.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "from croniter import croniter; croniter('$1',0)" 2>/dev/null && echo "Valid" || echo "Invalid" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/dec2bin.sh b/user_scripts/tools/.unsorted/dec2bin.sh new file mode 100755 index 00000000..149aab99 --- /dev/null +++ b/user_scripts/tools/.unsorted/dec2bin.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "print(bin(int('$1',10))[2:])" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/dec2hex.sh b/user_scripts/tools/.unsorted/dec2hex.sh new file mode 100755 index 00000000..ebf153e5 --- /dev/null +++ b/user_scripts/tools/.unsorted/dec2hex.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "print(hex(int('$1',10))[2:])" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/dec2oct.sh b/user_scripts/tools/.unsorted/dec2oct.sh new file mode 100755 index 00000000..9091fcbb --- /dev/null +++ b/user_scripts/tools/.unsorted/dec2oct.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "print(oct(int('$1',10))[2:])" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/diff.sh b/user_scripts/tools/.unsorted/diff.sh new file mode 100755 index 00000000..52090e7e --- /dev/null +++ b/user_scripts/tools/.unsorted/diff.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +cmp -s "$1" "$2" && echo "IDENTICAL" || echo "DIFFERENT" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/entropy.sh b/user_scripts/tools/.unsorted/entropy.sh new file mode 100755 index 00000000..e7e68c6b --- /dev/null +++ b/user_scripts/tools/.unsorted/entropy.sh @@ -0,0 +1,12 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c " +import sys, math, collections +text = open('$1').read() +freq = collections.Counter(text) +total = len(text) +entropy = -sum((f/total)*math.log2(f/total) for f in freq.values()) +print(f'Entropy: {entropy:.4f} bits/char') +print(f'Total bytes: {total}') +print(f'Unique chars: {len(freq)}') +" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/epoch.sh b/user_scripts/tools/.unsorted/epoch.sh new file mode 100755 index 00000000..7647ba0f --- /dev/null +++ b/user_scripts/tools/.unsorted/epoch.sh @@ -0,0 +1,2 @@ +#!/bin/bash +date +%s \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/epoch2date.sh b/user_scripts/tools/.unsorted/epoch2date.sh new file mode 100755 index 00000000..32ec3a74 --- /dev/null +++ b/user_scripts/tools/.unsorted/epoch2date.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import datetime; print(datetime.timedelta(seconds=${1}))" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/factors.sh b/user_scripts/tools/.unsorted/factors.sh new file mode 100755 index 00000000..8de4a186 --- /dev/null +++ b/user_scripts/tools/.unsorted/factors.sh @@ -0,0 +1,15 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c " +import sys +n=int('$1') +factors=[] +d=2 +while d*d<=n: + while n%d==0: + factors.append(d) + n//=d + d+=1 +if n>1: factors.append(n) +print(' x '.join(map(str,factors))) +" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/filestat.sh b/user_scripts/tools/.unsorted/filestat.sh new file mode 100755 index 00000000..9fc5ed4e --- /dev/null +++ b/user_scripts/tools/.unsorted/filestat.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +stat --printf="Size: %s bytes\nModified: %y\nAccess: %x\n" "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/filetype.sh b/user_scripts/tools/.unsorted/filetype.sh new file mode 100755 index 00000000..f634fb65 --- /dev/null +++ b/user_scripts/tools/.unsorted/filetype.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +file "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/gcd.sh b/user_scripts/tools/.unsorted/gcd.sh new file mode 100755 index 00000000..44541cdd --- /dev/null +++ b/user_scripts/tools/.unsorted/gcd.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "print('GCD:',eval('import math;math.gcd($1,$2)'))" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/gencert.sh b/user_scripts/tools/.unsorted/gencert.sh new file mode 100755 index 00000000..f78e4076 --- /dev/null +++ b/user_scripts/tools/.unsorted/gencert.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl req -x509 -newkey rsa:2048 -keyout "$3".key -out "$3" -days "$2" -nodes -subj "/CN=$1" 2>/dev/null +echo "Cert: $3, Key: $3.key" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/genkey.sh b/user_scripts/tools/.unsorted/genkey.sh new file mode 100755 index 00000000..0da35ab3 --- /dev/null +++ b/user_scripts/tools/.unsorted/genkey.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +openssl rand -hex "${1:-32}" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/genpass.sh b/user_scripts/tools/.unsorted/genpass.sh new file mode 100755 index 00000000..fa52a936 --- /dev/null +++ b/user_scripts/tools/.unsorted/genpass.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +openssl rand -base64 "${1:-32}" | tr -d '\n=/' | cut -c1-"$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/genrsa.sh b/user_scripts/tools/.unsorted/genrsa.sh new file mode 100755 index 00000000..7bd958e3 --- /dev/null +++ b/user_scripts/tools/.unsorted/genrsa.sh @@ -0,0 +1,5 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +openssl genrsa -out "$2".pem "${1:-2048}" 2>/dev/null +openssl rsa -in "$2".pem -pubout -out "$2".pub.pem 2>/dev/null +echo "Keys: $2.pem (private), $2.pub.pem (public)" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/hex2bin.sh b/user_scripts/tools/.unsorted/hex2bin.sh new file mode 100755 index 00000000..4fd7461a --- /dev/null +++ b/user_scripts/tools/.unsorted/hex2bin.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +xxd -r -p "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/hex2str.sh b/user_scripts/tools/.unsorted/hex2str.sh new file mode 100755 index 00000000..8221897e --- /dev/null +++ b/user_scripts/tools/.unsorted/hex2str.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | xxd -r -p \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/hmac.sh b/user_scripts/tools/.unsorted/hmac.sh new file mode 100755 index 00000000..4cdfe577 --- /dev/null +++ b/user_scripts/tools/.unsorted/hmac.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "import hmac,hashlib,sys; print(hmac.new(b'$1',b'$2',hashlib.sha256).hexdigest())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/ipsort.sh b/user_scripts/tools/.unsorted/ipsort.sh new file mode 100755 index 00000000..bdb8a8e5 --- /dev/null +++ b/user_scripts/tools/.unsorted/ipsort.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sort -t. -k1,1n -k2,2n -k3,3n -k4,4n "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/json2csv.sh b/user_scripts/tools/.unsorted/json2csv.sh new file mode 100755 index 00000000..c477da81 --- /dev/null +++ b/user_scripts/tools/.unsorted/json2csv.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -c "import csv,sys,json; r=csv.DictReader(sys.stdin); print(json.dumps(list(r)))" < "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/jsontokv.sh b/user_scripts/tools/.unsorted/jsontokv.sh new file mode 100755 index 00000000..e62e88ad --- /dev/null +++ b/user_scripts/tools/.unsorted/jsontokv.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import json,sys; d=json.loads('$1'); [print(k,'=',v) for k,v in d.items()]" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/linecount.sh b/user_scripts/tools/.unsorted/linecount.sh new file mode 100755 index 00000000..6d610a8f --- /dev/null +++ b/user_scripts/tools/.unsorted/linecount.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +wc -l "$1" && echo "Lines with non-empty:" && grep -c . "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/md5file.sh b/user_scripts/tools/.unsorted/md5file.sh new file mode 100755 index 00000000..b3c4ff79 --- /dev/null +++ b/user_scripts/tools/.unsorted/md5file.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +openssl dgst -md5 "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/md5str.sh b/user_scripts/tools/.unsorted/md5str.sh new file mode 100755 index 00000000..e3b49269 --- /dev/null +++ b/user_scripts/tools/.unsorted/md5str.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import hashlib; print(hashlib.md5(b'$1').hexdigest())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/md5sum.sh b/user_scripts/tools/.unsorted/md5sum.sh new file mode 100755 index 00000000..6d32ef7d --- /dev/null +++ b/user_scripts/tools/.unsorted/md5sum.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +md5sum "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/mime.sh b/user_scripts/tools/.unsorted/mime.sh new file mode 100755 index 00000000..5a39119f --- /dev/null +++ b/user_scripts/tools/.unsorted/mime.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +head -c 512 "$1" | file - \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/now.sh b/user_scripts/tools/.unsorted/now.sh new file mode 100755 index 00000000..ca8ecc98 --- /dev/null +++ b/user_scripts/tools/.unsorted/now.sh @@ -0,0 +1,2 @@ +#!/bin/bash +date '+%Y-%m-%d %H:%M:%S' \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/nowepoch.sh b/user_scripts/tools/.unsorted/nowepoch.sh new file mode 100755 index 00000000..92db2474 --- /dev/null +++ b/user_scripts/tools/.unsorted/nowepoch.sh @@ -0,0 +1,2 @@ +#!/bin/bash +python3 -c "import datetime; print(datetime.datetime.now().timestamp())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/openssldec.sh b/user_scripts/tools/.unsorted/openssldec.sh new file mode 100755 index 00000000..3452b171 --- /dev/null +++ b/user_scripts/tools/.unsorted/openssldec.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl enc -aes-256-cbc -d -pbkdf2 -iter 100000 -in "$1" -out "$3" -pass pass:"$2" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/opensslenc.sh b/user_scripts/tools/.unsorted/opensslenc.sh new file mode 100755 index 00000000..63120707 --- /dev/null +++ b/user_scripts/tools/.unsorted/opensslenc.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl enc -aes-256-cbc -salt -pbkdf2 -iter 100000 -in "$1" -out "$3" -pass pass:"$2" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/pbkdf2.sh b/user_scripts/tools/.unsorted/pbkdf2.sh new file mode 100755 index 00000000..52c4b0f2 --- /dev/null +++ b/user_scripts/tools/.unsorted/pbkdf2.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import hashlib; print(hashlib.pbkdf2_hmac('sha256', '$1'.encode(), b'salt', 100000).hex())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/prime.sh b/user_scripts/tools/.unsorted/prime.sh new file mode 100755 index 00000000..5f669c7f --- /dev/null +++ b/user_scripts/tools/.unsorted/prime.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "import math; print('Prime' if all($1%i for i in range(2,int(math.sqrt(abs($1)))+1))) and $1>1 else 'Not prime')" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/primes.sh b/user_scripts/tools/.unsorted/primes.sh new file mode 100755 index 00000000..4dc5d44f --- /dev/null +++ b/user_scripts/tools/.unsorted/primes.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "print([i for i in range(2,int('$1')+1) if all(i%j for j in range(2,i))])" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/randhex.sh b/user_scripts/tools/.unsorted/randhex.sh new file mode 100755 index 00000000..91afc2ea --- /dev/null +++ b/user_scripts/tools/.unsorted/randhex.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +openssl rand -hex "${1:-32}" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/randint.sh b/user_scripts/tools/.unsorted/randint.sh new file mode 100755 index 00000000..76deb71d --- /dev/null +++ b/user_scripts/tools/.unsorted/randint.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "import random,sys; print(random.randint(int('$1'),int('$2')))" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/repeat.sh b/user_scripts/tools/.unsorted/repeat.sh new file mode 100755 index 00000000..956752d4 --- /dev/null +++ b/user_scripts/tools/.unsorted/repeat.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 '' "; exit 1; } +python3 -c "print('$1' * int('$2'))" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/replacestr.sh b/user_scripts/tools/.unsorted/replacestr.sh new file mode 100755 index 00000000..06d5aa51 --- /dev/null +++ b/user_scripts/tools/.unsorted/replacestr.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 '' ''"; exit 1; } +echo "${1//$2/}" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/rot13.sh b/user_scripts/tools/.unsorted/rot13.sh new file mode 100755 index 00000000..878cf432 --- /dev/null +++ b/user_scripts/tools/.unsorted/rot13.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | tr 'A-Za-z' 'N-ZA-Mn-za-m' \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/rsadec.sh b/user_scripts/tools/.unsorted/rsadec.sh new file mode 100755 index 00000000..22a120c5 --- /dev/null +++ b/user_scripts/tools/.unsorted/rsadec.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl rsautl -decrypt -inkey "$2" -in "$1" -out "$3" 2>/dev/null || echo "OpenSSL required" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/rsaenc.sh b/user_scripts/tools/.unsorted/rsaenc.sh new file mode 100755 index 00000000..29d0f0cc --- /dev/null +++ b/user_scripts/tools/.unsorted/rsaenc.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 3 ]] && { echo "Usage: $0 "; exit 1; } +openssl rsautl -encrypt -pubin -inkey "$2" -in <(echo "$1") -out "$3" 2>/dev/null || echo "OpenSSL required" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/scrypt.sh b/user_scripts/tools/.unsorted/scrypt.sh new file mode 100755 index 00000000..776fbc12 --- /dev/null +++ b/user_scripts/tools/.unsorted/scrypt.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import hashlib; print(hashlib.scrypt('$1'.encode(), salt=b'salt', n=16384, r=8, p=1).hex())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/sha1file.sh b/user_scripts/tools/.unsorted/sha1file.sh new file mode 100755 index 00000000..f2a215f9 --- /dev/null +++ b/user_scripts/tools/.unsorted/sha1file.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +openssl dgst -sha1 "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/sha256str.sh b/user_scripts/tools/.unsorted/sha256str.sh new file mode 100755 index 00000000..f0dd7d37 --- /dev/null +++ b/user_scripts/tools/.unsorted/sha256str.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +python3 -c "import hashlib; print(hashlib.sha256(b'$1').hexdigest())" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/sha256sum.sh b/user_scripts/tools/.unsorted/sha256sum.sh new file mode 100755 index 00000000..e646ec76 --- /dev/null +++ b/user_scripts/tools/.unsorted/sha256sum.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sha256sum "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/sha512file.sh b/user_scripts/tools/.unsorted/sha512file.sh new file mode 100755 index 00000000..0373e4a1 --- /dev/null +++ b/user_scripts/tools/.unsorted/sha512file.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +openssl dgst -sha512 "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/shebang.sh b/user_scripts/tools/.unsorted/shebang.sh new file mode 100755 index 00000000..89dabb3a --- /dev/null +++ b/user_scripts/tools/.unsorted/shebang.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '/^#!/{print;exit}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/spacestr.sh b/user_scripts/tools/.unsorted/spacestr.sh new file mode 100755 index 00000000..4fbd77c0 --- /dev/null +++ b/user_scripts/tools/.unsorted/spacestr.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | sed 's/./& /g' | fold -w 80 \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/str2base64.sh b/user_scripts/tools/.unsorted/str2base64.sh new file mode 100755 index 00000000..229bec00 --- /dev/null +++ b/user_scripts/tools/.unsorted/str2base64.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | base64 \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/str2hex.sh b/user_scripts/tools/.unsorted/str2hex.sh new file mode 100755 index 00000000..039e2299 --- /dev/null +++ b/user_scripts/tools/.unsorted/str2hex.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo -n "$1" | xxd -p | tr -d '\n' \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/titlecase.sh b/user_scripts/tools/.unsorted/titlecase.sh new file mode 100755 index 00000000..11918fa4 --- /dev/null +++ b/user_scripts/tools/.unsorted/titlecase.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | sed -e 's/\([A-Z]\)/ \1/g' -e 's/^ //' \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/topwords.sh b/user_scripts/tools/.unsorted/topwords.sh new file mode 100755 index 00000000..ff878f38 --- /dev/null +++ b/user_scripts/tools/.unsorted/topwords.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NF, $0}' "$1" | sort -rn | head -5 \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/totalsize.sh b/user_scripts/tools/.unsorted/totalsize.sh new file mode 100755 index 00000000..a6156d53 --- /dev/null +++ b/user_scripts/tools/.unsorted/totalsize.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +find "$1" -type f -printf '%s\n' | awk '{sum+=$1} END{printf "%.0f bytes\n", sum}' \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/uniqueletters.sh b/user_scripts/tools/.unsorted/uniqueletters.sh new file mode 100755 index 00000000..e4710581 --- /dev/null +++ b/user_scripts/tools/.unsorted/uniqueletters.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 ''"; exit 1; } +echo "$1" | sed 's/\(.\)/\1\n/g' | grep -v '^$' | sort -u \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/uptime.sh b/user_scripts/tools/.unsorted/uptime.sh new file mode 100755 index 00000000..e00bea61 --- /dev/null +++ b/user_scripts/tools/.unsorted/uptime.sh @@ -0,0 +1,2 @@ +#!/bin/bash +uptime -p 2>/dev/null || uptime \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/vernam.sh b/user_scripts/tools/.unsorted/vernam.sh new file mode 100755 index 00000000..c147672e --- /dev/null +++ b/user_scripts/tools/.unsorted/vernam.sh @@ -0,0 +1,11 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c " +f=open('$1','rb').read() +k=int('$2',16) +result=bytearray() +for i,b in enumerate(f): + result.append(b^(k>>(i*8)&0xff)) +open('$1.xor','wb').write(result) +print('Done: $1.xor') +" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/wordfreq.sh b/user_scripts/tools/.unsorted/wordfreq.sh new file mode 100755 index 00000000..ea1b9d50 --- /dev/null +++ b/user_scripts/tools/.unsorted/wordfreq.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{for(i=1;i<=NF;i++)freq[$i]++} END{for(w in freq)print freq[w],w}' "$1" | sort -rn | head -10 \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/wrap.sh b/user_scripts/tools/.unsorted/wrap.sh new file mode 100755 index 00000000..71315679 --- /dev/null +++ b/user_scripts/tools/.unsorted/wrap.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 '' "; exit 1; } +echo "$1" | fold -w "${2:-80}" \ No newline at end of file diff --git a/user_scripts/tools/.unsorted/xor.sh b/user_scripts/tools/.unsorted/xor.sh new file mode 100755 index 00000000..2a2807e5 --- /dev/null +++ b/user_scripts/tools/.unsorted/xor.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 2 ]] && { echo "Usage: $0 "; exit 1; } +paste <(xxd -p "$1") <(xxd -p "$2") | awk '{for(i=1;i<=NF;i+=2)printf "%x ", xor("0x"$i,"0x"$(i+1)); print ""}' \ No newline at end of file From 204a6ad005acbae4623b47ed8c6bfcdf1abd38de Mon Sep 17 00:00:00 2001 From: Astraxical Date: Mon, 18 May 2026 20:34:48 +0900 Subject: [PATCH 3/4] Make Safety Close and Close Workspace Wor --- .config/hypr/source/keybinds.lua | 4 ++-- user_scripts/tools/c/base64dec.sh | 4 ++++ user_scripts/tools/c/base64enc.sh | 4 ++++ user_scripts/tools/c/charlen.sh | 4 ++++ user_scripts/tools/c/chars.sh | 4 ++++ user_scripts/tools/c/collapse_spaces.sh | 4 ++++ user_scripts/tools/c/comments.sh | 4 ++++ user_scripts/tools/c/countdups.sh | 4 ++++ user_scripts/tools/c/csv2json.sh | 4 ++++ user_scripts/tools/c/dupn.sh | 4 ++++ user_scripts/tools/c/first10.sh | 4 ++++ user_scripts/tools/c/firstline.sh | 4 ++++ user_scripts/tools/c/firstnonempty.sh | 4 ++++ user_scripts/tools/c/hashfile.sh | 4 ++++ user_scripts/tools/c/hexdump.sh | 4 ++++ user_scripts/tools/c/htmldecode.sh | 4 ++++ user_scripts/tools/c/htmlencode.sh | 4 ++++ user_scripts/tools/c/jsonfmt.sh | 4 ++++ user_scripts/tools/c/jsonmin.sh | 4 ++++ user_scripts/tools/c/last10.sh | 4 ++++ user_scripts/tools/c/lastline.sh | 4 ++++ user_scripts/tools/c/lastnonempty.sh | 4 ++++ user_scripts/tools/c/lastnonempty2.sh | 4 ++++ user_scripts/tools/c/lastnonemptyline.sh | 4 ++++ user_scripts/tools/c/line5.sh | 4 ++++ user_scripts/tools/c/linenumbers.sh | 4 ++++ user_scripts/tools/c/lines.sh | 4 ++++ user_scripts/tools/c/longestline.sh | 4 ++++ user_scripts/tools/c/longestlinebywords.sh | 4 ++++ user_scripts/tools/c/lowercase.sh | 4 ++++ user_scripts/tools/c/ltrim.sh | 4 ++++ user_scripts/tools/c/nocomments.sh | 4 ++++ user_scripts/tools/c/nonempty.sh | 4 ++++ user_scripts/tools/c/nonempty_linescount.sh | 4 ++++ user_scripts/tools/c/nonemptycount.sh | 4 ++++ user_scripts/tools/c/numberall.sh | 4 ++++ user_scripts/tools/c/numprefix.sh | 4 ++++ user_scripts/tools/c/randomstr.sh | 3 +++ user_scripts/tools/c/remblanklines.sh | 4 ++++ user_scripts/tools/c/remempty.sh | 4 ++++ user_scripts/tools/c/reversechars.sh | 4 ++++ user_scripts/tools/c/reverselines.sh | 4 ++++ user_scripts/tools/c/reversesort.sh | 4 ++++ user_scripts/tools/c/rtrim.sh | 4 ++++ user_scripts/tools/c/shortestbywords.sh | 4 ++++ user_scripts/tools/c/shortestline.sh | 4 ++++ user_scripts/tools/c/showinvis.sh | 4 ++++ user_scripts/tools/c/sort.sh | 4 ++++ user_scripts/tools/c/sortalen.sh | 4 ++++ user_scripts/tools/c/spaces2tabs.sh | 4 ++++ user_scripts/tools/c/sufixn.sh | 4 ++++ user_scripts/tools/c/tabstospaces.sh | 4 ++++ user_scripts/tools/c/totalchars.sh | 4 ++++ user_scripts/tools/c/totalcount.sh | 4 ++++ user_scripts/tools/c/totalwords.sh | 4 ++++ user_scripts/tools/c/trim.sh | 4 ++++ user_scripts/tools/c/tripple.sh | 4 ++++ user_scripts/tools/c/uniquelines.sh | 4 ++++ user_scripts/tools/c/uppercase.sh | 4 ++++ user_scripts/tools/c/urldecode.sh | 4 ++++ user_scripts/tools/c/urlencode.sh | 4 ++++ user_scripts/tools/c/uuid.sh | 3 +++ user_scripts/tools/c/wordcount.sh | 4 ++++ user_scripts/tools/c/words.sh | 4 ++++ user_scripts/tools/workspace/close-workspace.sh | 2 +- user_scripts/tools/workspace/safety-close.sh | 4 ++-- 66 files changed, 255 insertions(+), 5 deletions(-) create mode 100644 user_scripts/tools/c/base64dec.sh create mode 100644 user_scripts/tools/c/base64enc.sh create mode 100755 user_scripts/tools/c/charlen.sh create mode 100755 user_scripts/tools/c/chars.sh create mode 100755 user_scripts/tools/c/collapse_spaces.sh create mode 100755 user_scripts/tools/c/comments.sh create mode 100755 user_scripts/tools/c/countdups.sh create mode 100644 user_scripts/tools/c/csv2json.sh create mode 100755 user_scripts/tools/c/dupn.sh create mode 100755 user_scripts/tools/c/first10.sh create mode 100755 user_scripts/tools/c/firstline.sh create mode 100755 user_scripts/tools/c/firstnonempty.sh create mode 100644 user_scripts/tools/c/hashfile.sh create mode 100644 user_scripts/tools/c/hexdump.sh create mode 100644 user_scripts/tools/c/htmldecode.sh create mode 100644 user_scripts/tools/c/htmlencode.sh create mode 100644 user_scripts/tools/c/jsonfmt.sh create mode 100644 user_scripts/tools/c/jsonmin.sh create mode 100755 user_scripts/tools/c/last10.sh create mode 100755 user_scripts/tools/c/lastline.sh create mode 100755 user_scripts/tools/c/lastnonempty.sh create mode 100755 user_scripts/tools/c/lastnonempty2.sh create mode 100755 user_scripts/tools/c/lastnonemptyline.sh create mode 100755 user_scripts/tools/c/line5.sh create mode 100755 user_scripts/tools/c/linenumbers.sh create mode 100755 user_scripts/tools/c/lines.sh create mode 100755 user_scripts/tools/c/longestline.sh create mode 100755 user_scripts/tools/c/longestlinebywords.sh create mode 100755 user_scripts/tools/c/lowercase.sh create mode 100755 user_scripts/tools/c/ltrim.sh create mode 100755 user_scripts/tools/c/nocomments.sh create mode 100755 user_scripts/tools/c/nonempty.sh create mode 100755 user_scripts/tools/c/nonempty_linescount.sh create mode 100755 user_scripts/tools/c/nonemptycount.sh create mode 100755 user_scripts/tools/c/numberall.sh create mode 100755 user_scripts/tools/c/numprefix.sh create mode 100644 user_scripts/tools/c/randomstr.sh create mode 100755 user_scripts/tools/c/remblanklines.sh create mode 100755 user_scripts/tools/c/remempty.sh create mode 100755 user_scripts/tools/c/reversechars.sh create mode 100755 user_scripts/tools/c/reverselines.sh create mode 100755 user_scripts/tools/c/reversesort.sh create mode 100755 user_scripts/tools/c/rtrim.sh create mode 100755 user_scripts/tools/c/shortestbywords.sh create mode 100755 user_scripts/tools/c/shortestline.sh create mode 100755 user_scripts/tools/c/showinvis.sh create mode 100755 user_scripts/tools/c/sort.sh create mode 100755 user_scripts/tools/c/sortalen.sh create mode 100755 user_scripts/tools/c/spaces2tabs.sh create mode 100755 user_scripts/tools/c/sufixn.sh create mode 100755 user_scripts/tools/c/tabstospaces.sh create mode 100755 user_scripts/tools/c/totalchars.sh create mode 100755 user_scripts/tools/c/totalcount.sh create mode 100755 user_scripts/tools/c/totalwords.sh create mode 100755 user_scripts/tools/c/trim.sh create mode 100755 user_scripts/tools/c/tripple.sh create mode 100755 user_scripts/tools/c/uniquelines.sh create mode 100755 user_scripts/tools/c/uppercase.sh create mode 100644 user_scripts/tools/c/urldecode.sh create mode 100644 user_scripts/tools/c/urlencode.sh create mode 100644 user_scripts/tools/c/uuid.sh create mode 100755 user_scripts/tools/c/wordcount.sh create mode 100755 user_scripts/tools/c/words.sh diff --git a/.config/hypr/source/keybinds.lua b/.config/hypr/source/keybinds.lua index 87803f67..1c245b45 100644 --- a/.config/hypr/source/keybinds.lua +++ b/.config/hypr/source/keybinds.lua @@ -536,14 +536,14 @@ hl.bind( { description = "Close Window" } ) --- /user_scripts/tools/workspace/close-workspace.sh -- Not Done/Forgotten +-- /user_scripts/tools/workspace/close-workspace.sh -- Working Feature but Unsure -- hl.bind( -- "SUPER + SHIFT + C", -- hl.dsp.exec_cmd(dusky_scripts .. "tools/workspace/close-workspace.sh"), -- { description = "Close Workspace" } -- ) --- /user_scripts/tools/workspace/close-workspace.sh -- Not Done/Forgotten +-- /user_scripts/tools/workspace/close-workspace.sh -- Working Feature but Unsure -- hl.bind( -- "SUPER + SHIFT + B", -- hl.dsp.exec_cmd(dusky_scripts .. "tools/workspace/close-workspace.sh"), diff --git a/user_scripts/tools/c/base64dec.sh b/user_scripts/tools/c/base64dec.sh new file mode 100644 index 00000000..655d1ed4 --- /dev/null +++ b/user_scripts/tools/c/base64dec.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +openssl base64 -d < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/base64enc.sh b/user_scripts/tools/c/base64enc.sh new file mode 100644 index 00000000..ad40f940 --- /dev/null +++ b/user_scripts/tools/c/base64enc.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +openssl base64 -A < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/charlen.sh b/user_scripts/tools/c/charlen.sh new file mode 100755 index 00000000..ca79eada --- /dev/null +++ b/user_scripts/tools/c/charlen.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print length}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/chars.sh b/user_scripts/tools/c/chars.sh new file mode 100755 index 00000000..f8a47723 --- /dev/null +++ b/user_scripts/tools/c/chars.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +wc -c "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/collapse_spaces.sh b/user_scripts/tools/c/collapse_spaces.sh new file mode 100755 index 00000000..26a7e948 --- /dev/null +++ b/user_scripts/tools/c/collapse_spaces.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/ */ /g' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/comments.sh b/user_scripts/tools/c/comments.sh new file mode 100755 index 00000000..099b8c45 --- /dev/null +++ b/user_scripts/tools/c/comments.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep '^#' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/countdups.sh b/user_scripts/tools/c/countdups.sh new file mode 100755 index 00000000..0f4360ec --- /dev/null +++ b/user_scripts/tools/c/countdups.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sort "$1" | uniq -c | sort -rn \ No newline at end of file diff --git a/user_scripts/tools/c/csv2json.sh b/user_scripts/tools/c/csv2json.sh new file mode 100644 index 00000000..003bbfa7 --- /dev/null +++ b/user_scripts/tools/c/csv2json.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk -F, 'BEGIN{print "["} NR>1{printf "%s{\"col1\":\"%s\",\"col2\":\"%s\"}",(NR>2?",":""),$1,$2} END{print "]"}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/dupn.sh b/user_scripts/tools/c/dupn.sh new file mode 100755 index 00000000..f235dbfa --- /dev/null +++ b/user_scripts/tools/c/dupn.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk 'BEGIN{for(i=1;i<=100;i++)printf "%s%s", $0, (i%10?"":ORS)}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/first10.sh b/user_scripts/tools/c/first10.sh new file mode 100755 index 00000000..b35f5ae2 --- /dev/null +++ b/user_scripts/tools/c/first10.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed -n '1,10p' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/firstline.sh b/user_scripts/tools/c/firstline.sh new file mode 100755 index 00000000..9a2f5508 --- /dev/null +++ b/user_scripts/tools/c/firstline.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed -n '1p' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/firstnonempty.sh b/user_scripts/tools/c/firstnonempty.sh new file mode 100755 index 00000000..7f298c5e --- /dev/null +++ b/user_scripts/tools/c/firstnonempty.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -v '^$' "$1" | head -1 \ No newline at end of file diff --git a/user_scripts/tools/c/hashfile.sh b/user_scripts/tools/c/hashfile.sh new file mode 100644 index 00000000..787cca95 --- /dev/null +++ b/user_scripts/tools/c/hashfile.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +openssl dgst -sha256 "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/hexdump.sh b/user_scripts/tools/c/hexdump.sh new file mode 100644 index 00000000..e238bc5d --- /dev/null +++ b/user_scripts/tools/c/hexdump.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +xxd "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/htmldecode.sh b/user_scripts/tools/c/htmldecode.sh new file mode 100644 index 00000000..13e776ab --- /dev/null +++ b/user_scripts/tools/c/htmldecode.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -c "import html,sys; print(html.unescape(sys.stdin.read()))" < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/htmlencode.sh b/user_scripts/tools/c/htmlencode.sh new file mode 100644 index 00000000..1dc431e1 --- /dev/null +++ b/user_scripts/tools/c/htmlencode.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -c "import html,sys; print(html.escape(sys.stdin.read()))" < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/jsonfmt.sh b/user_scripts/tools/c/jsonfmt.sh new file mode 100644 index 00000000..b95bedca --- /dev/null +++ b/user_scripts/tools/c/jsonfmt.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -m json.tool "$1" 2>/dev/null || jq . "$1" 2>/dev/null || echo "Error: json tool or jq required" \ No newline at end of file diff --git a/user_scripts/tools/c/jsonmin.sh b/user_scripts/tools/c/jsonmin.sh new file mode 100644 index 00000000..d171a333 --- /dev/null +++ b/user_scripts/tools/c/jsonmin.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -c "import json,sys; print(json.dumps(json.load(sys.stdin), separators=(',',':')))" < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/last10.sh b/user_scripts/tools/c/last10.sh new file mode 100755 index 00000000..00193bea --- /dev/null +++ b/user_scripts/tools/c/last10.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +tail -10 "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/lastline.sh b/user_scripts/tools/c/lastline.sh new file mode 100755 index 00000000..c0543562 --- /dev/null +++ b/user_scripts/tools/c/lastline.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +tail -1 "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/lastnonempty.sh b/user_scripts/tools/c/lastnonempty.sh new file mode 100755 index 00000000..e38107bf --- /dev/null +++ b/user_scripts/tools/c/lastnonempty.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -n '[[:alnum:]]' "$1" | sed 's/:.*//' | sort -n | tail -1 \ No newline at end of file diff --git a/user_scripts/tools/c/lastnonempty2.sh b/user_scripts/tools/c/lastnonempty2.sh new file mode 100755 index 00000000..fc5e8c26 --- /dev/null +++ b/user_scripts/tools/c/lastnonempty2.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -v '^$' "$1" | tail -1 \ No newline at end of file diff --git a/user_scripts/tools/c/lastnonemptyline.sh b/user_scripts/tools/c/lastnonemptyline.sh new file mode 100755 index 00000000..b8348dea --- /dev/null +++ b/user_scripts/tools/c/lastnonemptyline.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '/./{line=FNR} END{print line}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/line5.sh b/user_scripts/tools/c/line5.sh new file mode 100755 index 00000000..387497fd --- /dev/null +++ b/user_scripts/tools/c/line5.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed -n '5p' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/linenumbers.sh b/user_scripts/tools/c/linenumbers.sh new file mode 100755 index 00000000..c554978e --- /dev/null +++ b/user_scripts/tools/c/linenumbers.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NR": "$0}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/lines.sh b/user_scripts/tools/c/lines.sh new file mode 100755 index 00000000..6f110544 --- /dev/null +++ b/user_scripts/tools/c/lines.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +wc -l "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/longestline.sh b/user_scripts/tools/c/longestline.sh new file mode 100755 index 00000000..9d511b7d --- /dev/null +++ b/user_scripts/tools/c/longestline.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print length, $0}' "$1" | sort -n | tail -1 | cut -d' ' -f2- \ No newline at end of file diff --git a/user_scripts/tools/c/longestlinebywords.sh b/user_scripts/tools/c/longestlinebywords.sh new file mode 100755 index 00000000..b2e60832 --- /dev/null +++ b/user_scripts/tools/c/longestlinebywords.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NF, $0}' "$1" | sort -n | tail -1 | cut -d' ' -f2- \ No newline at end of file diff --git a/user_scripts/tools/c/lowercase.sh b/user_scripts/tools/c/lowercase.sh new file mode 100755 index 00000000..aa47718b --- /dev/null +++ b/user_scripts/tools/c/lowercase.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +tr '[:upper:]' '[:lower:]' < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/ltrim.sh b/user_scripts/tools/c/ltrim.sh new file mode 100755 index 00000000..5867c2e9 --- /dev/null +++ b/user_scripts/tools/c/ltrim.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/^[[:space:]]*//' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/nocomments.sh b/user_scripts/tools/c/nocomments.sh new file mode 100755 index 00000000..ce4c2595 --- /dev/null +++ b/user_scripts/tools/c/nocomments.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -v '^#' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/nonempty.sh b/user_scripts/tools/c/nonempty.sh new file mode 100755 index 00000000..6f34649b --- /dev/null +++ b/user_scripts/tools/c/nonempty.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk 'NF!=0 && !seen[$0]++' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/nonempty_linescount.sh b/user_scripts/tools/c/nonempty_linescount.sh new file mode 100755 index 00000000..f77cc842 --- /dev/null +++ b/user_scripts/tools/c/nonempty_linescount.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk 'NF!=0' "$1" | wc -l \ No newline at end of file diff --git a/user_scripts/tools/c/nonemptycount.sh b/user_scripts/tools/c/nonemptycount.sh new file mode 100755 index 00000000..4c7bea44 --- /dev/null +++ b/user_scripts/tools/c/nonemptycount.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -c . "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/numberall.sh b/user_scripts/tools/c/numberall.sh new file mode 100755 index 00000000..97a40720 --- /dev/null +++ b/user_scripts/tools/c/numberall.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NR, $0}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/numprefix.sh b/user_scripts/tools/c/numprefix.sh new file mode 100755 index 00000000..a0d2577c --- /dev/null +++ b/user_scripts/tools/c/numprefix.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NR") "$0}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/randomstr.sh b/user_scripts/tools/c/randomstr.sh new file mode 100644 index 00000000..23a27792 --- /dev/null +++ b/user_scripts/tools/c/randomstr.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +python3 -c "import secrets; print(secrets.token_urlsafe(${1:-32}))" \ No newline at end of file diff --git a/user_scripts/tools/c/remblanklines.sh b/user_scripts/tools/c/remblanklines.sh new file mode 100755 index 00000000..f342c404 --- /dev/null +++ b/user_scripts/tools/c/remblanklines.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed '/^$/d' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/remempty.sh b/user_scripts/tools/c/remempty.sh new file mode 100755 index 00000000..711a4525 --- /dev/null +++ b/user_scripts/tools/c/remempty.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -v '^$' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/reversechars.sh b/user_scripts/tools/c/reversechars.sh new file mode 100755 index 00000000..e7686664 --- /dev/null +++ b/user_scripts/tools/c/reversechars.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{for(i=length($0);i>=1;i--)x=x substr($0,i,1);print x;x=""}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/reverselines.sh b/user_scripts/tools/c/reverselines.sh new file mode 100755 index 00000000..131fe27c --- /dev/null +++ b/user_scripts/tools/c/reverselines.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +rev "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/reversesort.sh b/user_scripts/tools/c/reversesort.sh new file mode 100755 index 00000000..e4e22fa6 --- /dev/null +++ b/user_scripts/tools/c/reversesort.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sort -r "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/rtrim.sh b/user_scripts/tools/c/rtrim.sh new file mode 100755 index 00000000..d1e86458 --- /dev/null +++ b/user_scripts/tools/c/rtrim.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/[[:space:]]*$//' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/shortestbywords.sh b/user_scripts/tools/c/shortestbywords.sh new file mode 100755 index 00000000..c9cafe62 --- /dev/null +++ b/user_scripts/tools/c/shortestbywords.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NF, $0}' "$1" | sort -n | head -1 | cut -d' ' -f2- \ No newline at end of file diff --git a/user_scripts/tools/c/shortestline.sh b/user_scripts/tools/c/shortestline.sh new file mode 100755 index 00000000..ee79bdf7 --- /dev/null +++ b/user_scripts/tools/c/shortestline.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NF, $0}' "$1" | sort -n | cut -d' ' -f2- \ No newline at end of file diff --git a/user_scripts/tools/c/showinvis.sh b/user_scripts/tools/c/showinvis.sh new file mode 100755 index 00000000..44ff3730 --- /dev/null +++ b/user_scripts/tools/c/showinvis.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +cat -A "$1" | grep -v '\^$' \ No newline at end of file diff --git a/user_scripts/tools/c/sort.sh b/user_scripts/tools/c/sort.sh new file mode 100755 index 00000000..ea7755e9 --- /dev/null +++ b/user_scripts/tools/c/sort.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sort "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/sortalen.sh b/user_scripts/tools/c/sortalen.sh new file mode 100755 index 00000000..9796c8d4 --- /dev/null +++ b/user_scripts/tools/c/sortalen.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print NR, length, $0}' "$1" | sort -k2 -n \ No newline at end of file diff --git a/user_scripts/tools/c/spaces2tabs.sh b/user_scripts/tools/c/spaces2tabs.sh new file mode 100755 index 00000000..ab6e29c7 --- /dev/null +++ b/user_scripts/tools/c/spaces2tabs.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/ /\t/g' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/sufixn.sh b/user_scripts/tools/c/sufixn.sh new file mode 100755 index 00000000..c3bc1fae --- /dev/null +++ b/user_scripts/tools/c/sufixn.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{print $0")"}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/tabstospaces.sh b/user_scripts/tools/c/tabstospaces.sh new file mode 100755 index 00000000..3665bf88 --- /dev/null +++ b/user_scripts/tools/c/tabstospaces.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/\t/ /g' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/totalchars.sh b/user_scripts/tools/c/totalchars.sh new file mode 100755 index 00000000..96d3e981 --- /dev/null +++ b/user_scripts/tools/c/totalchars.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{sum+=length} END{print sum}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/totalcount.sh b/user_scripts/tools/c/totalcount.sh new file mode 100755 index 00000000..03ece9aa --- /dev/null +++ b/user_scripts/tools/c/totalcount.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed -n '$=' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/totalwords.sh b/user_scripts/tools/c/totalwords.sh new file mode 100755 index 00000000..1b18d7db --- /dev/null +++ b/user_scripts/tools/c/totalwords.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +awk '{sum+=NF} END{print sum}' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/trim.sh b/user_scripts/tools/c/trim.sh new file mode 100755 index 00000000..1fd22537 --- /dev/null +++ b/user_scripts/tools/c/trim.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/^[[:space:]]*//;s/[[:space:]]*$//' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/tripple.sh b/user_scripts/tools/c/tripple.sh new file mode 100755 index 00000000..cd0cc7e3 --- /dev/null +++ b/user_scripts/tools/c/tripple.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sed 's/.*/& & &/' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/uniquelines.sh b/user_scripts/tools/c/uniquelines.sh new file mode 100755 index 00000000..2cc5bfb6 --- /dev/null +++ b/user_scripts/tools/c/uniquelines.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +sort -u "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/uppercase.sh b/user_scripts/tools/c/uppercase.sh new file mode 100755 index 00000000..93a5aa52 --- /dev/null +++ b/user_scripts/tools/c/uppercase.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +tr '[:lower:]' '[:upper:]' < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/urldecode.sh b/user_scripts/tools/c/urldecode.sh new file mode 100644 index 00000000..abdddd7a --- /dev/null +++ b/user_scripts/tools/c/urldecode.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -c "import urllib.parse,sys; print(urllib.parse.unquote(open('$1').read()))" < "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/urlencode.sh b/user_scripts/tools/c/urlencode.sh new file mode 100644 index 00000000..4deab84a --- /dev/null +++ b/user_scripts/tools/c/urlencode.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +python3 -c "import urllib.parse,sys; print(urllib.parse.quote(open('$1').read()))" \ No newline at end of file diff --git a/user_scripts/tools/c/uuid.sh b/user_scripts/tools/c/uuid.sh new file mode 100644 index 00000000..3e5a2f78 --- /dev/null +++ b/user_scripts/tools/c/uuid.sh @@ -0,0 +1,3 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 [-n ]"; exit 1; } +python3 -c "import uuid; print(uuid.uuid4())" \ No newline at end of file diff --git a/user_scripts/tools/c/wordcount.sh b/user_scripts/tools/c/wordcount.sh new file mode 100755 index 00000000..9c1a7aab --- /dev/null +++ b/user_scripts/tools/c/wordcount.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +grep -c '[^[:space:]]' "$1" \ No newline at end of file diff --git a/user_scripts/tools/c/words.sh b/user_scripts/tools/c/words.sh new file mode 100755 index 00000000..beab44c8 --- /dev/null +++ b/user_scripts/tools/c/words.sh @@ -0,0 +1,4 @@ +#!/bin/bash +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } +[[ ! -f "$1" ]] && { echo "Error: File '$1' not found."; exit 1; } +wc -w "$1" \ No newline at end of file diff --git a/user_scripts/tools/workspace/close-workspace.sh b/user_scripts/tools/workspace/close-workspace.sh index 284324e9..3f6625f6 100755 --- a/user_scripts/tools/workspace/close-workspace.sh +++ b/user_scripts/tools/workspace/close-workspace.sh @@ -28,7 +28,7 @@ close_workspace_windows() { local count=0 for address in $addresses; do - hyprctl dispatch closewindow "address:$address" 2>/dev/null + hyprctl dispatch "hl.dsp.window.close({ window = \"address:$address\" })" 2>/dev/null ((count++)) sleep 0.05 done diff --git a/user_scripts/tools/workspace/safety-close.sh b/user_scripts/tools/workspace/safety-close.sh index 1ea10dae..05f280fd 100755 --- a/user_scripts/tools/workspace/safety-close.sh +++ b/user_scripts/tools/workspace/safety-close.sh @@ -33,7 +33,7 @@ get_workspace_id() { close_address() { local address="$1" - hyprctl dispatch closewindow "address:$address" 2>/dev/null + hyprctl dispatch "hl.dsp.window.close({ window = \"address:$address\" })" 2>/dev/null } close_workspace_windows() { @@ -50,7 +50,7 @@ close_workspace_windows() { local count=0 for address in $addresses; do - hyprctl dispatch closewindow "address:$address" 2>/dev/null + hyprctl dispatch "hl.dsp.window.close({ window = \"address:$address\" })" 2>/dev/null ((count++)) sleep 0.05 done From 2c2985404bbf0b6fd099e4290eba63e91968f999 Mon Sep 17 00:00:00 2001 From: Astraxical Date: Mon, 18 May 2026 21:00:28 +0900 Subject: [PATCH 4/4] Recorrect File Location cour 2 --- user_scripts/tools/{c => .unsorted}/base64dec.sh | 0 user_scripts/tools/{c => .unsorted}/base64enc.sh | 0 user_scripts/tools/{c => .unsorted}/charlen.sh | 0 user_scripts/tools/{c => .unsorted}/chars.sh | 0 user_scripts/tools/{c => .unsorted}/collapse_spaces.sh | 0 user_scripts/tools/{c => .unsorted}/comments.sh | 0 user_scripts/tools/{c => .unsorted}/countdups.sh | 0 user_scripts/tools/{c => .unsorted}/csv2json.sh | 0 user_scripts/tools/{c => .unsorted}/dupn.sh | 0 user_scripts/tools/{c => .unsorted}/first10.sh | 0 user_scripts/tools/{c => .unsorted}/firstline.sh | 0 user_scripts/tools/{c => .unsorted}/firstnonempty.sh | 0 user_scripts/tools/{c => .unsorted}/hashfile.sh | 0 user_scripts/tools/{c => .unsorted}/hexdump.sh | 0 user_scripts/tools/{c => .unsorted}/htmldecode.sh | 0 user_scripts/tools/{c => .unsorted}/htmlencode.sh | 0 user_scripts/tools/{c => .unsorted}/jsonfmt.sh | 0 user_scripts/tools/{c => .unsorted}/jsonmin.sh | 0 user_scripts/tools/{c => .unsorted}/last10.sh | 0 user_scripts/tools/{c => .unsorted}/lastline.sh | 0 user_scripts/tools/{c => .unsorted}/lastnonempty.sh | 0 user_scripts/tools/{c => .unsorted}/lastnonempty2.sh | 0 user_scripts/tools/{c => .unsorted}/lastnonemptyline.sh | 0 user_scripts/tools/{c => .unsorted}/line5.sh | 0 user_scripts/tools/{c => .unsorted}/linenumbers.sh | 0 user_scripts/tools/{c => .unsorted}/lines.sh | 0 user_scripts/tools/{c => .unsorted}/longestline.sh | 0 user_scripts/tools/{c => .unsorted}/longestlinebywords.sh | 0 user_scripts/tools/{c => .unsorted}/lowercase.sh | 0 user_scripts/tools/{c => .unsorted}/ltrim.sh | 0 user_scripts/tools/{c => .unsorted}/nocomments.sh | 0 user_scripts/tools/{c => .unsorted}/nonempty.sh | 0 user_scripts/tools/{c => .unsorted}/nonempty_linescount.sh | 0 user_scripts/tools/{c => .unsorted}/nonemptycount.sh | 0 user_scripts/tools/{c => .unsorted}/numberall.sh | 0 user_scripts/tools/{c => .unsorted}/numprefix.sh | 0 user_scripts/tools/{c => .unsorted}/randomstr.sh | 0 user_scripts/tools/{c => .unsorted}/remblanklines.sh | 0 user_scripts/tools/{c => .unsorted}/remempty.sh | 0 user_scripts/tools/{c => .unsorted}/reversechars.sh | 0 user_scripts/tools/{c => .unsorted}/reverselines.sh | 0 user_scripts/tools/{c => .unsorted}/reversesort.sh | 0 user_scripts/tools/{c => .unsorted}/rtrim.sh | 0 user_scripts/tools/{c => .unsorted}/shortestbywords.sh | 0 user_scripts/tools/{c => .unsorted}/shortestline.sh | 0 user_scripts/tools/{c => .unsorted}/showinvis.sh | 0 user_scripts/tools/{c => .unsorted}/sort.sh | 0 user_scripts/tools/{c => .unsorted}/sortalen.sh | 0 user_scripts/tools/{c => .unsorted}/spaces2tabs.sh | 0 user_scripts/tools/{c => .unsorted}/sufixn.sh | 0 user_scripts/tools/{c => .unsorted}/tabstospaces.sh | 0 user_scripts/tools/{c => .unsorted}/totalchars.sh | 0 user_scripts/tools/{c => .unsorted}/totalcount.sh | 0 user_scripts/tools/{c => .unsorted}/totalwords.sh | 0 user_scripts/tools/{c => .unsorted}/trim.sh | 0 user_scripts/tools/{c => .unsorted}/tripple.sh | 0 user_scripts/tools/{c => .unsorted}/uniquelines.sh | 0 user_scripts/tools/{c => .unsorted}/uppercase.sh | 0 user_scripts/tools/{c => .unsorted}/urldecode.sh | 0 user_scripts/tools/{c => .unsorted}/urlencode.sh | 0 user_scripts/tools/{c => .unsorted}/uuid.sh | 0 user_scripts/tools/{c => .unsorted}/wordcount.sh | 0 user_scripts/tools/{c => .unsorted}/words.sh | 0 63 files changed, 0 insertions(+), 0 deletions(-) rename user_scripts/tools/{c => .unsorted}/base64dec.sh (100%) rename user_scripts/tools/{c => .unsorted}/base64enc.sh (100%) rename user_scripts/tools/{c => .unsorted}/charlen.sh (100%) rename user_scripts/tools/{c => .unsorted}/chars.sh (100%) rename user_scripts/tools/{c => .unsorted}/collapse_spaces.sh (100%) rename user_scripts/tools/{c => .unsorted}/comments.sh (100%) rename user_scripts/tools/{c => .unsorted}/countdups.sh (100%) rename user_scripts/tools/{c => .unsorted}/csv2json.sh (100%) rename user_scripts/tools/{c => .unsorted}/dupn.sh (100%) rename user_scripts/tools/{c => .unsorted}/first10.sh (100%) rename user_scripts/tools/{c => .unsorted}/firstline.sh (100%) rename user_scripts/tools/{c => .unsorted}/firstnonempty.sh (100%) rename user_scripts/tools/{c => .unsorted}/hashfile.sh (100%) rename user_scripts/tools/{c => .unsorted}/hexdump.sh (100%) rename user_scripts/tools/{c => .unsorted}/htmldecode.sh (100%) rename user_scripts/tools/{c => .unsorted}/htmlencode.sh (100%) rename user_scripts/tools/{c => .unsorted}/jsonfmt.sh (100%) rename user_scripts/tools/{c => .unsorted}/jsonmin.sh (100%) rename user_scripts/tools/{c => .unsorted}/last10.sh (100%) rename user_scripts/tools/{c => .unsorted}/lastline.sh (100%) rename user_scripts/tools/{c => .unsorted}/lastnonempty.sh (100%) rename user_scripts/tools/{c => .unsorted}/lastnonempty2.sh (100%) rename user_scripts/tools/{c => .unsorted}/lastnonemptyline.sh (100%) rename user_scripts/tools/{c => .unsorted}/line5.sh (100%) rename user_scripts/tools/{c => .unsorted}/linenumbers.sh (100%) rename user_scripts/tools/{c => .unsorted}/lines.sh (100%) rename user_scripts/tools/{c => .unsorted}/longestline.sh (100%) rename user_scripts/tools/{c => .unsorted}/longestlinebywords.sh (100%) rename user_scripts/tools/{c => .unsorted}/lowercase.sh (100%) rename user_scripts/tools/{c => .unsorted}/ltrim.sh (100%) rename user_scripts/tools/{c => .unsorted}/nocomments.sh (100%) rename user_scripts/tools/{c => .unsorted}/nonempty.sh (100%) rename user_scripts/tools/{c => .unsorted}/nonempty_linescount.sh (100%) rename user_scripts/tools/{c => .unsorted}/nonemptycount.sh (100%) rename user_scripts/tools/{c => .unsorted}/numberall.sh (100%) rename user_scripts/tools/{c => .unsorted}/numprefix.sh (100%) rename user_scripts/tools/{c => .unsorted}/randomstr.sh (100%) rename user_scripts/tools/{c => .unsorted}/remblanklines.sh (100%) rename user_scripts/tools/{c => .unsorted}/remempty.sh (100%) rename user_scripts/tools/{c => .unsorted}/reversechars.sh (100%) rename user_scripts/tools/{c => .unsorted}/reverselines.sh (100%) rename user_scripts/tools/{c => .unsorted}/reversesort.sh (100%) rename user_scripts/tools/{c => .unsorted}/rtrim.sh (100%) rename user_scripts/tools/{c => .unsorted}/shortestbywords.sh (100%) rename user_scripts/tools/{c => .unsorted}/shortestline.sh (100%) rename user_scripts/tools/{c => .unsorted}/showinvis.sh (100%) rename user_scripts/tools/{c => .unsorted}/sort.sh (100%) rename user_scripts/tools/{c => .unsorted}/sortalen.sh (100%) rename user_scripts/tools/{c => .unsorted}/spaces2tabs.sh (100%) rename user_scripts/tools/{c => .unsorted}/sufixn.sh (100%) rename user_scripts/tools/{c => .unsorted}/tabstospaces.sh (100%) rename user_scripts/tools/{c => .unsorted}/totalchars.sh (100%) rename user_scripts/tools/{c => .unsorted}/totalcount.sh (100%) rename user_scripts/tools/{c => .unsorted}/totalwords.sh (100%) rename user_scripts/tools/{c => .unsorted}/trim.sh (100%) rename user_scripts/tools/{c => .unsorted}/tripple.sh (100%) rename user_scripts/tools/{c => .unsorted}/uniquelines.sh (100%) rename user_scripts/tools/{c => .unsorted}/uppercase.sh (100%) rename user_scripts/tools/{c => .unsorted}/urldecode.sh (100%) rename user_scripts/tools/{c => .unsorted}/urlencode.sh (100%) rename user_scripts/tools/{c => .unsorted}/uuid.sh (100%) rename user_scripts/tools/{c => .unsorted}/wordcount.sh (100%) rename user_scripts/tools/{c => .unsorted}/words.sh (100%) diff --git a/user_scripts/tools/c/base64dec.sh b/user_scripts/tools/.unsorted/base64dec.sh similarity index 100% rename from user_scripts/tools/c/base64dec.sh rename to user_scripts/tools/.unsorted/base64dec.sh diff --git a/user_scripts/tools/c/base64enc.sh b/user_scripts/tools/.unsorted/base64enc.sh similarity index 100% rename from user_scripts/tools/c/base64enc.sh rename to user_scripts/tools/.unsorted/base64enc.sh diff --git a/user_scripts/tools/c/charlen.sh b/user_scripts/tools/.unsorted/charlen.sh similarity index 100% rename from user_scripts/tools/c/charlen.sh rename to user_scripts/tools/.unsorted/charlen.sh diff --git a/user_scripts/tools/c/chars.sh b/user_scripts/tools/.unsorted/chars.sh similarity index 100% rename from user_scripts/tools/c/chars.sh rename to user_scripts/tools/.unsorted/chars.sh diff --git a/user_scripts/tools/c/collapse_spaces.sh b/user_scripts/tools/.unsorted/collapse_spaces.sh similarity index 100% rename from user_scripts/tools/c/collapse_spaces.sh rename to user_scripts/tools/.unsorted/collapse_spaces.sh diff --git a/user_scripts/tools/c/comments.sh b/user_scripts/tools/.unsorted/comments.sh similarity index 100% rename from user_scripts/tools/c/comments.sh rename to user_scripts/tools/.unsorted/comments.sh diff --git a/user_scripts/tools/c/countdups.sh b/user_scripts/tools/.unsorted/countdups.sh similarity index 100% rename from user_scripts/tools/c/countdups.sh rename to user_scripts/tools/.unsorted/countdups.sh diff --git a/user_scripts/tools/c/csv2json.sh b/user_scripts/tools/.unsorted/csv2json.sh similarity index 100% rename from user_scripts/tools/c/csv2json.sh rename to user_scripts/tools/.unsorted/csv2json.sh diff --git a/user_scripts/tools/c/dupn.sh b/user_scripts/tools/.unsorted/dupn.sh similarity index 100% rename from user_scripts/tools/c/dupn.sh rename to user_scripts/tools/.unsorted/dupn.sh diff --git a/user_scripts/tools/c/first10.sh b/user_scripts/tools/.unsorted/first10.sh similarity index 100% rename from user_scripts/tools/c/first10.sh rename to user_scripts/tools/.unsorted/first10.sh diff --git a/user_scripts/tools/c/firstline.sh b/user_scripts/tools/.unsorted/firstline.sh similarity index 100% rename from user_scripts/tools/c/firstline.sh rename to user_scripts/tools/.unsorted/firstline.sh diff --git a/user_scripts/tools/c/firstnonempty.sh b/user_scripts/tools/.unsorted/firstnonempty.sh similarity index 100% rename from user_scripts/tools/c/firstnonempty.sh rename to user_scripts/tools/.unsorted/firstnonempty.sh diff --git a/user_scripts/tools/c/hashfile.sh b/user_scripts/tools/.unsorted/hashfile.sh similarity index 100% rename from user_scripts/tools/c/hashfile.sh rename to user_scripts/tools/.unsorted/hashfile.sh diff --git a/user_scripts/tools/c/hexdump.sh b/user_scripts/tools/.unsorted/hexdump.sh similarity index 100% rename from user_scripts/tools/c/hexdump.sh rename to user_scripts/tools/.unsorted/hexdump.sh diff --git a/user_scripts/tools/c/htmldecode.sh b/user_scripts/tools/.unsorted/htmldecode.sh similarity index 100% rename from user_scripts/tools/c/htmldecode.sh rename to user_scripts/tools/.unsorted/htmldecode.sh diff --git a/user_scripts/tools/c/htmlencode.sh b/user_scripts/tools/.unsorted/htmlencode.sh similarity index 100% rename from user_scripts/tools/c/htmlencode.sh rename to user_scripts/tools/.unsorted/htmlencode.sh diff --git a/user_scripts/tools/c/jsonfmt.sh b/user_scripts/tools/.unsorted/jsonfmt.sh similarity index 100% rename from user_scripts/tools/c/jsonfmt.sh rename to user_scripts/tools/.unsorted/jsonfmt.sh diff --git a/user_scripts/tools/c/jsonmin.sh b/user_scripts/tools/.unsorted/jsonmin.sh similarity index 100% rename from user_scripts/tools/c/jsonmin.sh rename to user_scripts/tools/.unsorted/jsonmin.sh diff --git a/user_scripts/tools/c/last10.sh b/user_scripts/tools/.unsorted/last10.sh similarity index 100% rename from user_scripts/tools/c/last10.sh rename to user_scripts/tools/.unsorted/last10.sh diff --git a/user_scripts/tools/c/lastline.sh b/user_scripts/tools/.unsorted/lastline.sh similarity index 100% rename from user_scripts/tools/c/lastline.sh rename to user_scripts/tools/.unsorted/lastline.sh diff --git a/user_scripts/tools/c/lastnonempty.sh b/user_scripts/tools/.unsorted/lastnonempty.sh similarity index 100% rename from user_scripts/tools/c/lastnonempty.sh rename to user_scripts/tools/.unsorted/lastnonempty.sh diff --git a/user_scripts/tools/c/lastnonempty2.sh b/user_scripts/tools/.unsorted/lastnonempty2.sh similarity index 100% rename from user_scripts/tools/c/lastnonempty2.sh rename to user_scripts/tools/.unsorted/lastnonempty2.sh diff --git a/user_scripts/tools/c/lastnonemptyline.sh b/user_scripts/tools/.unsorted/lastnonemptyline.sh similarity index 100% rename from user_scripts/tools/c/lastnonemptyline.sh rename to user_scripts/tools/.unsorted/lastnonemptyline.sh diff --git a/user_scripts/tools/c/line5.sh b/user_scripts/tools/.unsorted/line5.sh similarity index 100% rename from user_scripts/tools/c/line5.sh rename to user_scripts/tools/.unsorted/line5.sh diff --git a/user_scripts/tools/c/linenumbers.sh b/user_scripts/tools/.unsorted/linenumbers.sh similarity index 100% rename from user_scripts/tools/c/linenumbers.sh rename to user_scripts/tools/.unsorted/linenumbers.sh diff --git a/user_scripts/tools/c/lines.sh b/user_scripts/tools/.unsorted/lines.sh similarity index 100% rename from user_scripts/tools/c/lines.sh rename to user_scripts/tools/.unsorted/lines.sh diff --git a/user_scripts/tools/c/longestline.sh b/user_scripts/tools/.unsorted/longestline.sh similarity index 100% rename from user_scripts/tools/c/longestline.sh rename to user_scripts/tools/.unsorted/longestline.sh diff --git a/user_scripts/tools/c/longestlinebywords.sh b/user_scripts/tools/.unsorted/longestlinebywords.sh similarity index 100% rename from user_scripts/tools/c/longestlinebywords.sh rename to user_scripts/tools/.unsorted/longestlinebywords.sh diff --git a/user_scripts/tools/c/lowercase.sh b/user_scripts/tools/.unsorted/lowercase.sh similarity index 100% rename from user_scripts/tools/c/lowercase.sh rename to user_scripts/tools/.unsorted/lowercase.sh diff --git a/user_scripts/tools/c/ltrim.sh b/user_scripts/tools/.unsorted/ltrim.sh similarity index 100% rename from user_scripts/tools/c/ltrim.sh rename to user_scripts/tools/.unsorted/ltrim.sh diff --git a/user_scripts/tools/c/nocomments.sh b/user_scripts/tools/.unsorted/nocomments.sh similarity index 100% rename from user_scripts/tools/c/nocomments.sh rename to user_scripts/tools/.unsorted/nocomments.sh diff --git a/user_scripts/tools/c/nonempty.sh b/user_scripts/tools/.unsorted/nonempty.sh similarity index 100% rename from user_scripts/tools/c/nonempty.sh rename to user_scripts/tools/.unsorted/nonempty.sh diff --git a/user_scripts/tools/c/nonempty_linescount.sh b/user_scripts/tools/.unsorted/nonempty_linescount.sh similarity index 100% rename from user_scripts/tools/c/nonempty_linescount.sh rename to user_scripts/tools/.unsorted/nonempty_linescount.sh diff --git a/user_scripts/tools/c/nonemptycount.sh b/user_scripts/tools/.unsorted/nonemptycount.sh similarity index 100% rename from user_scripts/tools/c/nonemptycount.sh rename to user_scripts/tools/.unsorted/nonemptycount.sh diff --git a/user_scripts/tools/c/numberall.sh b/user_scripts/tools/.unsorted/numberall.sh similarity index 100% rename from user_scripts/tools/c/numberall.sh rename to user_scripts/tools/.unsorted/numberall.sh diff --git a/user_scripts/tools/c/numprefix.sh b/user_scripts/tools/.unsorted/numprefix.sh similarity index 100% rename from user_scripts/tools/c/numprefix.sh rename to user_scripts/tools/.unsorted/numprefix.sh diff --git a/user_scripts/tools/c/randomstr.sh b/user_scripts/tools/.unsorted/randomstr.sh similarity index 100% rename from user_scripts/tools/c/randomstr.sh rename to user_scripts/tools/.unsorted/randomstr.sh diff --git a/user_scripts/tools/c/remblanklines.sh b/user_scripts/tools/.unsorted/remblanklines.sh similarity index 100% rename from user_scripts/tools/c/remblanklines.sh rename to user_scripts/tools/.unsorted/remblanklines.sh diff --git a/user_scripts/tools/c/remempty.sh b/user_scripts/tools/.unsorted/remempty.sh similarity index 100% rename from user_scripts/tools/c/remempty.sh rename to user_scripts/tools/.unsorted/remempty.sh diff --git a/user_scripts/tools/c/reversechars.sh b/user_scripts/tools/.unsorted/reversechars.sh similarity index 100% rename from user_scripts/tools/c/reversechars.sh rename to user_scripts/tools/.unsorted/reversechars.sh diff --git a/user_scripts/tools/c/reverselines.sh b/user_scripts/tools/.unsorted/reverselines.sh similarity index 100% rename from user_scripts/tools/c/reverselines.sh rename to user_scripts/tools/.unsorted/reverselines.sh diff --git a/user_scripts/tools/c/reversesort.sh b/user_scripts/tools/.unsorted/reversesort.sh similarity index 100% rename from user_scripts/tools/c/reversesort.sh rename to user_scripts/tools/.unsorted/reversesort.sh diff --git a/user_scripts/tools/c/rtrim.sh b/user_scripts/tools/.unsorted/rtrim.sh similarity index 100% rename from user_scripts/tools/c/rtrim.sh rename to user_scripts/tools/.unsorted/rtrim.sh diff --git a/user_scripts/tools/c/shortestbywords.sh b/user_scripts/tools/.unsorted/shortestbywords.sh similarity index 100% rename from user_scripts/tools/c/shortestbywords.sh rename to user_scripts/tools/.unsorted/shortestbywords.sh diff --git a/user_scripts/tools/c/shortestline.sh b/user_scripts/tools/.unsorted/shortestline.sh similarity index 100% rename from user_scripts/tools/c/shortestline.sh rename to user_scripts/tools/.unsorted/shortestline.sh diff --git a/user_scripts/tools/c/showinvis.sh b/user_scripts/tools/.unsorted/showinvis.sh similarity index 100% rename from user_scripts/tools/c/showinvis.sh rename to user_scripts/tools/.unsorted/showinvis.sh diff --git a/user_scripts/tools/c/sort.sh b/user_scripts/tools/.unsorted/sort.sh similarity index 100% rename from user_scripts/tools/c/sort.sh rename to user_scripts/tools/.unsorted/sort.sh diff --git a/user_scripts/tools/c/sortalen.sh b/user_scripts/tools/.unsorted/sortalen.sh similarity index 100% rename from user_scripts/tools/c/sortalen.sh rename to user_scripts/tools/.unsorted/sortalen.sh diff --git a/user_scripts/tools/c/spaces2tabs.sh b/user_scripts/tools/.unsorted/spaces2tabs.sh similarity index 100% rename from user_scripts/tools/c/spaces2tabs.sh rename to user_scripts/tools/.unsorted/spaces2tabs.sh diff --git a/user_scripts/tools/c/sufixn.sh b/user_scripts/tools/.unsorted/sufixn.sh similarity index 100% rename from user_scripts/tools/c/sufixn.sh rename to user_scripts/tools/.unsorted/sufixn.sh diff --git a/user_scripts/tools/c/tabstospaces.sh b/user_scripts/tools/.unsorted/tabstospaces.sh similarity index 100% rename from user_scripts/tools/c/tabstospaces.sh rename to user_scripts/tools/.unsorted/tabstospaces.sh diff --git a/user_scripts/tools/c/totalchars.sh b/user_scripts/tools/.unsorted/totalchars.sh similarity index 100% rename from user_scripts/tools/c/totalchars.sh rename to user_scripts/tools/.unsorted/totalchars.sh diff --git a/user_scripts/tools/c/totalcount.sh b/user_scripts/tools/.unsorted/totalcount.sh similarity index 100% rename from user_scripts/tools/c/totalcount.sh rename to user_scripts/tools/.unsorted/totalcount.sh diff --git a/user_scripts/tools/c/totalwords.sh b/user_scripts/tools/.unsorted/totalwords.sh similarity index 100% rename from user_scripts/tools/c/totalwords.sh rename to user_scripts/tools/.unsorted/totalwords.sh diff --git a/user_scripts/tools/c/trim.sh b/user_scripts/tools/.unsorted/trim.sh similarity index 100% rename from user_scripts/tools/c/trim.sh rename to user_scripts/tools/.unsorted/trim.sh diff --git a/user_scripts/tools/c/tripple.sh b/user_scripts/tools/.unsorted/tripple.sh similarity index 100% rename from user_scripts/tools/c/tripple.sh rename to user_scripts/tools/.unsorted/tripple.sh diff --git a/user_scripts/tools/c/uniquelines.sh b/user_scripts/tools/.unsorted/uniquelines.sh similarity index 100% rename from user_scripts/tools/c/uniquelines.sh rename to user_scripts/tools/.unsorted/uniquelines.sh diff --git a/user_scripts/tools/c/uppercase.sh b/user_scripts/tools/.unsorted/uppercase.sh similarity index 100% rename from user_scripts/tools/c/uppercase.sh rename to user_scripts/tools/.unsorted/uppercase.sh diff --git a/user_scripts/tools/c/urldecode.sh b/user_scripts/tools/.unsorted/urldecode.sh similarity index 100% rename from user_scripts/tools/c/urldecode.sh rename to user_scripts/tools/.unsorted/urldecode.sh diff --git a/user_scripts/tools/c/urlencode.sh b/user_scripts/tools/.unsorted/urlencode.sh similarity index 100% rename from user_scripts/tools/c/urlencode.sh rename to user_scripts/tools/.unsorted/urlencode.sh diff --git a/user_scripts/tools/c/uuid.sh b/user_scripts/tools/.unsorted/uuid.sh similarity index 100% rename from user_scripts/tools/c/uuid.sh rename to user_scripts/tools/.unsorted/uuid.sh diff --git a/user_scripts/tools/c/wordcount.sh b/user_scripts/tools/.unsorted/wordcount.sh similarity index 100% rename from user_scripts/tools/c/wordcount.sh rename to user_scripts/tools/.unsorted/wordcount.sh diff --git a/user_scripts/tools/c/words.sh b/user_scripts/tools/.unsorted/words.sh similarity index 100% rename from user_scripts/tools/c/words.sh rename to user_scripts/tools/.unsorted/words.sh