Print quota management in Ruby?

I’m a unix admin at a lab, and we use Pykota to manage print quotas
(essentially, each user has a ‘balance’, each printer has a ‘cost per
page’, and Pykota manages that). I’ve grown to hate Pykota (it was
installed before my time), and so have the other admins. Unable to find
alternatives, I thought I might be able to write my own.

Requirements:

  • Per-user granular modifications - ability to precisely set a user’s
    quota,
    or give him unlimited quota.
  • One printer will be enough.
  • Printable from Windows workstations over Samba (this is what makes
    it tricky,
    otherwise I’d just hack up an alternative lpr)
  • Users need to be able to see how much quota they have left

Bonus points:

  • Web-based interface for administration (simple if data is kept in
    SQL, then
    I can use Rails)
  • Web-based queue-view (much less important)
  • Error message when out of queue displayed on the Windows box while
    attempting
    the print.

It would be nice if I could just have an “upload your file, we’ll print
it”
solution, but since people want to print Powerpoint slides (in Hebrew,
which
Openoffice doesn’t properly convert), that’s not possible. (Adobe
Acrobat isn’t
installed on the workstations, so we can’t make people upload PDFs.

The big questions are these:

  • Do I ‘spoof’ a printer for the queue? Or do I ‘block’ other printers
    like Pykota does? Something else perhaps?
  • How do I count pages? Will postscript be able to do that?

Any input would be appreciated.

On May 17, 2006, at 10:23 AM, Ohad L. wrote:

  • Do I ‘spoof’ a printer for the queue? Or do I ‘block’ other
    printers
    like Pykota does? Something else perhaps?
  • How do I count pages? Will postscript be able to do that?

Any input would be appreciated.

Oh but you can. Don’t share a real printer. Install ghostscript, and
use that to produce .ps in some directory when people “print”, which
you can then convert to pdf if you want (ps2pdf) or send off as is to
the real printer. They still get to click on file > print, and you
still get the benefits of upload your file and we’ll print it scenario.

As far as displaying a message on the windows box, I believe you can
use samba to send ‘net send msg’ style messages.