-r Randomize.
-s Do not randomize.
-x Randomize & do not reuse previous seed.
+-v Verbose
-h|--help Print help and exit.
It lists/plays the query, reads an input char for tagging one by one.
##### begin command line parsing ########
+ verbose=false
random=false
new_random=false
- if ! temp=$(getopt -l help hrsx "$@"); then
+ if ! temp=$(getopt -l help hrsxv "$@"); then
e "BAD OPTION! expected is: getopt -l help hrsx"
return 1
fi
random=true
new_random=true
;;
+ -v)
+ verbose=true
+ ;;
-h|--help) beetag-usage; return 0 ;;
--) shift; break ;;
*) echo "$0: Internal error! unexpected args: $*" ; return 1 ;;
return 1
fi
beet_query=("$@")
+ if $verbose; then e "beet_query: ${beet_query[*]}"; fi
##### end command line parsing ########
escape_char=$(printf "\u1b")
rootsshsync
}
-# copy path into clipboard
+# usage: $0 PATH
+# Puts absolute path into clipboard
a() {
local x
x=$(readlink -nf "${1:-$PWD}")
cbs "$x"
}
-# clipboard a string (into selection & clipboard buffer)
+# usage: $0 STRING...
+# Puts STRING... into clipboard (both kinds)
cbs() {
# yes, its kinda dumb that xclip/xsel cant do this in one invocation.
# And, summarizing this:
}
# count files recursively
fndwc() {
- find "$@" -type f -printf a | wc -c
+ find -L "$@" -type f -printf a | wc -c
}
# run then notify. close notification after the next prompt.
"${cmd[@]}" "$@"
}
+# I have the perl best practices book at: /a/pbp.pdf
+j() {
+ local ret=0 f="$1"
+ perl -c "$f" || ret=$?
+ perlcritic "$f" || ret=$?
+ return $ret
+}
+
# * stuff that makes sense to be at the end
# note, if we unset IFS, that will mess up completion scripts which
return 1
fi
# all but last arg as options
- e eval beetag -r "${*:1:$# - 1}" "${bpla[$playlist]}"
+ e beetag -r "${*:1:$# - 1}" "${bpla[$playlist]}"
}
complete -W "${!bpla[*]}" bpl
oathtool --totp -b "$*" | xclip -selection clipboard
}
# run cmd and copy output
-j() {
+jc() {
"$@" |& pee "xclip -r -selection clipboard" cat
}
}
+mdread() {
+ local tmpf
+ pandoc "$@" -f markdown -t html -s -o $tmpf
+ o $tmpf
+}
+
export BASEFILE_DIR=/a/bin/fai-basefiles
#export ANDROID_HOME=/a/opt/android-home
### end gh ####
+##### postgres #####
+
+case $HOSTNAME in
+ frodo)
+ # based on https://www.postgresql.org/download/linux/ubuntu/
+ if [[ ! -e /etc/apt/sources.list.d/pgdg.sources ]]; then
+ pi postgresql-common
+ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y noble
+ pi postgresql-17
+ sudo -u postgres createuser -d iank
+ fi
+ ;;
+esac
+
+#####
+
+
##### begin docker install
if ! pcheck "$@"; then
# https://docs.docker.com/engine/install/ubuntu/
EOF
- # ian: save a copy of sent mail. i thought of other ways to do this,
- # for example, to only save sent mail that is not sent from my mail
- # client which saves a copy by default, but in the end, it seems
- # simplest to turn that off. We want to save external mail sent by
- # smarthosts. However, there is one complication: encrypted
+ # ian: save a copy of sent mail. My main mail client, emacs is configured to save a copy. This is for external mail sent by
+ # smarthosts. There is one complication: encrypted
# mail. Saving it here just gets us an encrypted copy that we can't
# read. Soo, we could bcc ourselves: then we still have the
# annoyance that it is encrypted so we can't grep it. Or, we could
# hack emacs so that it sends us an unencrypted copy. Turns out that
- # the emacs function which saves sent email can also send us a
- # copy. But, then we have 3 copies: the encrypted copy exim saves,
- # the unencrypted copy exim saves, and the copy emacs saves. Soo,
- # we can emacs send a copy directly to the sent alias but only when
+ # the emacs function which saves sent email can also send us an
+ # unencrypted copy. Soo,
+ # we can tell emacs to send a copy directly to the sent alias but only when
# it is not mail_host, and have the exim condition for redirecting a
# copy to the sent alias avoid doing it if it has an emacs user
# agent header.
#
# for non-interactive, dont print unless something went
# wrong
+#
+# To rerun a spammassassin test in a terminal, do
+# spamnn -t --cf='score PYZOR_CHECK 0' <MAIL_FILE
#set -x