Archive for February, 2004

genlop, Gentoo log parser

Friday, February 27th, 2004

Thanks to Collin Starkweather I’ve discovered a nice utility in the Portage application tool suite: it is the genlop utility, a log parser for the emerge.log file.

As you probably know, emerge, the interface to Portage, logs its activity to /var/log/emerge.log. In some occasions it’s very interesting to watch the activity of the packages you’ve merged or unmerged.

The genlop utility provides useful information:

For example try this to see Apache’s emerge historical info:

genlop -u apache

Calculate merge time for Apache

genlop -f /var/log/emerge.log -t apache

Show full emerge history:

genlop -l

Note that genlog by default assumes that emerge.log is located in /var/log. If not, provide the full path: -f /path/to/emerge.log

To get usage info simply type:

genlop

FreeBSD 5.2.1 release Announced

Friday, February 27th, 2004

FreeBSD announces the availability of FreeBSD 5.2.1-RELEASE. From the official website…

This is a ‘point release’ and is intended to address several bugs and vulnerabilities discovered in the FreeBSD 5.2 release. These include.

* Significantly improved ATA/IDE and SATA handling. Problems with timeouts, error recovery, and certain master/slave configurations have been largely addressed.
* The kdeadmin3 package has been updated to fix the password database corruption found with the KUser tool.
* Third-party NSS modules can now support groups with many users.
* Multicast and promiscuous modes have been fixed in the 'sk' Ethernet driver, allowing it to operate in a DHCP environment.
* Latest updates to the XFree86 4.3 server to protect against several published security vulnerabilities.
.....

More information at FreeBSD site.

qpkg, the Gentoo query package tool

Sunday, February 22nd, 2004

The qpkg utlity is part of the Gentoo’s Gentoolkit administration scripts. qpkg allows you to manage the packages installed on your box. This tip will show you how to achieve common tasks using this utility.

(more…)

Checking the integrity of your files

Sunday, February 8th, 2004

MD5 is an algorithm developed by Ronald Rivest and is used to verify data integrity. It creates a 128 bit message digest from a file input that is unique, some kind of fingerprint for humans.

When you want to check the integrity of a file you have downloaded or you want to ensure the integrity of critical files on your system, MD5 will come in handy. The GNU coreutils package provides md5sum, a tool to compute and check MD5 message digest.

md5sum filename

And now that you know the checksum of filename, if any part of the file has been changed the md5 checksum will be different.

References:

Deleting files securely

Sunday, February 8th, 2004

Files removed with rm remain on the disk until they are overwritten by other file or files. If you try to recover a file immediately after removal, you have higher probability of success. There are also foresinc tecniques to recover deleted files.

The GNU coreutils contains a tool that allows secure file deletion: shred. To delete a file with shred simply type:

shred -vzu filename

This will overwrite the file repeatedly and thus making it harder to recover.

Identifying the process that served a request

Sunday, February 1st, 2004

In some situations it is very useful to know what request was processed by a given PID (process id) in your Apache box to identify undesirable behaviour such as too memory usage, CPU load, etc.

Apache can log the process ID of the child that serviced a request. It’s very easy. Simply edit your httpd.conf configuration file and add or modify the following:

LogFormat “%h %l %u %t %P “%r” %>s %b “%{Referer}i” “%{User-Agent}i”" combined

Then tell Apache to reload the configuration file:

/etc/init.d/apache reload

Note the %P directive in the format string, which is replaced in the log file by the value of the process ID that processes the request.
References: