Nov 30 2008

Zimbra smtp relay through smart host smtp-auth

Tag:tepezcuintle @ 23:31

I was running my old mail server with sendmail, cubemail, dovecot IMAP and had a separate web calendar to store events. I recently bought a new machine where I am running a bunch of virtual machines and I setup one of the virtual machines as my zimbra server.

I got the server up and running but gmail and yahoo would not accept my email since it came from a home ip address. On my old server I was relaying my mail using my ISP. I remember I had to use smtp-auth with my provider but the instructions that worked with sendmail do no apply to Zimbra.

I also followed some instruction for postfix but they didn’t work either so I found this guide on the zimbra wiki. I followed it and everything worked fine :)

I am saving it here if I should ever migrate the server or for future reference.
Continua”Zimbra smtp relay through smart host smtp-auth”


Nov 24 2008

Viewing Current PostgreSQL queries

Tag:tepezcuintle @ 20:13

An important tool for debugging PostgreSQL performance issues is the ability to view all the currently executing queries. Thankfully this is easy to do. Read on for how.

Configuration
Storing of query strings is usually disabled in PostgreSQL by default. To enable it, use this line in your postgresql.conf
Continua”Viewing Current PostgreSQL queries”


Nov 21 2008

Troubleshoot with the lsof command

Tag:tepezcuintle @ 17:29

The Lsof Command is a great tool to troubleshoot your linux box. Check out these instructions that have saved me in the past

Problem:

You have a service that cannot bind to a port and the only message you have in log files is ‘port already in use’ or you have a need to find out exactly what processes are currently manipulating your server and what files they are affecting.

Continua”Troubleshoot with the lsof command”


Nov 14 2008

Turn off SE Linux

Tag:tepezcuintle @ 20:37

But SELinux can sometimes get
in your way. For example, I have had typical services, such as Apache, appear
to start up correctly, but remain inaccessible from the outside world because
I forgot to allow the apache user rights to open that port or maybe my distro
forgot about it. Before you turn off SELinux make sure you know why
you are turning it off and the security concerns you might be opening yourself
up to.

Continua”Turn off SE Linux”


Nov 10 2008

Removing ^M Characters from your Unix Text Files

Tag:tepezcuintle @ 15:24

The files you just uploaded to your server are a mess. The original author used a Windows machine and now they all look like this:

#header div {^M
padding-top: 50px;^M
}^M
#header div a {^M
font-size: 24px;^M
color: #fdfdfd;^M
font-weight: bold;^M

…and so on. If you’re like me you’ve found a few hundred Perl scripts to do this. I don’t know why, but I was never a fan of that method. So without further ado, I would like to introduce you to another candidate: the “tr” command, or the translate command. tr takes characters from the standard input stream, processes them, and the writes to the standard output. This means we can use all our favorite Linux/BSD command and just pipe and redirect our way to results.

Using tr’s -d (delete) option we can simply tell tr that we’re wishing to delete any occurrence of “\r” which is being displayed as ^M in your files. Here’s the super-simple command, using our old friend cat:

# cat file | tr -d "\r" > newfile

So have fun, and remember, if you’re sending these files up using FTP you can skip this step by doing an ASCII upload instead of a binary upload.