Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

DebianHelp for Backups

Have you a secure system for making automated backups of your personal files? I know I should have, but unfortunately I don't have a really working system. I have just rsynced my /home to an external drive. It works OK for backing up things like digital photos or multimedia files, but is not very useful for keeping different versions of the files I work on daily.

I just found a great collection of tutorials for backing up a Linux system. The site Debianhelp is oriented towards Debian, but of course the information given here can be used with just about any Linux system with some tweaking. The tutorials should work fine with Ubuntu. I just hope I would have time for organizing my files, computers and backups into a coherent system...

How to Print PostScript Calendars from Linux Console

There are so many command line tools for printing calendars and calculating dates, weekdays, lunar cycles, easter dates and lot more that it is difficult to remember all the possibilities these tools have to offer. I suppose everyone knows that the commad date prints the current time and date, and some probably most of my readers know how to print the calendar of current month using cal, gcal or ccal.

These tools are capable of lot more than simply outputting the current calendar to the standard output. Just see info gcal and you certainly will learn a lot more about gcal you can remember! I wanted, however, simply get a postscript or pdf calendar to be able to print it and have it on my wall. It took me some time before I realized, that gcal was not, after all, the right tool for the job.



What I needed was pcal. Simple command pcal > calendar.ps did exactly what I wanted: it produced a file with postscript code needed for printing this month's calendar. pcal is of course capable of doing a lot more, man pcal for more information.

HOWTO Create a Readable PostScript or Pdf File out of a Man Page

I find myself often reading man pages of unix programs to be able to use the installed software more efficiently. That is one of the reasons I prefer to use a lightweight installation of "real" distribution instead of some tiny distributions that leave all the unncessary files like documentation out of the system to save some megabytes.

The standard output of man is unfortunately not very pleasant to read. But as man pages are written in a typesetting language called groff and processed through the groff engine, the same source can be used to produce a highly readable PostScript file. All you need to do is to use man with the following options instead of the ordinary man command:

man -Tps man > man.ps

This produces a PostScript file man.ps out of the man page for man. You can either use your favourite viewer for viewing the PostScript file, print it out to a printer, or convert it with ps2pdf to a pdf file, if you prefer a pdf.

ps2pdf man.ps

The following screenshot shows man page man as a pdf file, viewed with xpdf.

HOWTO Read rtf Files in Linux Console

Today I continue where I finished yesterday. I have so far written about reading doc and pdf files in Linux command line. Today I turn to rich text format, that is the files with extension rtf. Rtf is a very common format used by those who are at least slightly familiar with the compatibility problems caused by using Word's binary file format. Also rtf can be viewed using lightweight tools, it is not necessary to use OpenOffice.org to read the file.

I was reminded by my reader Reidar about catdoc, yet another Linux tool for reading windows file formats. As I don't have MS Word installed on any of my computers, I used Abiword for writing a short text (in fact this blog posting!) and saved it as a rich text file. And I was not disappointed by catdoc. It printed the content of my file on screen just like cat would do with an ordinary plain text file. You might be able to find it in the repositories of your distribution.

Catdoc is a tool that doesn't attempt to analyze and reproduce file formatting. It just extracts readable text from the file. What it can do, is to handle all versions of Word and convert character encodings. It can also read RTF files and convert Excel and PowerPoint files. You should install it in any system running on an old computer.



I thought that there are no console editors that can edit rich text files. I was not even sure whether it such editors would make any sense. But as I knew that Emacs can do everything one might some day need to do with her computer, I decided to google for "Emacs rtf". Surprisingly, or maybe not, there actually is an Emacs extension for editing rich text files and VIM should be able to edit rtf files out of the box. We are living in a strange world, aren't we?

More tips for less

You can also search for strings in less. If you want to search forward in the file, use /pattern. In order to seach backward, use ?pattern.

These can also be used when reading man pages. Try for example to search for the word search in the man page for less:

man less
/search

As you see, less has many more possibilities for searches in text files. As I already mentioned in an earlier posting, pressing v in less opens the file in a text editor. You can first use / for searching the line to be edited. Then press v to edit the file at the line you just moved to.