Tuesday, July 6, 2010

Using procmail with postfix to filter mail

Look in /etc/postfix/main.cf
Look for this line ( change to this ):


mailbox_transport = procmail
mailbox_command = /usr/bin/procmail -t -a "$EXTENSION"

Create/Edit ~/.procmailrc


PATH=$PATH:/bin/:/procmail/bin:/usr/bin:$HOME/procmail/bin
SHELL=/bin/bash
DEFAULT=/var/mail/prm
MAILDIR=$HOME/
LOGFILE=$HOME/procmail/log/procmail.log
:0:
*
| $HOME/procmail/bin/poster.sh

Monday, July 5, 2010

Equivalent print_r in PHP -> Ruby

For PHP developer just enter the Ruby on Rails world.

To debug an array[PHP] we use print_r($array_name):

In Ruby on Rails, we can use :: <%= debug you_object_name %> in the view.

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...