Added date information to end of chertex.sh output.

master
Taha Ahmed 11 years ago
parent 95164fa0a3
commit 59e38ea466

2
.gitignore vendored

@ -2,3 +2,5 @@ pdfcrop
unborn/
documentation/
PlotDigitizer.jar
jpeglib.h
nbconvert/

@ -57,7 +57,7 @@ if [ $# -eq 1 ]; then
fi
# Introducing a short delay to enable on-screen reading of previous echo
simpledelay.sh 2
/home/taha/chepec/chetex/common/bash/simpledelay.sh 2
echo "Delay completed"
## Handle knitr or pgfSweave jobs separately
@ -81,7 +81,7 @@ if [ $# -eq 1 ]; then
echo "<cheRTeX> -----------------------"
echo "<cheRTeX> Rscript knitr completed"
echo "<cheRTeX> -----------------------"
simpledelay.sh 4
/home/taha/chepec/chetex/common/bash/simpledelay.sh 4
else
# Run pgfSweave commands
echo "<cheRTeX> ---------------------------"
@ -99,7 +99,7 @@ if [ $# -eq 1 ]; then
echo "<cheRTeX> -------------------------"
echo "<cheRTeX> R CMD pgfsweave completed"
echo "<cheRTeX> -------------------------"
simpledelay.sh 4
/home/taha/chepec/chetex/common/bash/simpledelay.sh 4
fi
# Run vc script if vc exists in working directory
@ -111,11 +111,11 @@ if [ $# -eq 1 ]; then
# Run pdflatex, bibtex, and company
if $ltxmkrc; then
echo "<cheRTeX> Calling LaTeXMK with RC file"
simpledelay.sh 2
/home/taha/chepec/chetex/common/bash/simpledelay.sh 2
latexmk -r .latexmkrc -pdf -bibtex $jobname
else
echo "<cheRTeX> Calling LaTeXMK"
simpledelay.sh 2
/home/taha/chepec/chetex/common/bash/simpledelay.sh 2
latexmk -pdf -bibtex $jobname
fi
@ -173,7 +173,7 @@ else
for tikzfiles in "$tikzfiles"; do tikzfilenumber=${#tikzfiles}; done
echo "cheRTeX detected $tikzfilenumber TikZ files for processing"
echo "Starting TikZ file processing..."
simpledelay.sh 2
/home/taha/chepec/chetex/common/bash/simpledelay.sh 2
for tikzfilename in $tikzfiles; do
# Call tikz2pdf
@ -253,4 +253,11 @@ else
exit 1
fi
echo "------------------------------------"
echo "=== sample-matrix.sh completed ==="
echo "=== $(date) ==="
echo "------------------------------------"
/home/taha/chepec/chetex/common/bash/simpledelay.sh 10
exit 1

@ -0,0 +1,12 @@
#!/bin/bash
## Start Chrome with multiple tabs (Gmail, RTM, etc.)
## Written Oct 12, 2013
## Taha Ahmed
a="https://mail.google.com"
b="https://rememberthemilk.com"
c="https://chepec.timetask.com"
google-chrome $a $b $c
exit 1

@ -0,0 +1,33 @@
#!/bin/bash
## Convert PDF to text and send to Pocket
## Written Nov 24, 2013
## Taha Ahmed
# Usage:
# pdf2pocket.sh worthreading.pdf
# Note: requires python and the python script "sendfromgmail.py"
pdffile=$1
# Filename without extension part
jobname=${pdffile%.*}
txtfile=$jobname.txt
htmlfile=$jobname.html
# convert PDF to txt (saved in the current directory)
# it seems txt works better than HTML (Pocket cannot reformat HTML files for reasons unknown to me...)
pdftotext $pdffile
# copy the created file to my Dropbox public folder
cp $txtfile /home/taha/Dropbox/Public/$txtfile
# construct the corresponding Dropbox public URL
htmlurl="https://dl.dropboxusercontent.com/u/47462551/$txtfile"
# email url of htmlfile in public Dropbox to Pocket
python ~/chepec/chetex/common/bash/sendfromgmail.py "add@getpocket.com" "dropbox2pocket" "$htmlurl"

@ -0,0 +1,30 @@
#!/bin/bash
## Convert PDF to text and send to Readability
## Written Nov 6, 2013
## Taha Ahmed
pdffile=$1
# Filename without extension part
jobname=${pdffile%.*}
txtfile=$jobname.txt
htmlfile=$jobname.html
#outfile=$jobname
# saves a HTML file in the current directory
pdftotext -htmlmeta $pdffile
# remove newlines from txtfile
#tr -d "\n" < $txtfile >
# copy the created txtfile to dropbox public folder
# and rename it to *.HTML
cp $htmlfile /home/taha/Dropbox/Public/$htmlfile
# construct the corresponding Dropbox public URL
htmlurl="https://dl.dropboxusercontent.com/u/47462551/$htmlfile"
# email url of htmlfile on dropbox to readability
#mail -s "dropbox2readability" chepec+simms@inbox.readability.com <<< $txturl
mail -t "chepec+simms@inbox.readability.com" -s "dropbox2readability" <<< $htmlurl

@ -0,0 +1,66 @@
#!/usr/bin/python
import os, re
import sys
import smtplib
# I have commented out the parts that allow sending of attachments...
# I got this code from user hakermania at http://ubuntuforums.org/showthread.php?t=1472520
#from email.mime.image import MIMEImage
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.MIMEText import MIMEText
SMTP_SERVER = 'smtp.gmail.com'
SMTP_PORT = 587
sender = 'taha.sol@gmail.com'
password = "OKWS:pled2XO"
recipient = sys.argv[1]
subject = ''
message = sys.argv[3]
def main():
msg = MIMEMultipart()
msg['Subject'] = sys.argv[2]
msg['To'] = recipient
msg['From'] = sender
part = MIMEText('text', "plain")
part.set_payload(message)
msg.attach(part)
session = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
session.ehlo()
session.starttls()
session.ehlo
session.login(sender, password)
#fp = open(sys.argv[4], 'rb')
#msgq = MIMEBase('audio', 'audio')
#msgq.set_payload(fp.read())
#fp.close()
# Encode the payload using Base64
#encoders.encode_base64(msgq)
# Set the filename parameter
#filename=sys.argv[4]
#msgq.add_header('Content-Disposition', 'attachment', filename=filename)
#msg.attach(msgq)
# Now send or store the message
qwertyuiop = msg.as_string()
session.sendmail(sender, recipient, qwertyuiop)
session.quit()
os.system('notify-send "Email sent"')
if __name__ == '__main__':
main()
Loading…
Cancel
Save