WordPress HE IPv4 Exhaustion Counter Plugin

I've just create/modify small wrapper wordpress plugin for hurricane electric's ipv4 exhaustion counter widget. It's base on ipv4 exhaustion widget create by  GeertHauwaerts (create for IPv4 Exhaustion Counter made by Intec NetCore, Inc.) Installations Download the .zip package from here Upload it to your server and place the .zip file…

Postfix smtp outgoing load balancing

I got good workaround for balancing smtp outgoing from postfix mailing list archives(not using expensive real load balancer). suppose we have 4 smtp servers for outgoing email, and we need to configure/load balance like this:

                                                         +------------+
                                                         |            |
                    +----------> smtp backend a -------->|            |
                    |                                    |            |
clients --------> smtp lb -----> smtp backend b -------->|  Intenet   |
                    |                                    |            |
                    +----------> smtp backend c -------->|            |
                                                         |            |
                                                         +------------+

Here’s the configuration :

Sumatera shaken by earthquake

A strong earthquake measuring 7.6 on the Richter scale rocked Sumatra at 5.16 pm Western Indonesian Standard Time.The earthquake occurred at 5.16 pm with its epicenter in West Sumatra at 0.84 degrees southern latitude, 99.65 degrees eastern longitude at a depth of 71 km below sea level.It was about 78…

gethostbyname() vs getaddrinfo()

In IPv4 environment(usually) we used to call function gethostbyname() to do DNS lookups.then the information is load into a struct hostent.

#include <netdb.h>
struct hostent *gethostbyname(const char *name);

struct  hostent {
        char    *h_name;        /* official name of host */
        char    **h_aliases;    /* alias list */
        int     h_addrtype;     /* host address type */
        int     h_length;       /* length of address */
        char    **h_addr_list;  /* list of addresses from name server */
};
#define h_addr  h_addr_list[0]  /* address, for backward compatibility */

So, the easiest way to get information from gethostbyname() call is by extracting hostent structure.

Using VIM as stream editor

Every person associated with the unix / linux would be familiar with the text editor called vi / vim. but not many people know that vi / vim can be used as a stream editor. This is one example of how to use vi / vim as a text editor.…

vmware ESXi 4 + centos 5.3 guest OS + zimbra

I’ve been playing around with Zimbra opensource edition on my development server. Zimbra is a full-featured, open source collaboration suite forĀ  email, group calendaring, contacts, and web document management and authoring. web interface is equipped with AJAX and it is compatible with clients such as Outlook, Apple Mail, and Novell Evolution so that mail, contacts, and calendar items can be synchronised from these to the ZCS server. It also can be synchronized to many mobile devices. ZCS makes use of many existing open source projects such as Postfix, MySQL, and OpenLDAP.

In this experiment i was using Zimbra 64bit_x86 opensource edition

DNs setting

mail.domain.tld.        A    192.168.1.2
domain.tld.             MX   10    mail.domain.tld.

Download the installer

# wget http://h.yimg.com/lo/downloads/6.0.1_GA/zcs-6.0.1_GA_1816.RHEL5_64.20090911174852.tgz

Extract the installer tarball, make sure we have enough space.

# tar xvzf  6.0.1_GA/zcs-6.0.1_GA_1816.RHEL5_64.20090911174852.tgz
# cd zcs-6.0.1_GA_1816.RHEL5_64.20090911174852

Querying Visitor IP address

There are many ways, scripting/language to obtain remote IP address of the user who is browsing our website.

PERL

#!/usr/bin/perl
use CGI;
print "Content-type: text/plain; charset=iso-8859-1\n\n";
my $q = new CGI;
print "<b>Your Remote IP Address :" . $q->remote_host() . "</b>";

PHP

<?php
echo "<b>Your Remote IP Address :" . $_SERVER['REMOTE_ADDR'] . "</b>";
?>

Setup Google Apps For your Personal eMail

I was realy surprised on how easy it was to set up hosting using google apps. Fisrt of all, all we need is just go here and fill out the application.

if you’re using it for family, private user or non-profit organisation google apps is freely to use. Of course we can Upgrade to Google Apps Premier Edition for bigger storage at 25 GB per user.

The first step of the application is to enter your domain name, if you already have one. Or you can buy a new domain name through Google which automatically sets everything up for you.

 

Securing MySQL traffic with stunnel

To encrypt a connection between a mysql client and a mysql server, run two instances of stunnel, one on client site and other on MySQL remote site

Here’s steps how to do it

# wget http://www.stunnel.org/download/stunnel/src/stunnel-4.27.tar.gz
# rpmbuild -ta stunnel-4.27.tar.gz
# rpm -ivh /usr/src/redhat/RPMS/stunnel-4.27-1.i386.rpm

Create stunnel.pem cert on server site

# openssl genrsa -out privkey.pem 2048
# openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095
# cat privkey.pem cacert.pem >> /etc/stunnel/stunnel.pem

Set the proper permissions on the resulting private key:

# chmod 0400 /etc/stunnel/stunnel.pem

Set the proper ownership of the stunnel chroot dir

# chown nobody:nobody /var/run/stunnel