From: Ian Kelling Date: Thu, 29 May 2025 23:08:32 +0000 (-0400) Subject: various improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=9be55ced10b52ed48060ea51d050010eff796c22;p=distro-setup various improvements --- diff --git a/beetag b/beetag index 0f58ded..f06d9e6 100755 --- 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 5d7ec44..c6016e3 100644 --- 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 16d951e..7fba7a0 100644 --- 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 diff --git a/distro-end b/distro-end index 67629bf..8a4a4e5 100755 --- a/distro-end +++ b/distro-end @@ -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/ diff --git a/mail-setup b/mail-setup index af8bc7e..d95b441 100755 --- a/mail-setup +++ b/mail-setup @@ -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. diff --git a/mailtest-check b/mailtest-check index 7ffa90a..a1132c9 100755 --- a/mailtest-check +++ b/mailtest-check @@ -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'