cx () {
# zip -rv zipfile.zip newfile.txt newfile1.txt
local tarfile=code.$RANDOM.$(date "+%Y-%m-%d-%H-%M-%S").tar
local logfile=$tarfile.log
echo checkpointing code to $tarfile | tee -a $logfile
tar cvf $tarfile *.py *.sh *.txt *.yml
echo saved code to $tarfile | tee -a $logfile
echo "$@" | tee -a $logfile
$@ 2>&1 | tee -a $logfile
echo reminder that we saved code to $tarfile | tee -a $logfile
echo adding logfile $logfile to $tarfile | tee -a $logfile
tar rvf $tarfile $logfile
mv $logfile /tmp/
}