[ preface | printing | parport | patches | clones | stuff ]


I'm still kinda working on this page, but there again, my webpages are always in a state of change.

Printing in linux

(or how to hack your print system into submission)

Having just hacked our print system into submission (and spending quite a while doing it), I thought it might be worth sharing some of the code/experience. We have an HP DeskJet 520 connected to the machine known as ``lothlorien''. Being a deskjet, it likes PCL (3rd flavour in this case). Thankfully, ghostscript supports this version of the printer and there's lots of information about setting this up on this page.

Since the printer supports various levels of output quality (with the -sPrintQuality=... option to ghostscript), we have setup 3 postscript print queues and 1 regular ``lp''. One print queue for regular output (called `hp'), one for draft output (called `hp-draft') and one for presentation (!) quality output (called `hp-best'). To turn postscript into PCL I hacked out a small filter program which does all the necessary gs work, although it may be relatively site-dependant. This single filter is designed to handle all three postscript queues, depending on how it gets invoked. On lothlorien, the real script is /usr/local/bin/zog-hp, with /usr/local/bin/zog-hp-draft and /usr/local/bin/zog-hp-best as symblinks to it.

The printcap file on lothlorien is pretty simple, mostly copy-and-paste of the existing defaults. The printcap files on other machines just re-direct jobs to lothlorien. We've handled authentication control by putting the names of other machines in lothlorien's /etc/hosts.lpd file.

So, here are the various files; the zog-hp script is a bit hacky, but it works :).

To print off my machine frog, say, it's simply a case of the regular ``lpr -Php-best''. The zog-hp script has a reasonable job at making sure the job is decent postscript (first by checking using `file | magic2mime' for `application/postscript', then by checking the return status of ghostscript). If a job fails, the filter returns 2 (JABORT) to have the job removed from the queue. If the job failed while being processed by ghostscript (broken postscript), the ghostscript messages are output (which will get mailed to the person who generated the job). A handy reference on print filters can be found here.

Parport stuff

I've recently (well, not so recent now) taken to trying to fix some bugs in the parport driver for Linux. The parport stuff is looked after by Tim Waugh and others, and the page about it can be found here. My offerings have been the odd fix and improvement/enhancement here and there.

Various patches

Here are some other random patches for the linux kernel:







Other UNIXen for PCs

If NT is the answer, you don't understand the question.

Other Linux stuff

Last modified: Sat Nov 1 12:49:47 2003 by Fred Barnes.