Monday 27 July 2015

Testing SMTP Server from the windows command line

C:\Users\Administrator>telnet 25

helo test
mail from:
250 sender <> ok
rcpt to:
250 recipient <> ok
354 go ahead
Hi How are you
250 ok:  Message 258249 accepted

Connection to host lost.

Ref :-

Sunday 26 July 2015

Nullifying a log file

Clear a file using /dev/null 

/dev/null is often referred to a black hole in Linux based systems. It discards all the data written to it and sends EOF (End of File) character to any process reading data from it. With this logic, we can clear the contents of a file.

cp /dev/null logfile

cat /dev/null > logfile

> logfile

dd if=/dev/null of=logfile

Clear a file using truncate

truncate logfile --size 0