Miscellaneous
— print (last updated: Jun 20, 2009) print

Select font size:

Lab Printer

Ubuntu uses the CUPS (Common UNIX Printing System) service which is installed by default. CUPS uses printer definition (PPD) files as print drivers. Common printers such as the Postscript printer in the lab already have a suitable PPD file in Ubuntu's foomatic database and Ubuntu makes the installation completely brainless.
  1. Activate the Printer config tool via:
    System Administration Printing.
  2. Activate the New Printer button.
  3. In the Select Device popup, the lab printer found on the 10.42.1.* subnet as:
    HP LaserJet P4515
    
    Click Forward. A suitable driver is automatically set up.
  4. Lastly, in the Describe Printer, change the Printer Name to something simpler, like:
    labpr
    

Convert Man Pages to PDF

You can create a high-quality PDF document containing the contents of a man page with a few simple steps. Let's say we want to do this for the rsync command. First run
man rsync
Note the top line:
rsync(1)
which means that we're looking at "section 1" of the man pages. The entirety of man pages are located in the directory:
/usr/share/man
Doing a listing of this directory reveals the subdirectory man1, which is the "section 1." Inside this directory we obtain the actual compressed source file:
/usr/share/man/man1/rsync.1.gz 
This file is what we need to do the conversion.

Conversion command

It is done using the following command:
$ man -l -Tps /usr/share/man/man1/rsync.1.gz | ps2pdf - rsync.pdf
What is happening is:
  1. the man command with the "-l" option does the conversion of the actual compreesed file to postscript format (-Tps) and sends that to standard output.
  2. the pipe symbol, |, connects the standard output of the man command to the standard input of the ps2pdf command.
  3. the ps2pdf (postscript to pdf) command takes standard input represented by the following "" and converts to PDF format as the output file rsync.pdf.
If you want easy reference of this document, move it to the your Desktop and double-click to read and/or print.
$ mv rsync.pdf ~/Desktop
Alternatively, the default PDF or Postscript reader is called evince, and you can summmon it from the command shell by:
$ evince rsync.pdf &

xml2 on other systems

The xml2 executable is part of a suite of executables which perform simple conversions to and from a variety of formats. The website is:
http://dan.egnor.name/xml2/
From here you can download the latest version of the xml2 software. Alternatively, download a recent version from the course website:
xml2-0.4.tar.gz
You will need a C compiler and certain libxml development packages in order to compile it.
  1. For Cygwin, make sure these are installed:
    pkg-config
    libxml
    libxml2
    libxml2-devel
    gcc-core
    
  2. For Fedora, assuming that that the standard Development package group has been installed, make sure this is installed:
    libxml-devel
    
Then, from a shell where the xml2-0.4.tar.gz package is available:
$ tar xzf xml2-0.4.tar.gz
$ cd xml2-0.4
$ ./configure
$ make
Then, to install, either:
$ make install        # cygwin, assuming common Windows insecurity 
or
$ sudo make install   # Linux systems


© Robert M. Kline