else
# bleh shellcheck can't handle disabling in an elif, so nesting this if.
# shellcheck disable=SC2154 # set in .bashrc
- if [[ -s $bashrc_dir/err ]]; then
+ if [[ -s $bashrc_dir/bash-bear ]]; then
# shellcheck source=/a/bin/bash-bear-trap/bash-bear
- source $bashrc_dir/err
+ source $bashrc_dir/bash-bear
fi
fi
ssh-copy-id $1
}
+# copy path into clipboard
a() {
local x
x=$(readlink -nf "${1:-$PWD}")
gp() {
cat &>/a/tmp/gtmp
g "$@" /a/tmp/gtmp
- }
-
-# like cmd &> tempfile; emacs tempfile
-gc() {
+}
+# g log
+#like cmd &> tempfile; emacs tempfile
+#
+# note: a useful workflow for doing mass replace on my files:
+# gc rem REGEX
+## remove any false positives, or manually edit them. rename files if needed.
+# sedi 's/REGEX/REPLACEMENT/' $(gr '^/' /a/tmp/gtmp)
+gl() {
"$@" &> /a/tmp/gtmp
g /a/tmp/gtmp
- }
+}
+# g command substitution
+gc() {
+ g $("$@")
+}
# force terminal version
gn() {
# on-battery
on-bat() {
if [[ -e /sys/class/power_supply/AC/online && $(</sys/class/power_supply/AC/online) == 0 ]]; then
+ return 0
+ else
return 1
fi
}
}
+disk-info() {
+ local cmds cmd
+ mapfile -t cmds <<'EOF'
+tail -n +1 /proc/mdstat /etc/mdadm/mdadm.conf /etc/fstab /etc/crypttab
+lsblk
+blkid
+ls -la /dev/disk/by-id
+EOF
+
+ for cmd in "${cmds[@]}"; do
+ cat <<EOF
+### $cmd
+
+\`\`\`
+EOF
+ $cmd
+ cat <<'EOF'
+
+```
+
+EOF
+ done
+}
+
# * misc stuff