Printing Perl documentation

Tags:

Why? There's still nothing like printed documentation when you're learning a new subject. Or perhaps you'd like a PDF document to view on your tablet.

Here's the quickest way to create a PDF from any Perl documentation on your system. For example, let's do the CPAN module SQL::Abstract:

pod2pdf --pagesize=letter `perldoc -l SQL::Abstract`       > /tmp/SQL_Abstract.pdf`

Now you can view or print that. I find print 2-up pages, double-sided (4 total pages per sheet) is a handy and space-saving yet still readable. You might find it useful to reduce the PDF margins and let evince or okular manage the actual 2-up physical margins later:

pod2pdf --margins 18 --pagesize=letter       `perldoc -l SQL::Abstract` > /tmp/SQL_Abstract.pdf

The margins parameter is in printer's points (1/72 inch) and 18pt = ¼inch (0.635cm). You can also specify --left-margin as well as right, top, and bottom margins individually.

When printing several PDFs together, you may want to suppress blank pages. This is important when using double-sided or 2-up printing. To join several PDFs together for printing, you can use:

pdfunite a-in.pdf b-in.pdf output.pdf

If you are having difficulty printing documentation that contains Unicode,

 cpanm App::pod2pdf Paper::Specs

Cups doesn't start on Fedora

Tags:

For some reason, on Fedora 15, CUPS wasn't starting on bootup. Print jobs were just being silently dropped. I tried this:

$ **lpq** lpq: Unable to connect to server.

Hmm... That's not right.

$ **sudo service cups start** Redirecting to /bin/systemctl start cups.service

Oh... they changed the administration command for some reason. I couldn't find anywhere in the menus (or the discombubulated, disorganized mess that substitutes for menus in Gnome 3) a GUI for selecting startup services. Didn't we have that back in RedHat 4? Anyway... a little digging uncovers that the simple service command, inexplicably, has been replaced by the more jargon-laden systemctl command, so the 'new' way is now:

$ **sudo systemctl start cups.service**

OK that got it going. lpq sees CUPS and print jobs actually print. Now to change it permanently:

$ <strong>sudo chkconfig --list</strong>

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

iscsi 0:off 1:off 2:off 3:on 4:on 5:on 6:off
iscsid 0:off 1:off 2:off 3:on 4:on 5:on 6:off
livesys 0:off 1:off 2:off 3:on 4:on 5:on 6:off
livesys-late 0:off 1:off 2:off 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
network 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sandbox 0:off 1:off 2:off 3:off 4:off 5:on 6:off
svnserve 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Another frustration. This functionality is now rolled into the systemctl command. Perhaps that's nicer, but where's the GUI interface for this? I guess I could use webmin, but gosh it seems Gnome should have one.

Here's what it reports:

$ **systemctl status cups.service** cups.service - CUPS Printing Service Loaded: loaded (/lib/systemd/system/cups.service; disabled) Active: active (running) since Thu, 20 Oct 2011 08:19:58 -0700; 7min ago Main PID: 16104 (cupsd) CGroup: name=systemd:/system/cups.service └ 16104 /usr/sbin/cupsd -f

OK, it's disabled at startup. here goes:

$ **sudo systemctl enable cups.service** ln -s '/lib/systemd/system/cups.service' '/etc/systemd/system/printer.target.wants/cups.service' ln -s '/lib/systemd/system/cups.socket' '/etc/systemd/system/sockets.target.wants/cups.socket' ln -s '/lib/systemd/system/cups.path' '/etc/systemd/system/multi-user.target.wants/cups.path' $

Ah, there we go.

Please, Fedora and Gnome -- where's the GUI administration tools for this?