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