CyberTek - the future at the present!
Google

Archive for September, 2008

Use the command rpm

Posted by: admin (Sep 12)

Show all rpm packages installed:

# Rpm-qa

Run a query to the db rpm filtering all packets containing the string 'httpd':

# Rpm-qa | grep httpd

Obtain information on a specific package installed, example:

# Rpm-qi httpd

Display the list of files provided by a package installed, example:

# Rpm-ql httpd

See only the list of configuration files provided by an installed package:

# Rpm-qc httpd

Getting information on the documentation provided by a package:

# Rpm-qc httpd

Display the list of dependencies required by a package:

# Rpm-q httpd-whatrequires

Display capability provided by a package:

# Rpm-q httpd-whatprovides

Display scripts started during installation / removal:

# Rpm-q httpd-scripts

View the history of revisions of the package:

# Rpm-q httpd-changelog

Check to which package a file belongs:

# Rpm-qf / etc / httpd / conf / httpd.conf

Display the list of files provided by a package not yet installed:

# Rpm-qp httpd-2.0.52-3.i386.rpm-l


Fedora / RedHat, signing all packages with a digital private GPG key. To import the public-key using the following command:

# Rpm-import / media / cdrom / RPM-GPG-KEY

To verify the integrity of a package before proceeding with the installation, especially if it has been downloaded from the internet, run the next command:

# Rpm-nome_pacchetto.rpm checksig

To verify all packages installed on your system:

# Rpm-qa gpg-pubkey

Installing a binary package:

# Rpm-ivh nome_pacchetto.rpm

Installing a binary package ignoring dependencies required:

# Rpm-ivh-nodeeps nome_pacchetto.rpm

Installing a binary package using the automatic resolution of dependencies:

# Rpm-ivh-aid nome_pacchetto.rpm


Updating a package without changing the configuration file:

# Rpm-U nome_pacchetto.rpm

Updating a package only if it is already installed:

# Rpm-F nome_pacchetto.rpm

Rimuore rpm package:

# Rpm-e package_name


Check file size, permissions, type, owner, group, MD5 checksum and last modification on the RPM database:

# Rpm-V httpd

Check all packages installed on your system - use with caution, the system engages in an extreme

# Rpm-Va

Verify installed package:

# Rpm-Vp httpd-2.0.52-3.i386.rpm

This command allows you to extract the files from the package to be converted into a stream and then cpio to extract the executable from the package:

# Rpm2cpio httpd-2.0.52-3.i386.rpm | cpio-extract-make-directories * bin *

Installing a source package i386.

Step 1:

# Rpmbuild-rebuild nome_pacchetto.src.rpm

Step 2:

# Rpm-ivh / usr/src/redhat/RPMS/i386/nome_pacchetto.rpm

Installing a source package i386 (alternative procedure).

Step 1:

# Rpmbuild-recompile nome_pacchetto.src.rpm

Step 2:

# Rpmbuild-bb / usr / src / redhat / SPECS / nome_pacchetto.spec

Step 3:

# Rpm-ivh / usr/src/redhat/RPMS/i386/nome_pacchetto.rpm


Creating an rpm package from the source.
We want to create a package from source code example. Download the source from the internet with wget:

# Wget http://www.example.org/dl/example-2.0.0.tar.gz

# Cp example-2.0.0.tar.gz / usr / src / redhat / SOURCE

# Cd / usr / src / redhat / SOURCE

# Tar xzf example-2.0.0.tar.gz


Check if there is within the directory Unpack the file '. Spec', which contains the specifications for the creation of the track, and copy it in / usr / src / redhat / SPEC:

Example.spec # cp / usr / src / redhat / SPEC / example.spec

If the file. Spec does not exist can be created. Finally, prepare the filling for the creation of the new rpm:

# Cd / usr / src / redhat

# Rpmbuild-bb SPECS / snort.spec

Published in: linux, redhat, shell, tips

Rules for SpamAssassin

Posted by: admin (set 5)

A simple reporting of this site from which you can download the rules for its implementation of SpamAssassin:

http://www.rulesemporium.com/

Published in: opensource, tips

Maximum number of open files in Linux

Posted by: admin (set 4)

Linux systems usually have a preset limit of 1024 open files simultaneously. This limit is very low indeed in the case of machine with high working loads and in particular in the presence of web servers with many different domains and therefore pointers to files and logs.

When in production is reached and exceeded this limit are often problems of inconsistency strani. So it is better to act quickly. Knowing the process-id of our own application (eg tomcat or httpd) can then examine command with the number of files that this process takes open:

lsof-p [process-id] | wc-l

We understand the problem minimaliste can intervene with the ulimit command. Use the following commands to get information about the system:

ulimit-Ha

ulimit-Hs

Finally adjust the maximum value of opening the same files from Linux can enter:

ulimit-n 4000

Take a look also at the manpages for more info on the command and all its options:

man ulimit

Published in: linux, shell, tips
Powered by CyberTek - Remote Assistance