April 28, 2006

daemontools install script

Filed under: Linux — Administrator @ 11:56 am

If you are fan of DJB’s daemontools & you are using Redhat/Fedora/CentOS, then the following script with come handy every time you want to install daemontools:

#!/bin/sh
mkdir /package
chmod 1755 /package
cd /package
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
tar xzvf daemontools-0.76.tar.gz
rm -f daemontools-0.76.tar.gz
cd admin/daemontools-0.76/src
wget http://www.qmailrocks.org/downloads/patches/daemontools-0.76.errno.patch
patch < daemontools-0.76.errno.patch
cd ../
./package/install

Convert Unix Time to normal date/time on the fly.

Filed under: Linux — Administrator @ 11:28 am

Ever wanted to find out something from a log that saves the time as Unix time and get frustrated to convert that time, use this:

cat /path/to/log/file |/usr/bin/perl -pe ’s/\d+/localtime $&/e;’

This will save your day. :)

April 3, 2006

Want to test SMTP AUTH with telnet?

Filed under: Linux — Administrator @ 5:08 pm

Find your base64-encoded userid/password:

perl -MMIME::Base64 -e ‘print encode_base64(”\000zia\@do-not-spam.org\000not.my.real.password”)’
AHppYUBkby1ub3Qtc3BhbS5vcmcAbm90Lm15LnJlYWwucGFzc3dvcmQ=

Then try it this way:

# telnet 127.0.0.1 25
Trying 127.0.0.1…
Connected to 127.0.0.1.
Escape character is ‘^]’.
220 localhost.localdomain ESMTP Postfix (Ubuntu)
ehlo localhost
250-localhost.localdomain
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-AUTH LOGIN CRAM-MD5 PLAIN
250-STARTTLS
250-PIPELINING
250 8BITMIME
auth login
AHppYUBkby1ub3Qtc3BhbS5vcmcAbm90Lm15LnJlYWwucGFzc3dvcmQ=
535 ok, go ahead (#5.0.0)
mail from:
250 2.1.0
… Sender ok
rcpt to:

250 2.1.5
… Recipient ok
data
354 Enter mail, end with “.” on a line by itself
hello.
.
250 2.0.0 k3395vQp002920 Message accepted for delivery
quit
221 2.0.0 localhost.localdomain closing connection

Proudly powered by wordpress - Theme by neuro