Skip to content

Instantly share code, notes, and snippets.

@gamma
Last active September 29, 2022 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gamma/a089aed5277cc727f9ccee01c4f8d1c6 to your computer and use it in GitHub Desktop.
Save gamma/a089aed5277cc727f9ccee01c4f8d1c6 to your computer and use it in GitHub Desktop.
Install alpine PDF printer
#!/bin/bash
# run with:
# curl -sSL https://gist.githubusercontent.com/gamma/a089aed5277cc727f9ccee01c4f8d1c6/raw | sh --
# Add testing repo
echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
# Install cups
apk add cups cups-libs cups-pdf@testing cups-client cups-filters hplip@testing
# Add user root to group lpadmin
addgroup root lpadmin
# run cups
cupsd
# add PDF printer as default
lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/cups-pdf.ppd && lpadmin -d cups-pdf
ps xo pid,command | grep exitcode | grep -v grep | awk '{print $1}' | xargs -r kill -TERM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment