linux

HylaFax faxserver under Ubuntu / Debian

queue status
faxstat -s # shows fax in the queue waiting to be sent
faxstat -d # shows faxes sent
faxstat -r #shows faxes received

delete fax
faxrm JOB_ID
or if you can´t delete run under creator
sudo -u USERNAME faxrm JOB_ID

HylaFax spool directory
/var/spool/hylafax/

delete all send faxes

for i in $(ls /var/spool/hylafax/doneq); do
   faxrm ${i:1}
done

get rejected fax nubers
faxstat -d | grep REJECT | cut -d" " -f 7 > fax_rejected.txt

python

string
http://thepythonguru.com/python-strings/
https://www.tutorialspoint.com/python/string_startswith.htm
if var1 != var2:

output to file
text_file = open("/tmp/debug", "w")
text_file.write("option1: %s\n" % option1)
text_file.write("value1: %s\n" % value1)
text_file.close()

List available pyenv versions
https://www.python.org/ftp/python/
pyenv install --list

# virtualenv ?
pip install -U virtualenv --user
mkdir -vp ~/test
cd ~/test
virtualenv .venv
source .venv/bin/activate
pip install -U pip