Get that printer connected, up, and running with Ubuntu.
Ubuntu uses CUPS, the Common Unix Printing System, to manage printers and print queues. CUPS can be configured using a variety of tools, including the GNOME CUPS Manager and its own built-in web interface that runs on port 631.
To launch GNOME CUPS Manager, select System→Administration→Printing, which will display a list of currently installed printers, shown in Figure 1-6, and give you the option of adding a new printer.
Double-click the New Printer icon to open the "Add a Printer" window. Here, you need to specify whether your printer is connected directly to your computer or is on your network (see Figure 1-7). If your printer is connected by USB, it's a good idea to use the instructions in "Mount Removable Devices with Persistent Names" [Hack #83]">Figure 1-7). If your printer is connected by USB, it's a good idea to use the instructions in "Mount Removable Devices with Persistent Names" [Hack #83] to assign a permanent name to your printer before going any further; otherwise, it will probably be assigned a different bus ID every time you plug it in, and you will be asked to configure it again each time!
If your printer is connected via the network, you will need to specify the protocol: IPP (Internet Printing Protocol), SMB (Windows printer sharing), LPD (Line Printer Daemon), or HP JetDirect. Each of those protocols in turn provides a number of configuration options to specify the printer identity. In Figure 1-8, the printer is connected to the second port on a network print server using IPP.
Specify the printer manufacturer and then select the model from the provided list, as shown in Figure 1-9.
If your printer model isn't included in the list, you can try using one of the drivers listed under the Generic manufacturer, or, if it's a PostScript printer, you can load the manufacturer's supplied PPD (PostScript Printer Description) file using the Install Driver button.
Apply the changes, and you'll return to the list of installed printers with your new printer listed, as shown in Figure 1-10.
GNOME CUPS Manager provides quick access to basic options, but to really take control of CUPS, you should use the built-in web-management interface. Open your web browser and point it at http://localhost:631 to see a huge range of options.
Open /etc/cups/printers.conf in a text editor to see the definition for your printers. Each printer is defined in a separate block, with configuration options applied in any order inside the block, and you should see an existing configuration option of:
Change this to:
After you make changes to printers.conf, restart the CUPS scheduler:
sudo /etc/init.d/cupsys restart
Open /etc/cups/printers.conf in a text editor
and add two options:
PageLimit, which is the page count limit, and
QuotaPeriod, which is the period in seconds
for which you want it enforced. To apply a limit of 200 pages per
week, you could set those options to:
QuotaPeriod 604800 PageLimit 200
One day is 86,400 seconds, a week is 604,800 seconds, and a month is 2,592,000 seconds.
You can also apply a
KLimit option, which is the amount of data in
kilobytes that the printer is allowed to receive. This can be useful
if you want to prevent people sending extremely large print jobs to
Remember to restart CUPS after making changes to printers.conf.
One possible hack to get around the per-printer limitation of quota settings is to configure the same printer multiple times, each with a different name and access controls but all communicating with the same device. The quota for each "printer" will then be tracked and enforced individually, so you could have each user connecting to a different virtual printer to enforce individual quotas.