X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=85583fe0901ebf47334755be6ef47b9476589efb;hb=4da3435e0d1918d90f59043deff2dffbdbe172c2;hp=7d58392d65fe59e5870d862232690bb74a527291;hpb=b186607514fbcf10bd5664ccb759a6e873f048c7;p=distro-setup diff --git a/brc b/brc index 7d58392..85583fe 100644 --- a/brc +++ b/brc @@ -279,6 +279,15 @@ mysrc() { mysrc /a/bin/small-misc-bash/ll-function mysrc /a/bin/distro-functions/src/package-manager-abstractions +# things to remember: +# ALT-C - cd into the selected directory +# CTRL-T - Paste the selected file path into the command line +# +# good guide to some of its basic features is the readme file +# https://github.com/junegunn/fzf +if [[ -s /usr/share/doc/fzf/examples/key-bindings.bash ]]; then + source /usr/share/doc/fzf/examples/key-bindings.bash +fi # * functions @@ -1013,7 +1022,7 @@ ccomp tail etail etail2 showkeys() { ssh "$@" cat .ssh/authorized_keys{,2} - } +} # print exim old pids @@ -1100,6 +1109,17 @@ econfdev() { update-exim4.conf -d /tmp/edev/etc/exim4 -o /tmp/edev/e.conf } +# exim grep in +# show important information about incoming mail in the exim log +egrin() { + sed -rn '/testignore|jtuttle|eximbackup/!s/^[^ ]+ ([^ ]+) [^ ]+ [^ ]+ <= ([^ ]+).*T="(.*)" from (<[^ ]+> .*$)/\1 \4\n \3/p' <${1:-/var/log/exim4/mainlog} +} + +# 2nd line is message-id: +egrinid() { + sed -rn '/testignore|jtuttle|eximbackup/!s/^[^ ]+ ([^ ]+) [^ ]+ [^ ]+ <= ([^ ]+).* id=([^ ]+) T="(.*)" from (<[^ ]+> .*$)/\1 \5\n \3\n \4/p' <${1:-/var/log/exim4/mainlog} +} + @@ -2573,6 +2593,10 @@ if [[ $- == *i* ]]; then if [[ $MAIL_HOST && $MAIL_HOST != "$HOSTNAME" ]]; then ps_char="@ $ps_char" fi + jobs_char= + if [[ $(jobs -p) ]]; then + jobs_char='\j ' + fi # We could test if sudo is active with sudo -nv # but then we get an email and log of lots of failed sudo commands. # We could turn those off, but seems better not to. @@ -2582,7 +2606,7 @@ if [[ $- == *i* ]]; then if [[ ! $HISTFILE ]]; then ps_char="NOHIST $ps_char" fi - PS1="${PS1%"${PS1#*[wW]}"} $psudo\[$ps_color\]$ps_char\[$term_nocolor\] " + PS1="${PS1%"${PS1#*[wW]}"} $jobs_char$psudo\[$ps_color\]$ps_char\[$term_nocolor\] " # set titlebar. instead, using more advanced # titelbar below