Applying Security patches in RedHat

Since RHEL 5.1 Redhat introduced yum-security package which can be used to limit yum to retrieve only security-related updates. To install it execute:

yum install yum-security

Related Commands:

yum list-sec

yum update –security

More information in Red Hat Magazine: Tips and tricks: yum-security

Advertisements

October 23, 2008 at 2:55 pm Leave a comment

How to force users to change their passwords upon first login?

# usermod -L <username>
# chage -d 0 <username>
# usermod -U <username>

September 24, 2008 at 8:27 am Leave a comment

How to turn off checksum offload?

Under linux, check the status of offload parameters for the interface (eth0):

ethtool -k eth0

Then turn off tx-checksumming by:

ethtool -K eth0 tx off

Refer to man page of ethtool for more.

June 30, 2008 at 12:08 pm Leave a comment

Timestamp in history command

To put time stamp against every command logged in history file on linux host add the following line to your .bashrc file:

export HISTTIMEFORMAT=”%D %T “

June 20, 2008 at 11:00 am Leave a comment

Displaying HTTP headers

Lynx command to display HTTP headers sent by the web server:

lynx -head -dump “http://www.securelinx.com&#8221;

HTTP/1.1 200 OK
Date: Wed, 28 May 2008 10:12:29 GMT
Server: Apache
X-Powered-By: PHP/5.1.2
Set-Cookie: SESSe0d93dfb6a1ebb5228864233b3ee2c1f=qss7chjfhg49jvmbhucsvlbgu5; ex
pires=Fri, 20 Jun 2008 13:45:50 GMT; path=/; domain=.securelinx.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Wed, 28 May 2008 10:12:30 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8

May 28, 2008 at 10:15 am Leave a comment

How do I make the vi editor display or hide line numbers?

To make vi display line numbers, you need to set the number flag. To do so:

  1. Press the Esc key if you are currently in insert or append mode.
  2. Press : (the colon). The cursor should reappear at the lower left corner of the screen next to a : prompt.
  3. Enter the following command:
    set number
  4. A column of sequential line numbers will then appear at the left side of the screen. Each line number references the text located directly to the right.

To turn off line numbering, again follow the preceding instructions, except this time enter the following line at the : prompt:
set nonumber

May 20, 2008 at 10:57 am Leave a comment

Checking mail queue

Little script that will check the size of the mail queue and restart cyrus service if it grows over 60 mail messages.
I have to use it on one of the customer servers while investigating why cyrus hangs ocassionally:

#!/usr/bin/perl

#Get number of messages in mail queue.
open DATA, "mailq |grep Requests |" or die "Couldn't execute program: $!";

while ( defined( my $line = ) ) {
chomp($line);
@a = split(/ /, $line);
print $a[4] . "\n";
unless ($a[4] < 60) {
#Restart Cyrus
open CYRUS, "| rccyrus restart" or die "Couldn't execute program: $!";
}
}
close DATA;
close CYRUS;

Once written the script can be scheduled with cron to run periodically.
Meanwhile I have some breathing space to investigate why cyrus stops working.

I am seeing the following errors in /var/log/messages
:

May 16 09:12:30 galactica lmtpd[15608]: DBERROR db4: 60 lockers
May 16 09:12:30 galactica lmtpd[15645]: DBERROR db4: 60 lockers
May 16 09:12:30 galactica lmtpd[15645]: DBERROR db4: 60 lockers
May 16 09:12:31 galactica lmtpd[15635]: DBERROR db4: 60 lockers
May 16 09:12:31 galactica lmtpd[15640]: accepted connection
May 16 09:12:31 galactica lmtpd[15640]: lmtp connection preauth’d as postman
May 16 09:12:31 galactica lmtpd[15640]: DBERROR db4: 60 lockers
May 16 09:12:31 galactica lmtpd[15701]: accepted connection
May 16 09:12:31 galactica lmtpd[15701]: lmtp connection preauth’d as postman
May 16 09:12:31 galactica lmtpd[15730]: mystore: starting txn 2147484605
May 16 09:12:31 galactica lmtpd[15730]: DBERROR db4: 61 lockers
May 16 09:12:32 galactica lmtpd[15701]: DBERROR db4: 61 lockers
May 16 09:12:32 galactica last message repeated 2 times

I will appreciate if somebody has any idea what’s wrong.

May 16, 2008 at 11:50 am Leave a comment

Older Posts Newer Posts


Recent Posts

Categories