Search

ccze: A robust, modular log coloriser

January 31st, 2007 edited by ana

Entry submitted by arno. DPOTD needs your help, please contribute !

ccze is a log coloriser. It can parse log files, understand them (with regexes), and displays a nicely formatted output. It becomes easier to catch important information from a log file.

To cope with different kind of logs, ccze uses different plugins, each able to understand one type of file. Currently, ccze support 19 different plugins, such as exim, httpd, procmail, and much more. If a line is recognized by no plugin, a default parsing and coloration are available. You can also add support for a new type of file, by creating a plugin and copying it in /usr/lib/ccze, or $HOME/.ccze.

By default, ccze uses ncurses for output, but you can also display on standard output, or to format a report in html. Czze is based on colorizer, an older log coloriser. Actually, ccze was a rewrite in C language to make it faster (coloriser was written in perl language).

Related tools

Other log colorizer in Debian and Ubuntu include lwatch and loco. Loco is a nice tool, but only uses a generic parser. Therefore, output is sometimes less accurate than ccze. With lwatch, you can define your regexps in a configuration file. So, it’s more easy to add a new type of file. Lwatch reads data from named fifo, so it is not really suitable for use from the command line.

Target Users:

  • System administrators.
  • Users that watch their log regularly, and/or need to get a quick grasp of what’s going on their system.

Further reading:

Loganalysis.Org has online bibliography on logging and related topics. You can consult it at https://www.loganalysis.org/frames/left-navbar-library.html

Links:

Latest ccze release is available in both Debian and Ubuntu.

Posted in Debian, Ubuntu | 4 Comments »

agave: Design colour schemes the easy way

January 28th, 2007 edited by ana

Entry submitted by Phil Bull. DPOTD needs your help, please contribute !

Agave (formerly GNOME Colorscheme) is a simple GNOME utility for generating colour schemes.

Select a base colour and Agave will suggest a small set of colours which complement it. You can choose from several types of colour scheme; for example, selecting ‘Monochrome’ results in a scheme of different shades of the same colour, whereas ‘Complements’ just gives two colours which complement each other. If the scheme Agave suggests isn’t ideal, you can increase and decrease both the brightness and saturation of the scheme as a whole using the buttons on the toolbar.

Agave colour scheme generator

You can select any colour on the screen as a base colour by using the ‘dropper’ tool (hidden away in the colour picker dialog). Three different representations of the colours in your colour scheme are given: Hex, RGB, and HSV, and copying the colours into a graphics application is simply a matter of dragging-and-dropping them. If you design websites and edit CSS, Agave may come in useful - particularly when your imagination fails you. The random button generates a random colour scheme, and repeatedly pressing it soon results in a usable combination of colours for you to use.

A small irritation is the limited number of colours allowed per colour scheme. While 2-3 colours may be fine when decorating a room, websites and graphics projects often require several more. Apart from this, Agave appears to have no major bugs, and most of the issues filed in its bug tracker are feature requests. There are several translations available, too. KColorEdit (the KDE equivalent) can handle colour palettes, which makes it more useful to graphics designers at the moment. However, Agave is still a ***** project and offers some novel features which anyone working with colour will appreciate.

Agave is available in Ubuntu Edgy (universe) and Debian Etch.

Links

Posted in Debian, Ubuntu | 4 Comments »

apt-file: search for files in packages, installed or not

January 24th, 2007 edited by lucas

Entry submitted by Paul Sundvall. DPOTD needs your help, please contribute !

Have you ever tried to compile some tar-ball and had to download missing dependencies? In that case, you probably needed to find out which packages were needed to fix those dependencies. Sometimes there is a README which states what you need, but that might not be that helpful sometimes.

One way of finding out which package needs to be installed is to use the debian package search page.

Another way is to use apt-file instead. It works as a local search engine, based on the apt sources you have in /etc/apt/sources.list.

To use apt-file, build the search database by issuing apt-file update as root. Then, as an ordinary user, search for a file with apt-file search file and you get the package names which contain the file you look for. Install them with apt-get, and your missing dependencies are gone with the wind!

apt-file is located in package apt-file in both Debian and Ubuntu.

after install, build the search database with apt-file update.

Example:

I tried to compile a simple pam example, which gave the following output:

pauls@voltaire:~/code/eget/all/pam$ make
gcc  pamexample.c  -o pamexample -lpam -lpam_misc
pamexample.c:12:31: error: security/pam_appl.h: Filen eller katalogen
finns inte
pamexample.c:13:31: error: security/pam_misc.h: Filen eller katalogen
finns inte
[...]

Seems like I need the (for me) unknown file pam_appl.h. Time to use apt-file!

pauls@voltaire:~/code/eget/all/pam$ apt-file search pam_appl.h
libpam-doc: usr/share/doc/libpam-doc/html/pam_appl.html
libpam0g-dev: usr/include/security/pam_appl.h
lsb-build-base2: usr/include/lsb2/security/pam_appl.h
lsb-build-base3: usr/include/lsb3/security/pam_appl.h
pauls@voltaire:~/code/eget/all/pam$

It seems like I should install libpam0g-dev

pauls@voltaire:~/code/eget/all/pam$ su -
voltaire:~# apt-get install libpam0g-dev
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed
  libpam0g-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 118kB of archives.
After unpacking 365kB of additional disk space will be used.
Get: 1 https://merkel.debian.org unstable/main libpam0g-dev 0.79-4 [118kB]
Fetched 118kB in 2s (47.9kB/s)
Selecting previously deselected package libpam0g-dev.
(Reading database … 123647 files and directories currently installed.)
Unpacking libpam0g-dev (from …/libpam0g-dev_0.79-4_i386.deb) …
Setting up libpam0g-dev (0.79-4) …
voltaire:~#logout

let’s try to compile again:

pauls@voltaire:~/code/eget/all/pam$ make
gcc  pamexample.c  -o pamexample -lpam -lpam_misc
pauls@voltaire:~/code/eget/all/pam$

It works!

Posted in Debian, Ubuntu | 5 Comments »

pypar2: a par2 graphical frontend

January 21st, 2007 edited by lucas

Entry submitted by François Ingelrest. DPOTD needs your help, please contribute !

Do you often download some binary content from Usenet servers? Then you know what .par2 files are useful for, and that there is no decent GUI to handle them.

For those who don’t know par2, let’s make it simple: it’s an utility used to protect files against data loss. It’s able to do that by creating redundant data (“parity files”). For example, if you create parity files with a redundancy level of 5%, you may be able to recover your original files if the amount of corrupted data is less than 5% (corrupted data may be located anywhere in any files). Such parity files may be used whenever data loss is expected: Usenet servers, cheap CD/DVD ROMs…

To check/repair some files, or to create these parity files, you have to open a terminal and use the command line. This works flawlessly but this not really user friendly, especially for distributions aimed at human beings. There exists a replacement named gpar2, but it uses some extra libraries and I’m sure that many of you don’t like to install extra libraries when it’s not really needed.

PyPar2 is a simple graphical frontend, written in Python: thus even if a package is not available for you system, you don’t have to compile anything. Here is how it looks like:

PyPar2 is designed to be very easy to use. Here are a list of its features:

  • Advanced settings are available, but hidden by default
  • There is no preferences dialog, all selected options are automatically saved and restored
  • Multiple languages are available:
    • English
    • French
    • German
    • Polish

PyPar2 is available in Debian unstable/testing and Ubuntu Feisty repositories. The “final” 1.0 release is coming soon, with many code changes, so stay tuned! If you would like to add support for a new language, please contact me first at Athropos - AT - gmail - DOT - com to be sure to use the latest language definition.

Links:

Posted in Debian, Ubuntu | 1 Comment »

rlwrap: use readline’s line editing with all applications

January 17th, 2007 edited by lucas

Entry submitted by arno. DPOTD needs your help, please contribute !

Many command-line-oriented applications don’t provide features like history, completion or line-editing. rlwrap wraps readline (which is the library behind those features in bash and many other applications) around any line-oriented command. So you can take advantage of history, completion and editing facilities, even with applications that don’t provide them. rlwrap is the kind of tool that, once discovered, makes you wonder how you could have lived without it.

For example, telnet or netcat don’t have editing facilities, neither history. With rlwrap, system administrators will then be able to use those tools more efficiently. Also, launching dash can sometimes help testing compatibility for a few lines of shell code. Unfortunately, line editing with dash is not very pleasant. With rlwrap, it becomes possible to have completion and history in dash.

By default, history is saved in a specific file for each program: your history will be kept even after exiting the program, and will not conflict with other apps.

Just as readline, you can customize rlwrap with ~/.inputrc file. You can also define, for each application, a list of keywords. rlwrap will then perform completion on those words.

With socat, you can also wrap readline around any program. Socat is much more than a readline wrapper: using it only for that purpose would be not only overkill, but also more complex. Another readline wrapper is cle (Command Line Editor). It’s a great tool, but it has not been developed since 1999. Rlwrap is now more powerful, providing more options, with more configuration capabilities.

Target Usages:

Users of applications such as netcat, telnet, dc, that don’t link with readline, and whose editing possibilities are limited.

Tip:

If your shell supports it, you may find useful to define aliases for commands you often use ; for example: alias netcat="rlwrap netcat".

You can find rlwrap’s homepage at https://utopia.knoware.nl/~hlub/uck/rlwrap/

rlwrap is available in Debian (0.21-1 in sarge, 0.28-2 in unstable) and Ubuntu (0.24-1 in dapper and edgy).

Posted in Debian, Ubuntu | 6 Comments »

« Previous Entries