0
1

I have heard that you can get the DIKU printers recognized on your own system, to make it easier to print, how do you do that?

This question is marked "community wiki".

asked 23 Dec '11, 17:52

Martin%20Dybdal's gravatar image

Martin Dybdal ♦♦
1.1k123282
accept rate: 69%

edited 10 Jan '12, 13:34

Nana%20Girotti's gravatar image

Nana Girotti ♦
1164


You can also run:

lpr -H print.diku.dk:631/ -P PRINTERNAME FILENAME

(If you use an older version of CUPS (< 1.6.x), you can use the BrowsePoll directive to automatically add all DIKU printers. See older answers below.)

link
This answer is marked "community wiki".

answered 28 Nov '12, 22:41

root's gravatar image

root
914
accept rate: 28%

edited 17 Sep '13, 10:36

ngws's gravatar image

ngws ♦♦
2892613

Marked as community wiki. Anyone can improve this answer now.

(17 Sep '13, 10:34) ngws ♦♦ ngws's gravatar image

This is very easy using CUPS. You need to edit the /etc/cups/cupsd.conf file and add the following line (it needs to be edited as root):

BrowsePoll print.diku.dk:631

Some distributions, e.g. Ubuntu, disable printer browsing by default, you so might need to change Browsing Off to Browsing On as well.

When you have made those changes you will need to restart the CUPS service. How you do that depends on the distribution. On Ubuntu it would be by typing the command sudo service cups restart in the terminal.

This should make all available DIKU printers show up on your printer list in your applications.

Note: This no longer works as of cups 1.6.

link

answered 09 Jan '12, 14:24

Daniel%20Egeberg's gravatar image

Daniel Egeberg ♦♦
4514
accept rate: 69%

edited 03 Sep '12, 20:07

An alternative way to print from linux, is to use lpr over SSH.

You can either upload the files to ask, brok or tyr using for instance SCP, and then print them:

scp important-thesis.pdf username@ask.diku.dk:important-thesis.pdf
ssh username@ask.diku.dk
lpr -P<printer> important-thesis.pdf

Or you can simply do it in one sweep and pass the file to lpr over stdin:

cat important-thesis.pdf | ssh username@ask.diku.dk lpr -P<printer>
link

answered 13 May '12, 13:39

Sebastian%20Paaske%20T%C3%B8rholm's gravatar image

Sebastian Pa... ♦♦
86531133
accept rate: 41%

edited 13 May '12, 13:40

1

I prefer this version:

ssh username@ask.diku.dk lpr -Pprinter < important-thesis.pdf

Fewer keystrokes, and the filename is in the end of the command so you can quickly replace it if you need to print other stuff.

Also, you might want to change over to use "lp" instead of "lpr"

ssh username@ask.diku.dk lp -d printer < important-thesis.pdf

I think it is "more standard" on Linux, and I find the arguments more convenient. For example "lp -P 5,34-37" prints page 5 and 34 through 37. To do the same with lpr you have to type "lpr -o page-ranges=5,34-37"

(13 May '12, 17:10) Martin Dybdal ♦♦ Martin%20Dybdal's gravatar image

A handy feature when using the ssh command is that it is also usable with your shiny new smartphone with some kind of terminal emulater installed. This means that if you from time to time swing by DIKU merely for your printing needs, and don't want to go looking for a (incrisingly elusive) terminal, you phone will do the trick just as nicely.

(21 May '12, 23:23) DanielR DanielR's gravatar image

I created a script because I can never remember the lp/lpr command parameters.

One should set up SSH keys to ask or tyr to avoid typing passwords.

#!/bin/sh
PRINTER=s2a
COPIES=1
ARGS=""
HOST=tyr
DRY=0

if ! opts=$(getopt -o p:n:r:h:fd24 -l fit,duplex,host:,range:,dry -- "$@")
then
    echo "Usage: dprint [-p printer] [-n copies] [--fit] [--duplex] [-2 | -4]"
    echo "              [-h|--host hostname] [-r 1-5,7,13] [--dry] <files>"
    exit 1
fi

set -- $opts

while [ $# -gt 0 ]
do
    case $1 in
        (-p)         PRINTER="$2"; shift;;
        (-n)         COPIES="$2"; shift;;
        (--fit)      ARGS="$ARGS -o fit-to-page";;
        (--duplex)   ARGS="$ARGS -o Duplex=DuplexNoTumble";;
        (-2)         ARGS="$ARGS -o number-up=2";;
        (-4)         ARGS="$ARGS -o number-up=4";;
        -r|--range)  ARGS="$ARGS -o page-ranges=$2"; shift;;
        -h|--host)   HOST="$2"; shift;;
        (--dry)      DRY=1;;
        (--)         shift; break;;
        (-*)         echo "$0: Unknown option $1. Error." 1>&2; exit 1;;
        (*)          break;;
    esac
    shift
done

for f in $*
do
    f=${f:1:-1}
    if [ $DRY -eq 1 ]
    then echo "cat -- \"$f\" | ssh $HOST lpr -P $PRINTER -# $COPIES $ARGS"
    else
        echo "Printing $f..."
        cat -- "$f" | ssh $HOST lpr -P $PRINTER -# $COPIES $ARGS
    fi

done
link

answered 09 Dec '12, 22:34

Simon%20Shine's gravatar image

Simon Shine ♦
384310
accept rate: 27%

If you don't feel like getting dirty with editing the cupsd.conf manually, the *buntu's offer a easy to use graphical printer installation wizard, by selecting printer/add new from the settings menu. Also check out this handy tutorial from ScienceIt, which also explains how to view/delete jobs from the web interface: http://www.science.ku.dk/it/vejledninger/printeropsaetning/diku/

link

answered 17 Jan '12, 14:57

DanielR's gravatar image

DanielR
1352
accept rate: 83%

I post my version because I find it simpler. It worked for me.

Firstly, connect to the "eduroam" wireless.

To lookup the printer's status:

lpq -h print.diku.dk:631/ -P <3 letter printer name>

To print:

lpr -H print.diku.dk:631/ -P <3 letter printer name> <file name>

(note that there is a difference in the host argument: "-h" vs "-H")

link

answered 03 Sep '13, 17:29

gabriel's gravatar image

gabriel
314
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×122
×11

Asked: 23 Dec '11, 17:52

Seen: 2,499 times

Last updated: 17 Sep '13, 10:36

powered by OSQA