Archive for January, 2008

Retrieving information from an SSL Certificate ( Using openssl command line)

January 25, 2008

Assume that cert.pem is the cert you have as a text file.

>> who issued the cert?
openssl x509 -noout -in cert.pem -issuer

>> to whom was it issued?
openssl x509 -noout -in cert.pem -subject
>> for what dates is it valid?
openssl x509 -noout -in cert.pem -dates

>> the above, all at once
openssl x509 -noout -in cert.pem -issuer -subject -dates

>> what is its hash value?
openssl x509 -noout -in cert.pem -hash

>> what is its MD5 fingerprint?
openssl x509 -noout -in cert.pem -fingerprint

Encrypt a file from command line using gpg

January 22, 2008

To encrypt a file

$gpg -c filename

To Decrypt file

$gpg file.gpg

no such job

January 22, 2008

$ %blow
bash: fg: %blow: no such job

cPanel :: Maximum number of connections to IMAP server from any particular IP

January 22, 2008

Maximum number of connections to IMAP server from any particular IP is set
at /usr/lib/courier-imap/etc/imapd

Check the following parameters:

MAXPERIP
MAXDAEMONS

Once you have made any changes you need to restart imapd.

Checking if the SSL certificate and RSA private key matches from command line

January 22, 2008

Here are two commands which you need to run from the console to check .key and .crt files

#openssl rsa -noout -text -in http://www.domainname.com.key
#openssl x509 -noout -text -in http://www.domainname.com.crt

Check for modulus part in the output of both commands

If the modulus output match, then your .crt and .key files are matching.

Change the ownership of files in public_html to user.user in a cpanel server

January 22, 2008

A rather crude one, need to customize further ..

#!/bin/bash
cd /var/cpanel/users
for user in *
do
chown -R $user.$user /home/$user/public_html/*
done

ps:I didn’t write this script. I dunno if uit would work for you. šŸ˜›

January 17, 2008

Feedjit Live Website Statistics

Horde error : Warning: send(Net/SMTP.php) [function.send]: failed to open stream: No such file or directory in /usr/local/lib/php/Mail/smtp.php

January 16, 2008

Horde was displaying the following error when trying to send emails.

===
Warning: send(Net/SMTP.php) [function.send]: failed to open stream: No such file or directory in /usr/local/lib/php/Mail/smtp.php on line 206

Warning: send() [function.include]: Failed opening ‘Net/SMTP.php’ for inclusion (include_path=’/usr/local/cpanel/base/horde/lib:.:/usr/lib/php:/usr/local/lib/php’) in /usr/local/lib/php/Mail/smtp.php on line 206

===

#pear install Net_SMTP

fixed the issue for me.

exiqgrep exit with error “Line mismatch”

January 16, 2008

Sometime exiqgrep exit with error Line mismatch when you try to remove emails with the -Mrm option

#exiqgrep -o 604800
Line mismatch: 170d 1IGLxw-0004Tw-Ne

You can remove the particular entry that errors out as follows.

# exim -bpru | grep ā€œ170dā€ | awk ā€˜{print $2}ā€™
1IGLxw-0004Tw-Ne
1IGTFn-0000VM-UI
#exim -bpru | grep ā€œ170dā€ | awk ā€˜{print $2}ā€™ | xargs -n 1 -P 20 exim -Mrm

You will see something like,

ā€“
Spool data file for 1IGLxw-0004Tw-Ne does not exist
Spool data file for 1IGTFn-0000VM-UI does not exist
Continuing, to ensure all files removed
Continuing, to ensure all files removed
Message 1IGTFn-0000VM-UI has been removed or did not exist
Message 1IGLxw-0004Tw-Ne has been removed or did not exist
ā€“
Nevermind, those messages should be removed now šŸ™‚

Repeat the process until all the mal-formated entries are removed.

Did that work for you ?

Fatal error: Unknown function: eaccelerator_get() in somefile

January 15, 2008

eAccelerator_get and eAccelerator_put functions are now disabled by default. These functions have been disabled because when leaving them on without any precautions these functions can be used for a local DoS attack by keep putting data in shared memory.

Please refer: http://eaccelerator.net/ticket/37

You can, if you iesh to, enable it is configure with the following attribute

--with-eaccelerator-shared-memory

Installation.
————


export PHP_PREFIX="/usr"

$PHP_PREFIX/bin/phpize

./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config --with-eaccelerator-shared-memory

make

make install