Skip to main content

Posts

Showing posts from October, 2016

path to lines

Convert PATH to lines in order to grep I want to regexp check if a path is in my PATH environment variable. There are many ways to achieve this, but this one is the one I want to show you today: # echo $PATH | awk '{gsub(":","\n",$0); print $0;}' /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /var/cfengine/bin I can then "grep" what I want from this.

exim all mail catcher

All mail catcher with Exim 4, on Debian 8 We have un bunch of "development" VM that has the feature of sending a mail via a relay, or MTA.  We usually achieve this by setting the "mail host" setting in the used framework or CMS. But for development purpose, there is no need to really send the message over the Internet: if the "mail host" catches it all and delivers it to a mailbox, the work is done. Here is how to setup an Exim 4 on Debian 8 in order to make it catched all mail for all destination and always deliver it to a single local mailbox. That signel local mailbox can then be accessed via IMAP so that the development team can check if the message has been sent by the application. Configuring with "debconf" The first stage of configuration is done with debconf # dpkg-reconfigure exim4-config Then choose the following answers: Internet site; mail is sent and received directly using SMTP System mail name: (put