Skip to content

Instantly share code, notes, and snippets.

@codeopensrc
Created February 4, 2016 10:17
Show Gist options
  • Save codeopensrc/ab2945786bc5593cd6fe to your computer and use it in GitHub Desktop.
Save codeopensrc/ab2945786bc5593cd6fe to your computer and use it in GitHub Desktop.
Linux print remote -> local, local -> remote strictly from command line
# Have a printer hooked up to linux os
# Have CUPS installed on it and make sure the printer prints from linux
# Have abiword (This is used to convert file to pdf via command line)
# sudo apt-get install abiword
cat dev.json | ssh user@ip 'cat - > tmp.doc; abiword --to=pdf tmp.doc; lp tmp.pdf; rm tmp.doc'
# Havent tested with removing the pdf right after issuing lp, might work.
# Also havnt tested converting other files besides .doc to .pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment