# HG changeset patch # User Henry S. Thompson # Date 1691513309 -3600 # Node ID 432915a28952fccc36113548bc186227e2959b3c # Parent e8c667bf8965250e2841b9a0704dad29eabf52a6# Parent e8f89aaa07c175f6b040c4be2ba29ec3acc3df80 merge diff -r e8f89aaa07c1 -r 432915a28952 .bash_profile --- a/.bash_profile Fri Jul 28 00:50:13 2023 +0100 +++ b/.bash_profile Tue Aug 08 17:48:29 2023 +0100 @@ -7,3 +7,4 @@ # User specific environment and startup programs +unset MANPATH diff -r e8f89aaa07c1 -r 432915a28952 .bashrc --- a/.bashrc Fri Jul 28 00:50:13 2023 +0100 +++ b/.bashrc Tue Aug 08 17:48:29 2023 +0100 @@ -20,6 +20,8 @@ echo -ne '\033]0;'${HOSTNAME/-login/} ${PWD/$HOME/w\~}'\007' } +PATH=$PATH:$HOME/.local/bin:$HOME/bin + if [ "$PS1" ]; then echo "Singularity bash" 1>&2 # don't put duplicate lines or lines starting with space in the history. @@ -33,6 +35,21 @@ export HISTSIZE=3000 export HISTFILESIZE=6000 export HISTIGNORE='[ ]*:&:[fb]g:exit' + + # fix $W -> \$W after tab completion + shopt -u progcomp + + if [ -d /mnt/lustre/indy2lfs/sw/ ] + then + # We have access to mounted modules from Cirrus, use anaconda python libs, + # in particular, tkinter for matplotlib + export MODULES=/mnt/lustre/indy2lfs/sw + export SING=csing + export PYTHONPATH=:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages + PATH=$MODULES/anaconda/anaconda3-2021.11/bin:$PATH + export XDG_RUNTIME_DIR=/tmp/runtime-$USER + fi + fi EDITOR=xemacs diff -r e8f89aaa07c1 -r 432915a28952 bin/sort_date.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/sort_date.py Tue Aug 08 17:48:29 2023 +0100 @@ -0,0 +1,30 @@ +#!/usr/bin/python3 +# Assumes you have used grep -v $'\t' on input for speed +# Recommended to also sed '/GMT$/s/\([^ ]\)GMT$/\1 GMT/' +# to fix a common 'bad' timestamp (~ .2% of inputs) +import email.utils +import sys +from urllib.parse import urlsplit + +def keyed(l): + uri, dateTime = l.split('\t',1) + try: + epoch = email.utils.parsedate_to_datetime(dateTime).timestamp() + parts = urlsplit(uri) + nl = parts.netloc + if ':' in nl: + pa,pp=nl.split(':') + (kk:=pa.split('.')).reverse() + return ('%s:%s)%s'%(','.join(kk), pp, parts.path),epoch) + else: + (kk:=nl.split('.')).reverse() + return ('%s)%s'%(','.join(kk), parts.path),epoch) + except Exception as e: + print(dateTime.rstrip(),e,sep='\t',file=sys.stderr) + return + +with open(sys.argv[1],"r") as ff: + for tl in sorted((kk for l in ff if (kk:=keyed(l)) is not None), + key=lambda x:x[0]): + print(tl[0],tl[1],sep='\t') +