various improvements
authorIan Kelling <ian@iankelling.org>
Thu, 29 May 2025 23:08:32 +0000 (19:08 -0400)
committerIan Kelling <ian@iankelling.org>
Thu, 29 May 2025 23:08:32 +0000 (19:08 -0400)
beetag
brc
brc2
distro-end
mail-setup
mailtest-check

diff --git a/beetag b/beetag
index 0f58ded45c63e5e1a7aee71ffe4d9d40bc885d67..f06d9e62d2b93d80dca7e1ae25a5ba3b1fca98ce 100755 (executable)
--- a/beetag
+++ b/beetag
@@ -355,6 +355,7 @@ usage: beetag [OPTIONS] QUERY
 -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.
@@ -421,9 +422,10 @@ beetag()  {
 
   ##### 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
@@ -440,6 +442,9 @@ beetag()  {
         random=true
         new_random=true
         ;;
+      -v)
+        verbose=true
+        ;;
       -h|--help) beetag-usage; return 0 ;;
       --) shift; break ;;
       *) echo "$0: Internal error! unexpected args: $*" ; return 1 ;;
@@ -452,6 +457,7 @@ beetag()  {
     return 1
   fi
   beet_query=("$@")
+  if $verbose; then e "beet_query: ${beet_query[*]}"; fi
   ##### end command line parsing ########
 
   escape_char=$(printf "\u1b")
diff --git a/brc b/brc
index 5d7ec44de1ea15fccdd9622ebb68712f6fc60799..c6016e310bad60a3c8ff02d83010566e1e220198 100644 (file)
--- a/brc
+++ b/brc
@@ -1032,7 +1032,8 @@ khfix() {
   rootsshsync
 }
 
-# copy path into clipboard
+# usage: $0 PATH
+# Puts absolute path into clipboard
 a() {
   local x
   x=$(readlink -nf "${1:-$PWD}")
@@ -1043,7 +1044,8 @@ a() {
   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:
@@ -3683,7 +3685,7 @@ lswc() {
 }
 # 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.
@@ -4546,6 +4548,14 @@ mbco() {
   "${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
diff --git a/brc2 b/brc2
index 16d951e8a13b57337f419e5a71664a261d8d0c02..7fba7a0d6c5b5e445c5be3b47eb76503748c7e15 100644 (file)
--- a/brc2
+++ b/brc2
@@ -616,7 +616,7 @@ bpl() {
     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
 
@@ -3172,7 +3172,7 @@ otp() {
   oathtool --totp -b "$*" | xclip -selection clipboard
 }
 # run cmd and copy output
-j() {
+jc() {
   "$@" |& pee "xclip -r -selection clipboard" cat
 }
 
@@ -4863,6 +4863,12 @@ Thanks again!"
 
 }
 
+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
index 67629bf5505ea4c7926deb6743494a2fb261ac32..8a4a4e5359fa6e8d076e08cf197843abd7f9a314 100755 (executable)
@@ -2156,6 +2156,23 @@ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo
 ### 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/
index af8bc7ea06859aab8f6747ad809dbcc85003e75b..d95b441ba4467c1640d18ead37f1e80cc66b418d 100755 (executable)
@@ -3706,19 +3706,15 @@ MAILDIR_HOME_MAILDIR_LOCATION = /m/md/Sent
 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.
index 7ffa90a3f0082ff773710c5883e28e7e0f675f62..a1132c9cc3869e0ebf4adf954681a28759a5a234 100755 (executable)
@@ -27,6 +27,9 @@
 #
 # 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