X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=bashrc;h=1580fb98c63e94375609f9d490d5e83c4cbc9584;hb=54727443ce8762ddf9be8fe541558624c3b20d62;hp=b2b3e51ab0e7478293590c54f90742263634210d;hpb=c3fd43c00a1093c6c3377e46604becb791bfe2f0;p=scripts.git diff --git a/bashrc b/bashrc index b2b3e51..1580fb9 100644 --- a/bashrc +++ b/bashrc @@ -122,6 +122,7 @@ alias val='valgrind --leak-check=full --show-reachable=yes --db-attach=yes ' alias s='screen -d -R -U && clear' alias p='feh --force-aliasing -d --full-screen --auto-zoom' +alias gp=gnuplot function nh () { export HISTFILE=/dev/null @@ -314,7 +315,12 @@ function scan () { # A password generator function genpw () { - tr -dc A-Za-z0-9 < /dev/urandom | head -c16 + PW=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c16) + if [[ ! "$1" == "-s" ]] + then + echo "$(date) ${PW}" >> ${HOME}/private/genpw.log + fi + echo ${PW} # tr -dc [:graph:] < /dev/urandom | head -c16 echo } @@ -424,6 +430,23 @@ function trash () { echo "Trashed $@" } +function trashlatex () { + TRASH=$(date +/tmp/trash-latex-${USER}-%Y-%b-%d-%Hh) + LINK=/tmp/trash + + mkdir -p ${TRASH} + + [[ -h ${LINK} ]] && \rm ${LINK} + + [[ ! -f ${LINK} ]] && ln -s ${TRASH} ${LINK} + + mv -v \ + *.log *.pdf *.aux *.nav *.pdfpc *.snm *.toc *.out \ + *.bbl *.blg \ + *.*.table *.*.gnuplot \ + ${TRASH} +} + ###################################################################### ## A version of pho which stores the image numbers in environment ## variables @@ -586,8 +609,9 @@ function checkgw () { function lr () { TERM_SIZE=($(stty size)) + INVIS="${VT_GREEN_FG}${VT_RESET}" \ls -goth --time-style="+${VT_GREEN_FG}%Y %b %d %H:%M${VT_RESET}" "$@" | \ - head -$((TERM_SIZE[0]-2)) | cut -b1-${TERM_SIZE[1]} + head -$((TERM_SIZE[0]-2)) | cut -b1-$((TERM_SIZE[1]+${#INVIS})) } ######################################################################