Postfix with remote SMTP relay – Debian/Ubuntu

Hi folks and bots, this time I will show you how to configure posftix to authenticate with a external smtp server.

First, packages:
Remove exim and sendmail:

~# apt-get remove exim4
~# apt-get remove sendmail

Install postfix and cyrus-sasl
~# apt-get install postfix libgsasl7 libsasl2-2 libsasl2-modules chkconfig

Backup your main.cf
~# if [ -f /etc/postfix/main.cf ]; then cp -v /etc/postfix/main.cf /etc/postfix/main.cf.backup; fi

Dowload this main.cf or copy to your main.cf file:
~#vim /etc/postfix/main.cf

mydomain = local.domain
myhostname = host.local.domain
relayhost = yourisp.smtp.servername:25
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = smtpd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_type = cyrus
smtp_sasl_auth_enable = yes
smtp_cname_overrides_servername = no
smtp_sasl_security_options = noanonymous

Edit things like your domain and your smtp server and port.

Now, the auth:

~# vim /etc/postfix/sasl_passwd and insert this line (changing your data of course):
yourisp.smtp.servername:25 username:password

Then, postfix config:
~# postmap hash:/etc/postfix/sasl_passwd
~# postmap -q yourisp.smtp.servername:25 /etc/postfix/sasl_passwd
~# rm -rf /etc/postfix/sasl_passwd
~# chkconfig --add postfix
~# /etc/init.d/postfix start

Now, we need to test the mail:

~# sendmail email@example.com
Hello World!
.

Don’t forget that dot! It’s marking the end of the email.

That’s all, now you can send emails properly.

You can check the log if you have any problems:

~# tail -f /var/log/mail.log

Regards

First Python Day in Uruguay!

Yesterday was the first official Python event in Uruguay. I was very excited about this because I use python on my work.

The event was amazing, the organization made an excellent job! Hope we can make it the following year, and maybe who knows, have the first PyCon in Uruguay!

More info: python.org.uy
Twitter HashTag: #pydayuy2011

How to solve indexing problem on Spotlight – Mac

Cmd+Space, try to select an application, anddd ups! no application found.

If you are experiencing this problem on OSX you can try the following command on a terminal:


mdimport /Applications

With this, we reconstruct the Spotlight catalog.

Hope it helps.

OpenVPN Client on Mac OSX – Tunnelblick

Hi guys, this time I will show you how to connect to a OpenVPN server with a Mac OSX.

First you need to download Tunnelblick (Lastest Version 3.1.7)

Once you have your dmg, double click on it, and copy tunnelblick.app to your Application folder.

Then, we need to create a config.openvpn file, open your favorite text editor and use de following template:

# OpenVPN - MacOSX - Tunnelblick
# Sample configuration from: sebastianmoreno.com.uy
#
client
;Your Adapter, maybe you have *tap* adapter
dev tun
;The protocol, another value: *tcp*
proto udp
;Your remote OpenVPN server and port
remote XXX.XXX.XXX 1194
resolv-retry infinite
nobind
persist-key
persist-tun
;Change this to your certs and keys names
ca ca.crt
cert client.crt
key client.key
comp-lzo
verb 3

Ok, once you have tweaked this file with your custom configuration, save it on $HOME/Library/Application Support/Tunnelblick/Configurations

Also, you need to put your server ca.crt, your client key and cert on this folder too.

Then execute your tunnelblick app, this will create an icon near the spootlight, click on the portal icon and then connect!

Run shellscript without using system app – AGI – Asterisk

This time, I will show you how to run shellscripts from asterisk without using system app. This way, you can return values from your script and use it!

This is an example of extensions.conf


exten=> 1234,1,AGI(yourscript.sh)
exten=> 1234,2,NoOP(${result})

cat /var/lib/asterisk/agi-bin/yourscript.sh

This is a little example of supposed script:

#!/bin/sh
somelistdir=`ls /etc/asterisk/`
echo "SET VARIABLE result $somelistdir "

No application ‘agi’ for extension – Asterisk – AGI

Sometimes Asterisk AGI interface may not be available on a fresh asterisk build. The result here is that any calls to the agi application in your dialplan will die with an error similar to this:


-- Accepting AUTHENTICATED call from 200.xx.xxx.xx, requested format = 8, actual format = 8
-- Executing Answer("IAX2/1234@1234/2", "") in new stack
Mar 26 16:44:44 WARNING[10155]: pbx.c:1293 pbx_extension_helper: No application 'agi' for extension (iax-abc, 810202, 2)
-- Hungup 'IAX2/1234@1234/2'

We need to check if AGI is available on our build, try to run ‘show application agi’ at the asterisk cli.


-= Info about application 'AGI' =-

[Synopsis]
Executes an AGI compliant application

If you get something different to this you’re probably not loading the AGI module.

You can load temporaly, from asterisk cli:

CLI>load res_agi.so

Or you can load permanently adding a line to /etc/asterisk/modules.conf

load => res_agi.so

This will load your module from /usr/lib/asterisk/modules. You must restart your asterisk by typing ‘restart now’ at the asterisk CLI

CLI>restart now

Re-Run your CLI and check with ‘show applications’ that your have successfully your AGI application!
Your AGI script will run ok now.

How to play mp3 files on Fedora 15

Yay! If you are reading this, it’s because you make a fresh install of the new Fedora 15, then import your library music, open banshe/rhythmbox and no mp3 plugin detected, ok, click on search, but! nothing finded…Wow..what can I do now? I can’t live without my music!!!!

No worries, me too ;-)

First, we need to check if we have rpmfusion repository:

ls /etc/yum.repos.d/ | grep rpmfusion

If this command return something, you can skip the next step

Install rpmfusion:


su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

Install gstreamer plugins

sudo yum install gstreamer-plugins-bad gstreamer-ffmpeg -y

How to install Adobe Air on Fedora 14/15 – 64bits

Hi folks and bots,

This time I will show you how to install Adobe Air on Fedora 14/15. This wonderfull tool it’s really simple to install on others OS like Windows or OSX but on Linux it’s a little bit tricky.

First, we need to import this keys (Only for Fedora 15)

sudo rpm --import http://commondatastorage.googleapis.com/xenodecdn/RPM-GPG-KEY-rpmfusion-free-fedora-15

sudo rpm --import http://commondatastorage.googleapis.com/xenodecdn/RPM-GPG-KEY-rpmfusion-nonfree-fedora-15

Install rpm fusion

su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

Some Air dependencies

su -c 'yum -y install ld-linux.so.2 gtk2-devel.i686 libdbus-glib-1.so.2 libhal.so.1 rpm-devel.i686 libXt.so.6 gnome-keyring-devel.i686 libDCOP.so.4 libxml2-devel.i686 nss-devel.i686 libxslt.i686 xterm rpm-build'

Now, we need to download the Adobe Air binary. Get it!

Once downloaded, we need to grant execution permissions and run it!

chmod +x AdobeAIRInstaller.bin
./AdobeAIRInstaller.bin

Then we need to agree the licence terms, and give the root password for installation

Now we have this app to install .air applications:

/opt/Adobe\ AIR/Versions/1.0/Adobe\ AIR\ Application\ Installer

It’s necessary give to de Air installer the full path of your .air app.

I create an alias on my .bashrc to call the installer like this:

alias adobeair='/opt/Adobe\ AIR/Versions/1.0/Adobe\ AIR\ Application\ Installer'

That’s all! Enjoy your Adobe Airs Applications now!

How To install VMware Workstation/Player 7.1.3 on Archlinux

Hi folks, this time I will show you how to install VMware on Archlinux.

  • Check Pre-requisits:

sudo pacman -S base-devel kernel26-headers

cd Downloads
mkdir -p /etc/rc.d/vmware.d/{rc{0..6},init}.d
chmod +x VMware-<edition>-<version>.<release>.<architecture>.bundle
./VMware-<edition>-<version>.<release>.<architecture>.bundle –console –custom

  • Read and Accept the terms
  • Accept the default settings until it prompts for System service runlevels then set to:

/etc/rc.d/vmware.d/

  • For System Service Scripts set to:

/etc/rc.d

  • Then you need to install with all default settings
  • Once the installation is complete, with need to make some changes to the system:

ln -s /bin/lsmod /sbin/lsmod
cd /tmp

  • Now, we need to download a kernel patch:

wget http://sebastianmoreno.com.uy/wp-content/uploads/2011/02/vmware7.1.3-patch-kernel-2.6.37.sh
chmod +x vmware7.1.3-patch-kernel-2.6.37.sh
./vmware7.1.3-patch-kernel-2.6.37.sh
vmware-modconfig –console –install-all

Now, you can run vmware binary:

vmware

How To install Unity Desktop on Ubuntu 10.10

Ubuntu Logo

Hi folks, at this time I will explain how to install this quirky desktop. It will be the default desktop in the following Ubuntu’s releases

To install it, you need open a terminal, write one command and restart

sudo apt-get install unity libunity-dev

Then reboot your system and you will have a great desktop!
See ya!