Posts tagged ‘Utilities’

lftp connection : Access failed: 521 Data connections must be encrypted

If during an lftp session you get the error message:

get: Access failed: 521 Data connections must be encrypted. (xxx.tar.gz)

You will need to set this variable:

lftp username@host.com:/> set ftp:ssl-protect-data true

Grep text in PDF’s using pdftotext

If you ever need to grep some specific tags in a bunch of pdf files, you can use the following one liner, e.g:

for FILE in $(find /home/user/Desktop/downloads/ -name "*.pdf" 2>/dev/null -mtime -1 \! -type d -exec ls {} \;); do pdftotext $FILE - | grep -o 'BZ [0-9]\{5\}';done