Skip to content

Instantly share code, notes, and snippets.

@bahamat
bahamat / dpkgup.cf
Last active August 29, 2015 14:06
A cfengine bundle to upgrade all or a list of packages on a Debian system.
bundle agent dpkgup(p_list) {
vars:
done_with_classes.package_list_provided::
"pkg_list" string => join(" ", p_list), policy => "free";
done_with_classes.!package_list_provided::
"pkg_list" string => "", policy => "free";
done_with_classes::
@guifromrio
guifromrio / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.