Commit 1ddbf7b
xxwhirlpool
·
2026-03-21 10:32:25 -0400 EDT
parent a1d4f0a
minor fixes. also i made a calculator cuz i was bored
3 files changed,
+32,
-2
+27,
-0
| ... | ... | @@ -0,0 +1,27 @@ | |
| 1 | + | #!/usr/bin/env bash | |
| 2 | + | ||
| 3 | + | if [[ $# -eq 0 ]]; then | |
| 4 | + | echo "Usage: pcalc [PROBLEM]" | |
| 5 | + | exit 1 | |
| 6 | + | fi | |
| 7 | + | ||
| 8 | + | # printf cmd will escape spaces & add quotes | |
| 9 | + | # so 1+2 and 1 + 2 will have the same result | |
| 10 | + | # (i think) | |
| 11 | + | problem=$(printf "%q" "$@") | |
| 12 | + | ||
| 13 | + | # if $problem contains spaces, trim it down | |
| 14 | + | [[ "$problem" =~ [[:space:]] ]]; problem2="${problem//[[:space:]]/}" | |
| 15 | + | ||
| 16 | + | # if $problem contains an "x", change to "*" | |
| 17 | + | # sometimes i type "x" for multiplication | |
| 18 | + | # perl by default does something else with "x" | |
| 19 | + | [[ "$problem" =~ x ]]; problem2="${problem2//x/*}" | |
| 20 | + | ||
| 21 | + | # fixes some weird thing where a backslash | |
| 22 | + | # would fuck with the math | |
| 23 | + | [[ "$problem" =~ \/ ]]; problem2="${problem2//\\}" | |
| 24 | + | ||
| 25 | + | # -l adds a newline | |
| 26 | + | # -e executes $problem | |
| 27 | + | perl -le "print $problem2" |
+3,
-1
| ... | ... | @@ -5,4 +5,6 @@ if [[ $# -eq 0 ]]; then | |
| 5 | 5 | exit 1 | |
| 6 | 6 | fi | |
| 7 | 7 | ||
| 8 | - | stat -c "%a - %n" "$1" | |
| 8 | + | permfile="$1" | |
| 9 | + | ||
| 10 | + | stat -c "%a - %n" "$permfile" |
+2,
-1
| ... | ... | @@ -5,7 +5,8 @@ avi2mkv() { | |
| 5 | 5 | } | |
| 6 | 6 | ||
| 7 | 7 | any2hevc() { | |
| 8 | - | for f in *.mkv; do ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "$f" -c:v hevc_nvenc -qmin 24 -qmax 24 -vtag hvc1 -profile main -preset slow -rc vbr_hq -c:a copy -c:s copy -map 0 "${f%.*} HEVC.mkv" || break; done | |
| 8 | + | shopt -s nullglob | |
| 9 | + | for f in *.{mkv,mp4}; do ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "$f" -c:v hevc_nvenc -qmin 24 -qmax 24 -vtag hvc1 -profile main -preset slow -rc vbr_hq -c:a copy -c:s copy -map 0 "${f%.*} HEVC.mkv" || break; done | |
| 9 | 10 | } | |
| 10 | 11 | ||
| 11 | 12 | vid2frames() { |