section_logo

Signs

23-02-2009 at 19:11:40 | 1 comment
Really nice short film about communication and love :)

23-02-2009 at 19:11:40 | 1 comment

Easy way to send mails with attachments on Linux

22-01-2009 at 19:33:13 | 1 comment

At job usually I need to create scripts to send mail with logs for example while creating a backup. After looking for some email clients I found Mutt that looked really easy to use and to install. First of all you should now that Mutt it's a Mail User Agent (MUA) it means you should have already one Mail transfer agent (MTA) installed correctly (To let Mutt use the sendmail command). So there we go..., first we install like usually:

$ sudo apt-get install mutt

The most configuration changes that we would make is to change the default mail to show while sending the mails, as by default it will show the name of our server. This can be edit in the file /etc/mutt/Muttrc:

$ sudo nano /etc/mutt/Muttrc

And we add the following lines:

set realname="Username to show"
set from="username@host"
set use_from=yes

If you want to use this service with different users in the same server, you should create a copy of the configuration file for each user as following:

$ cp /etc/mutt/Muttrc ~/.muttrc

We're ready to send our first test:

mutt -s "Test mail" -a /srv/test.tgz destination@testmail.com < /tmp/mailmessage.txt

If everything works good we can start to use it into our bash scripts for monitoring tasks such as backups. Here a small piece of script that I use in my backups:

destMail=destinationMail@destinationDomain.com

attachment=/srv/scripts/backup.log

dateFormat=$(date +"%a, %e/%m/%Y %T")
subject="Backup server ($dateFormat)"

mailcontent=$(cat < /srv/scripts/msg.tmp
echo >> /srv/scripts/msg.tmp

mutt -s "$subject" -a "$attachment" "$destMail" < /srv/scripts/msg.tmp
rm /srv/scripts/msg.tmp
22-01-2009 at 19:33:13 | 1 comment

calendar template 2009

03-01-2009 at 15:44:14 | no comments
I've just finished a calendar for 2009. I've included both, complete calendar in PNG files and PSD template so you can modify it and make your own design.


You can grab it here
03-01-2009 at 15:44:14 | no comments