Printing to PDF using cups-pdf

Recently at work I discovered PDFCreator with which any document can be printed into PDF. Alas, it is a Windows program and a LINUX port is not available. Fortunately, I found cups-pdf for Ubuntu.

Note: You can print to a Post Script file directly in LINUX, and then use  ps2pdf13 to convert the .ps file to .pdf.

To install cups-pdf, type the following at the terminal or use Synaptic Package Manager:

sudo apt-get install cups-pdf

Now, Ubuntu 9.04 installs a ‘PDF’ pritner automatically – in earlier versions you have to manually install a PDF printer as described here http://www.ubuntugeek.com/how-to-create-pdf-documents-in-ubuntu.html.

Check your installation by going to:

System -> Administration -> Printing

You should see a printer with name PDF installed.

Now create a  directory named PDF in your home directory and you are all set to print directly to PDF.

You can change the name of the default directory from PDF to anything of your choice by changing the configuration file which is located at:

/etc/cups/cups-pdf.conf

Where is the trash stored in Ubuntu?

I use GNOME in Ubuntu for windows management. A few days back I deleted a directory and it got stuck in the trash can. I mean literally. I could not permanently remove it from trash. It was one of those directories which had files whose permissions did not allow me to remove it.

I  was then looking to see where the trash is stored and finally found it lurking in my home directory under

 ./.local/share/Trash

I used the following find command to find it:

find . -name Trash -print

The actual trashed files/directories are located under

 ./local/share/Trash/files.

Once, I found this out, I was able to remove it permanently with:

sudo rm -r <dir-to-be-removed-permanently>

Opening UIF image files in Ubuntu

Opening UIF CD/DVD image files in Ubuntu

The other day I downloaded a CD image which came with an UIF extension. UIF is MagicISO image file. To open it in Ubuntu, you have to convert it into an ISO version.

Fortunately, there is a uif2iso converter. You can find it at http://aluigi.org/mytoolz/uif2iso.zip.

Download this zip file and extract it to a directory, say uif2isoSrc. You will find a windows version of uif2iso.exe in the root here. You can use wine to run it as follows:

wine uif2iso input.uif output.iso

or better still go to the src directory and run make here. Now, you will have an native executable uif2iso generated here. You can now add it to your bin directory and run it as:

uif2iso input.uif output.iso

NOTE: Once you have an iso file you can mount it as a virtual cdrom using gmount-iso.

Screenshot of Gmount-iso GUI
Screenshot of Gmount-iso GUI

Determining Ubuntu Version

There are couple of ways to determine the Ubuntu version your machine is running.

  • cat /etc/lsb-release
  • cat /etc/issue

Out of this the lsb-release seems to be the most comprehensive.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION=”Ubuntu 8.10″

and the /etc/issue the most terse.

$ cat /etc/issue
Ubuntu 8.10 n l

The uname command provides the version of Linux distribution.

$ uname -r
2.6.27-11-generic

The uname -m option will help you determine if you are running the 32-bit version or 64-bit version of Ubuntu.

$ uname -m
i686

Apparently if you are running a 64-bit version (on a 64-bit machine), you should get something like x86_64 as the result.