Posts Tagged ‘Linux’

Setting up Symfony to use Exim instead of Sendmail

Sunday, February 1st, 2009 by The BCM Team

By default Symfony uses Sendmail mail transfer agent to prepare emails to be sent out by the system. If you want to use Exim instead,you need to:

  1. Install Exim to your system – please see my Exim on CentOs 4/5
  2. Configure Symfony to use Exim instead of SendmailEdit (or create if it does not exists) /apps/--app name--/config/mailer.yml and add the following to it:
    
    dev:
      deliver: on
      hostname: mail.yourmailhost.com
      port: 25
    all:
      mailer: exim
    

    Here we are setting Exim to be the default mail agent for all environments plus defining SMTP host name and port for the dev environment.

Useful Linux (CentOS) commands

Monday, January 19th, 2009 by The BCM Team

Show directories by size: du -sk * | sort +0nr

Install GeoIP on CentOS

Thursday, January 15th, 2009 by The BCM Team
  1. Install geoip via yum:
    
    yum install geoip geoip-devel
    
  2. You also might want to download database with ip addresses from Maxmind website and place it in /usr/share/GeoIP (which is a default location of geoip upon installation).
  3. Install PECL extension:
    
    pecl install geoip
    
  4. Add extension=geoip.so to your /etc/php.ini
  5. Restart apache:
    
    /etc/init.d/httpd restart
    

Your GNOME desktop suddenly reverted to TWM in CentOS 5

Wednesday, January 14th, 2009 by The BCM Team

Has your GNOME desktop suddenly reverted to TWM upon a regular restart? If so, you are’nt alone.

Here is what you need to do to restore your GNOME desktop:

  1. Check if you can just get away with switching back to GNOME:
    
    yum install switchdesk
    switchdesk gnome
    

    If that tells you that gnome is not installed then proceed to step 2, otherwise you should have gotten your GNOME back.

  2. We are going to reinstall GNOME. To do that we need to install one package manually (because of the bug in “nautilus-sendto” package which is a part of GNOME. It requires “libgaim.so.0″ library which is a part of gaim (that was replaced by Pidgin in the latest CentOS distribution). Therefore, this dependancy will fail when running yum. Download nautilus-sendto and install it:
    
    rpm -Uvh --nodeps nautilus-sendto-0.7-5.fc6.i386.rpm
    

    We can now install GNOME by running:

    
    yum groupinstall "GNOME Desktop Environment"
    

    Now run the command to switch desktops:

    
    switchdesk gnome
    

    and you should be good getting your GNOME back upon next restart of your xwindow session (Ctrl+Alt+Bcksp).

Ubuntu 8.10 Has Been Released

Thursday, October 30th, 2008 by The BCM Team

Ubuntu LogoWell, ladies and gentlemen, if you’re into Web Development, and just in case you haven’t heard yet, Ubuntu 8.10 has just been released.

We use Ubuntu as the OS for our development servers and work-horse desktops. We have been pretty happy with it – as it’s friendly, powerful and has a large and dedicated user-base.  What’s more it is based on Debian, meaning apt is the package manager (and that is something we certainly love).

I won’t go into to much detail about the release here, but I will say:

  • We were really impressed with the updated theme in this release. I know, I know, it’s just the look, but looks matter too, and it really does look great.
  • The new wireless and mobile networking manager is impressive and works well out-of-the-box.
  • 8.10 is not a release that will be supported in the long-term. This release will only be officially supported until 2010, whereas Ubuntu 8.04, will be supported until 2011.

If you are even the slightest bit interested in using a Linux OS, you should definitely take a look at Ubuntu. We did, and haven’t looked back – we’ve already updated our workstations to 8.10.

By the way, if you are already using the 8.10 Release Candidate, there is no need to download the final ISO. Just update to the final version as you normally would: either through command line “sudo apt-get … ” or the GUI’s Update Manager.

For more information, check out Ubuntu’s site

Useful SVN commands

Sunday, October 12th, 2008 by The BCM Team

Here is a list of the svn commands we find pretty useful:

  • Mark as “deleted” all files thats in the svn repo but missing on the disk:
    
    svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
    
    
  • Mark as “added” all files thats not in the svn repo but are on the disk:
    
    svn st|grep ^?|sed s/?//|xargs svn add $1
    
    

PS: You might want to consider adding commands above as aliases to save time typing or copy & pasting.

Configuring Exim under CentOS to send emails through an ISP’s SMTP server

Wednesday, October 1st, 2008 by The BCM Team

Edit your /etc/exim/exim.conf file

Add to Routers section


send_to_gateway:
driver = manualroute
transport = remote_smtp
route_list = * mail.optusnet.com.au

If your SMTP server requires authentication you also need to do this:

Add to Authentication section

  • Enable authentication for hosts host1.example.com, host2.example.net and host3.example.org (you have to list all smarthosts where Exim may authenticate users):
    
    remote_smtp:
      debug_print     = "T: remote_smtp for $local_part@$domain"
      driver = smtp
      hosts_try_auth  = host1.example.com:host2.example.net:host3.example.org
    
  • SMTP-Auth with the name “usera” and the password “secrect” (cram_md5 encrypted):
    
    cram_md5:
         driver = cram_md5
         public_name = CRAM-MD5
         client_name = usera
         client_secret = secrect
    
  • SMTP-Auth with the name “usera” and the password “secrect” (plaintext):
    
    plain:
         driver = plaintext
         public_name = PLAIN
         client_send = ^usera^secrect
    
  • Or get name, password and send method automatically from my config-file:
    
    cram_md5:
         driver = cram_md5
         public_name = CRAM-MD5
         client_name = "${extract{auth_name}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
         client_secret = "${extract{auth_pass}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
    plain:
         driver = plaintext
         public_name = PLAIN
         client_send = "${extract{auth_plain}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
    

Add to Transports section


remote_smtp:
  debug_print     = "T: remote_smtp for $local_part@$domain"
  driver = smtp
  hosts_try_auth  = your.smtp.server.com

More information on this topic can be found at http://www.tgunkel.de/docs/exim_smarthosts.en

Exim on CentOs 4/5

Monday, September 29th, 2008 by The BCM Team

This is a quick guide (by jervis) on how to do an install and basic setup of exim on CentOS. This is not meant as a fully inclusive guide but it will get you on the way. Following this you should get a working exim install.

I will assume you have built a CentOS 4 / 5 Server, have yum working and have logged in as root.


yum update

Install exim and mail switching tools


yum install exim
yum install system-switch-mail

Switch your MTA & set exim to start on boot
system-switch-mail
service sendmail stop
service exim start
chkconfig exim on
chkconfig sendmail off

Add a root alias, eg:  “root: me@example.com”
vi /etc/aliases

You may also wish to add some config to your routers section like this, if you want to relay through a smart host.


vi /etc/exim/exim.conf

Then add this before the “dnslookup:” section.


to_smart_host:
driver = manualroute
domains = ! +local_domains
transport = remote_smtp
route_list = “* mail1.example.com:mail2.example.com;”


Restart exim
service exim restart

To test, send an email


echo “test” |mail -s “$HOSTNAME” me@example.com

Then you can flush the Exim Que and watch the log like this


exim -qff ; tail -f /var/log/exim/main.log

Good luck!

Installing FFmpeg on CentOS 5.x

Thursday, August 21st, 2008 by The BCM Team
  1. Configure RPMForge so the installation passes GPG key check. See RPMForge website for more details
  2. Create a new repo difinition with: nano -w /etc/yum.repos.d/dag.repo
  3. Insert the following into the newly created file:
    
    [dag]
    name=Dag RPM Repository for Red Hat Enterprise Linux
    baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
    gpgcheck=1
    enabled=1
    
    
  4. Install ffmpeg: yum install ffmpeg

List of useful CentOS commands

Sunday, May 25th, 2008 by The BCM Team

Below is a list of common commands in CentOS that I tend to forget:

Crontabs

  • "crontab -l" – list all crontabs
  • "crontab -e" – edit crontabs