Irlandais au Français.

August 20th, 2006 by admin

J’ai l’essai au changement de technicien “A” de ma vie pendant un moment maintenant. Enfin je pense que j’obtiens plus près de ce que je crois serai un mouvement postive pour me. Oui, c’est correct, se déplaçant en France.    

Ceux de toi qui me connaissent, savent que j’ai parlé l’abount ceci énormément. Je ne suis pas sûr pourquoi j’aime la France tellement, mais je sais que le posibility de moi allant finalement là s’approche. Une grande partie dû à mon employeur étant très libéral s’est occupée. Ils, si je peux la démontrer, me laisseront vivre et fonctionneront en France dans le cadre d’un contrat irlandais d’emploi, à condition que je puisse exécuter l’exact le même travail que maintenant.     Ceci ne devrait pas être un tel problème.

Ceci me permettra également au Français de étude de finsih correctement au lieu de compter sur les dictionnaires et le google pour faire ma traduction. Oui je sais que mon Français est terrible, très le mauvais, mais la seule manière je peut l’améliorer, est en vivant réellement là. Je ne peux pas vivre là sans revenu, tellement si tout va bien ceci aiderai surmonte ce situtation.    Peut-être une sortie bientôt… qui sait ? Mais je sais que je ne m’ennuierai pas de l’Irlande quand je. Je n’appartiens pas ici, ne m’adapte pas dans la boîte et jamais la volonté. Pas que je me tromperais et me penserais ferait ainsi en France, mais au moins je serai être plus confortable moi là.

Blogged with Flock

Pan Fried Venison Steak With Red Onion

April 23rd, 2006 by admin

So recently I discovered the joy of venison. I have to say, such a
fantastic  meat you will not find in any other animal. I am blessed with
the privilege of knowing a very good butcher, whom knows I cook the odd time
and he phoned me to say he had some beautiful wild venison. So with that I
decided this Sunday was going to be the day to try a new recipe for venison.
Being in with a good butcher is well worth it!

This is a very simple dish and just a variation on most venison recipes,
takes only a few moments to prepare and tastes sexy! 

WARNING: Due to the large amounts of butter this dish uses,
there may be health concerns. It is quite okay to eat this dish as part of a
balanced healthy diet, a little fat is okay I think, but I am not a
professional, go ask one if you have questions. 

WARNING: Cooking with alcohol is dangerous and can cause
fires. Do so at your own risk. If in doubt, don’t use it! 

 Ingredients

  • Nicely cut venison steaks
  • 2 Large Red onions
  • Potatoes
  • Irish Butter (Salted
    Butter)
  • Mixed herbs of own choice
  • Sweet Chilli Sauce
  • Irish or Spanish Whiskey
  • Soy sauce
  • Teriyaki sauce
  • Salt and pepper

 Method

  1. Season both sides of the
    venison steak.
  2. Gently and lovingly, place
    the steak in a bowel of sufficient size.
  3. Drizzle with soy sauce,
    about 3 tablespoons should be enough, but add what you like really here,
    its personal taste here.
  4. Add an equal amount of
    Teriyaki sauce
  5. Add one table spoon of chilli
    sauce
  6. At this point your venison
    steak sound be covered with the marinate, add some mixed herbs and ensure
    that the venison is well covered. Leave it now to stand at room temp for
    about an hour.
  7. Peel and boil the potatoes
    as you would normally about 10 min before you want to cool the venison
  8. Gently peel the onions, and
    slice thinly.
  9. Heat a large frying pan on
    maximum heat until a droplet of water placed upon it boils away instantly,
    i.e. VERY HOT
  10. Remove the frying pan and
    add a very generous knob of butter to the pan and watch it melt away, the
    butter should not burn, if it is add more.
  11. Add the whiskey; again the
    amount is up to you.
  12. Now place the pan back on
    the heat and reduce the heat by half,
  13. As the butter and whiskey
    fuse together add a further table spoon of chilli sauce. Be careful, too
    much will ruin the taste of the venison.
  14. Now ever so gently, place
    the venison on the pan, add a table spoon of the marinate along with it
    and discard the rest, or find another use for it!
  15. Add the onion to the pan
    and cook with the venison
  16. Cook for approx 7 min on
    each side, depending on the size of the steak.
  17. Cream the potatoes using
    only butter, trust me they are much nicer!
  18. Place potatoes on a plate
    and round off
  19. Gently place the steak onto
    the plate an spoon onion onto of the potatoes
  20. Drizzle frying pan juices
    and fats over the steak and onions and serve

Enjoy!

Recipe For A Prefect Omelette

April 22nd, 2006 by admin

Okay while not an overly complex recipe, its important to get this right. This recipe does not use any milk at all, furthermore, you can add anything you like to this, varity and all that is afterall the spice of life.

 

Ingredients

  • 2 Large Free Range Eggs
  • Fresh Mozzarella (Or soft chesse of your choice)
  • Tablespoon of olive oil
  • Cherry Tomatoes
  • Fresh Basil

Cooking 

  1. Beat the two eggs until they have blended fully with each other and form a nice consistant thick light yellow colour
  2. Add a pinch of salt
  3. Grate some mozzerella and add to the egg
  4. Chop some cherry tomatoes and add to the egg
  5. Chop the fresh basil and add to the egg.
  6. In an extremely hot pan, add the olive oil and swirl the pan around until the oil covers the base and the sides to prevent eggs from sticking.
  7. Add the egg mixture to the pan and lower the heat to 1/2 of what it was.
  8. As the omelette cooks, using your frying flip, perform a raking action once or twic on the egg mixture to bring all the solids into the middle of the pan.
  9. After a few min, the top of your omelett should be between at state of liquid and solid, now flip it over and cook for 30 more seconds.

Serve with fresh bread or best of all in a bap oe bagle.

 

 

technorati tags: , , ,

Building A Scalable Messaging Solution for PHP

April 20th, 2006 by admin

Sending notifications to web users is generally taken for granted when writing a PHP application. The excelent PHP mail function is generally used. But what happens when my site becomes popular. Does the mail function grow with my site? Or how about if I wanted to send more types of messages than a simple email. This little article explains how I am currently investigating how I could possibly scale up messaging a user in a web enviroment. A big warning first though, I am not a PHP expert, programmer even, and I am just learning about OOP and PHP and patterns, so please read this at your own risk.

My Problem
I am playing around with PHP at the moment to maybe build a website that *may* get a tad popular (hope is good!:) . My problem here is that I may have to scale the site very quickly and I want to advoid having to rewrite code as much as possible. I also am a big fan of the separation of services where possible. So a database should IMHO sit on a dedicated box, a web server just be a web server etc.

One of the important aspects of this site, is its notification to the user on the occurance of an event. This will initally be an email, but eventually I would like notifications to be delivered to the user via AIM, Google Talk (Or for that matter any Jabber user), Text message (SMS) and maybe even MSN Messenger. In short, whatever way I can get a notification to a user I want to be able to do it. However if the site is popular, do I want the server I am busy serving clients on to be under the burden of having to send mail at the same time, ideally it should not. Now I know the mail function can be used to send the mail to a dedicated mail server, but again I also want to be able to send other types of messages too.

My Solution
First off, I know that this as a solution will only scale so far. I am also aware that my code is really really bad here, but I have just started to play with all this OOP stuff in PHP5, so please any advice you can give me in improving my code, style and method of working, please do so. Of course a lot of error checking has gone out the window here for the purpose of this blog post, along with security too, this solution is presented as way you *may* be able to do things. Its not to be taken as an authorative way to do this.

Right, enough with the disclaimers, lets get cracking. After a wee while playing around and doing a little bit of searching, I decided the best way to implement all this was by heavy use of the new OOP features in PHP5 and using SOAP. The reason I choose SOAP was quite simply, I could direct my code to fire off a soap message faily easily to a SOAP service which could be on the same box (In which case you maybe get twice the overhead of sending a mail using the mail function) or as is most likley the case on another interally acessable box, dedicated to notifications only. So what I really needed at the end of the day, was a Messaging Abstraction layer. Something that would just handle the sending of a message and leave the app to get on with the rest of its processing.

Enter Interfaces

This is when I discovered Interfaces in PHP, below is a cut down version of my Messaging interface.


interface MessengerInterface {
public function validateSender($sender);
public function validateRecipient($recipient);
public function sendMessage ();
}

As you can see its very basic. All I want to do is validate my senders and recipients, and send my message. Nothing colud be simpler… right… :)

I now needed a class that would send an email, but it had to implement the above interface, otherwise what would the point be? So I ran up a rather nasty class to mange this.


class EmailMessenger extends Messenger implements MessengerInterface {

private $sender;
private $recipient;
private $subject;
private $message;
private $messageFormat;

/**
* Method constructor. Validates the recipients and sender and sends the message.
*
* @param string $sender
* @param string $recipient
* @param string $subject
* @param stringe $message
*/
public function __construct($sender, $recipient, $subject, $message) {
$this->sender = $sender;
$this->recipient = $recipient;
$this->message = $message;
// We need a subject for emails
if(!isset($subject)) {
throw new MessengerException("You need to specify a subject for this type of transport");
}
$this->subject = $subject;
// Set message format to true if the message contains HTML
$this->messageFormat = $this->isHtmlMessage($this->message);

// Now we validate the sender address.
self::validateSender($this->sender);
// Now the recipient
self::validateRecipient($this->recipient);
// Now we'll try and send the mail;
self::sendMessage();

}
public function validateSender($sender) {
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $sender)) {
throw new MessengerException("Invalid Email Sender Address Format: $sender");
return false;
}
return true;
}

public function validateRecipient($recipient) {
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $recipient)) {
throw new MessengerException("Invalid Email Recipient Address Format: $recipient");
return false;
}
return true;
}

public function sendMessage () {
// Supress an error in case we are on a win32 platform. The exception should handle the error.
if(!@mail("$this->recipient", "$this->subject","$this->message","From: $this->sender \r\n")) {
throw new MessengerException("Mail Server/Service Unavailable. Sorry I Unable To Send Mail At Present.");
return false;
}
return true;
}

/**
* Checks a message to see if it contains HTML tags.
*
* @param string $message
* @return bool True if message contains HTML false otherwise.
* @access private
*/
private function isHtmlMessage($sting) {
if(preg_match("/([\< ])([^\>]{1,})*([\>])/i", $string)) {

return true;
}
return false;
}
}

As you can see, all of the work is done when the class is called, I don’t think this is good pratice, but for the purpose of this, I am going to leave well enough alone. I also have made this class a “sub” class of my main Messenger class. The messenger class is where the magic happens, it basically decides what “sub” class should be called depending on the message format.


class Messenger {

/**
* The Senders Address
*
* @var string
*/
private $sender;
/**
* The Recipients Address
*
* @var String
*/
private $recipient;
/**
* The Message Being Seny
*
* @var string
*/
private $message;
/**
* The transport or format of sending the message
*
* @var string
*/
private $transport;

/**
* Contains an instance of our message transport.
*
* @var object
*/
private $messageTransport;

/**
* Contains the message subject if set.
*
* @var string
*/
private $subject;

/**
* Messenger construct, requires that the sender, recipient, message and transport be
* provided otherwise it throws a general MessengerException Error.
*
* @param string $sender The sender of the message.
* @param string $recipient The recipent of the message.
* @param string $message The message that is being sent.
* @param string $subject Optional, only used when sending a mail message.
* @param string $transport Optional, defaults to email
* @throws MessengerException
*/
public function __construct($sender, $recipient, $message, $subject=null, $transport = null) {
if(!$sender) {
throw new MessengerException("You did not specify a sender address.");
}
if(!$recipient) {
throw new MessengerException("You did not specify a recipent address.");
}
if(!$message) {
throw MessengerException("You did not specify a message to send.");
}
if(!$transport) {
throw new MessengerException("You did not specify a transport type.");
}
$this->sender = $sender;
$this->recipient = $recipient;
$this->message = $message;
// If subject is set.
if(isset($subject)) : $this->subject = $subject; endif;
// Convert the trasport argument to lower case. This is case we will pattern match
// on lower case only.
$this->transport = strtolower($transport);
// We'll set our types to be nice.
settype($this->sender, "string");
settype($this->recipient, "string");
settype($this->subject, "string");
settype($this->message, "string");
settype($this->transport, "string");

// Pattern Factory (I think)
switch ($this->transport) {
case "email":
require_once('EmailMessenger.class.php');
try {
$this->messageTransport = new EmailMessenger($this->sender, $this->recipient, $this->subject, $this->message);
}
// Catch the exception and save the message to the message queue if possible.
catch (MessengerException $e) {
require_once('MessageQueue.class.php');
try {
throw new MessengerException("Not Yet Implemented");
//MessageQueue::saveMessage($db, $this->sender, $this->recipient, $this->subject, $this->message, $this->transport);
}
catch (MessengerException $e) {
throw new MessengerException("$e->getMessage()");
}

}
break;
case "jabber":
require_once('JabberMessenger.class.php');
throw new MessengerException("Not Yet Implemented");
//$this->messageTransport = new JabberMessenger($this->sender, $this->recipient, $this->message);
break;
default:
/**
* @todo Can remove this prob, to make class more readable. Also we'll choose email as the default transport.
*/
require_once('EmailMessenger.class.php');
$this->messageTransport = new EmailMessenger($this->sender, $this->recipient, $this->subject, $this->message);
break;
}
}
}

Okay so here you can see, depending on the transport that is being requested, we’ll fire up a new instance of messaging sub classes to send the message.

Washing With SOAP

Soap intergration was quite easy. As I am lazy and could not be arsed finding out the format of a WSDL file, I used the inbuilt wsdl generator included with Zend IDE. This was based around a very simple php file below, called simply MessengerService.

require_once('Messenger.class.php');
/**
* Send a mail message via soap.
*
* @param string $sender
* @param string $recipient
* @param string $subject
* @param string $message
* @return boolean
*/
function sendEmail($sender,$recipient,$subject,$message) {
try {
$Messenger = new Messenger($sender,$recipient,$message,$subject,'EMAIL');
return true;
}
catch (MessengerException $e) {
throw new SoapFault("999", "Fault With Request: $e->getMessage()");
}
}

$SoapServer = new SoapServer('Messenger1.wsdl');
$SoapServer->addFunction('sendEmail');
$SoapServer->handle();

Here I have the EMAIL transport hard coded, as I was just testing this out, but as you can guess, by changing the transport, a different type of message can be sent. Its quite nice this way too as to send a messafe I only have to do the following;


$newSoapClient = new SoapClient('http://notify.dev/Messenger.wsdl');
$newSoapClient->sendEmail("$sender","$recipient","$message", "$subject"); // Real world would include a transport type var.

This messenger service can sit on the same box as your web app, or when things become too busy, moved off to another box to handle notifications.

Finally
There are some questions I have all the same. How do large sites like Yahoo handle mail notifications within their applications? Do the use a similar theory or are the mails sent locally? If you have expeience with such a problem I would love to hear from you. Secondly I think the overhead on a SOAP request migh be higher than a mail function request, but again this is only a theory I am playing with at the moment.

If you did find this long post handy, or indeed if you have suggestions on how I can improve this or my PHP, please drop me a line.

Zend Framework

March 6th, 2006 by admin

The Zend Framework Preview was finally published at the weekend. Only had a quick look at it but it looks good but I think it will be a long road.

The Movie that started it all, The Black Prince, father of Ghostriders everywhere

February 22nd, 2006 by admin

Following this post by Donncha, I was captivated about the stupidity, bravery and sheer awe factor of this “past time”.

So I began to dig around a bit. It seems this whole craze started off in the late 70′s by a rider called the “Black Prince”. He used to ride around Paris with a camera straped to the bike. Well after much digging and broken links, here is the original Black Prince movie. Those of you who know Paris, will know why he choose early in the morning. You will also know that this IS the stupidest scarest thing you will see ever, now you know why you should never ever drive in Paris.

The Ultimate Fate of the Universe?

February 11th, 2006 by admin

Okay, so now I am obsessed with time. I crave that perfect second. One that is accurate to the smallest measure of time. I don’t know why I have been obsessed with time. I am generally bad at time keeping and don’t really care about time in the carrying out of my mortal life.

However, strangely I have always had this thing about being accurate about time, actually accurate is not enough, percise would be the exact word to use. Anyhow, so I have been browsing Wikipedia again in a late night wik, and came across this very interesting entry on “The Ultimate fate of the Universe“. I have one problem witht the theory of Open Universe.

Now I am no physicist so please, if you are reading this and you think I am ignorant of all, please be kind, I am Joe public afterall. However I can’t see why the Big Freeze or Big Rip would apply to an Open Universe theory.

My logic being;

    If the universe is expanding according to the Open Universe Theroy, then at the very point of expansion there is still 10-43 (10 to the par of -43) seconds unaccounted for. What is going on there.
    If the universe is constantly expanding, then so too is matter being created, Matter has to come from somewhere, even if it is within those 10-43 seconds. So while the oldest part of the universe is possibly freezing its ass off, there would be enough matter created at the new start pint to compensate for matter that is lost. However this leads to more questions about matter being “shifted” to the “right” thus increasing it denisity, thus leading to a collapse of the “right”
    It is quite plausable that the expansion is happening in every direction, but this would mean that all matter would at some point end up in the centre, leading to a collapse of the universe as the rate of collapse could exceed the rate of creation. Although, I reckon, it would equal the rate of creation in which case all of a sudded we find ourselves in a static universe

So if you are a friendly astrophysycist and have a few moments to educated the uneducated, could you help me in getting my head around this?

Also if you can arrange it for me that I see a perfect second, that would be cool.

Nite nite.

Speech Writers

February 8th, 2006 by admin

Fred Crowe has just started bloging about speech writing. Very good.

XAJAX & Smarty Part Two

January 12th, 2006 by admin

Okay so I am doing well with this Xajax stuff coupled along with Smarty. All I need now is to have the object response to return my Smarty template with all its glorious data.

Well I must admit to feeling very silly here now, I spent ages doing the $smarty->display() however what I really wanted to do was actually $smarty->fetch in my functions so that I would be sent correctly to the Xajax object. This also means that if you have Smarty defined somewhere else, for example in a config file, you will need to use the Global keyword to allow your xajax function to access your smarty template.

HTH if not at least I will remember. It would be nice to be able to access an Object directy, but then again, not really when I think about it properly.

XAJAX & Smarty

December 31st, 2005 by admin

Okay so I have been messing around with all this ajax stuff recently. Now being a big fan of SMARTY I was reluctant to go and write my own templating system, and intergrating javascript into some of the existing smarty templates I had was a bit of a pain in the ass. But I really wanted to give this AJAX stuff a go.

After trying various different ajax scripts and implementatons, I settled on XAjax to work with PHP. The main reason was that they seemed to be the easiest to intergrate with Smarty.

So down to the nuts and bolts of it.

require_once(INCLUDESDIR. '/3rdparty/Xajax/xajax.inc.php');
$xajax = new xajax();
// Send our xajax requests to a certain server
$xajax->setRequestURI("form-processor.php");
$xajax->registerFunction("validate-field");
$xajax->processRequests();
$smarty->assign('xajax_javascript', $xajax->getJavascript());
$smarty->display('web/common/header.tpl');

So lets go this bit by bit just so that we are clear.

  • The first line simply includes or Xajax script
  • Begin a new instance of Xajax
  • The next line tells Xajax where to send the data. By default it will use POST and send the data back to the same calling script. However in this example, I am sending the data to another script whihc does all the processing for me and returns the results as an Xajax response.
  • Finally the register functions tells Xajax which function to call based upon what you write and decide it is allowed to call.
  • The process request statement must be called otherwise you won’t get anything back from your scripts
  • Xajax makes it very easy for you, all you do is as normal is assign a smarty var, the Xajax javascript and call it in your template as you would normally call anything else.
  • No an important bit here. If like me you are sending your requests to a separate script, you must include the Xajax library, you must have xajax registered the functions and you must call xajax->processRequests();

    A function, for those that don’t know can be anything you want to do. The validate one looks like this;


    public function validate-field($arg1) {
    $objResponse = new xajaxResponse();
    if(!$arg1, !$arg2) {
    return false;
    }
    $objResponse->addClear("messages","innerHTML");
    $objResponse->addAssign('messages', 'innerHTML', "Form was validated");
    return $objResponse->getXML();
    }

    You must return the $objResponse->getXML(), otherwise, how is XAJAX supposed to know what to do?

    So on my form, I have a on blur event that simply valiades the filed after the user moves away from the field

    This simple gets the value of the field and passes it to xajax whihc then calls my function. Simple right.

    Now I have actually got it to send messages like processing data, and then display an error message, perhaps I will put up an example of those when I get a chance.

    BTW this is a very very simplifed example of how quick it is to add XAJAX into your scripts. However please note that it can be quite complex to do this, and you should sit and plan your application correctly and its data flow. Also remember don’t use AJAX just because its cool to do so, use it because there is actually a need to use it.

    Smarty & Google Maps

    December 27th, 2005 by admin

    Well it looks like Monte is at it again. Another great product from the SMARTY guy. This handy little API makes it a piece of piss to intergrate Google maps into you web app. Of course it also supports SMARTY too.

    I have not played with it yet, but I will over the next few days as soon as I return to a dedicated link, instead of this vodafone 3G card which may I add is still over priced, not as good as it should be, and still not working correctly under Linux.

    Anyhow, must dash, have turkey to digest….. :)

    Installing Qmail With Vpopmail on RedHat Enterprise Server 4 with help from Qmailrocks.org

    December 19th, 2005 by admin

    Okay, so today I decided to install qmail + vpopmail + mysql + courier on a RHES 4 machine. Well normally I have used the excellent source rpms from Qmail Toaster, but I was having lots of problems with them today and considering time was tight I would go ahead and use the sources.

    Now I have known about Qmail Rocks for a long time now, but never really gotten around to testing the docs agains RHES 4, so today I thought would be my luck day.

    Now I had actually setup the server with a partition for vpopmail of about 10GB for the amount of users that will be located on it. It also keeps my filesystem nice and tidy, yet standard enough for any other sysadmin to come along and figure out what is going on.

    All went fine throughtout the install. In fact it was the easiest install I have ever done. All I did was copy and paste into my putty session the commands in bolded text. I then opened a browser, pointed it at the server and its vqadmin cgi and added a domain.

    All was going well until I opened up the Qmailadmin page. When I typed in my postmaster password for the domain I kept getting an Invalid User error.

    Okay so I looked at mysql and she was running sweetly, and the tables had all the correct info in them after vqadmin added the domain. There was nothing helpful in any of the log files, so I resorted to using the vpopmail command line tools to find out the problem.

    When I ran vdominfo, I got all the info I expected, however when I ran vuserinfo postmaster@somedomain.com I kept getting the following error.

    vmysql: can’t read settings from /home/vpopmail/etc/vpopmail.mysql

    Strange I thought, one binary could read the files, the other could not. Anyhow, I googled, a bit but never cam across the right answer, which then began to freak me out. Its not often that I can’t find the answer with google. So I took a break for a wee while.

    I cam back a few hours later, lit a smoke and said that this was not going to beat me. So I googled and gooogled and then yahooed and even dare I say it MSN’d it (yes I was going to extra low depths to solve the problem). Now I could have mailed the excellent and relavant maillists, but from the searching the one thing I did cop onto was that problems of this nature were common and so common in fact that anyone with a clue would not ask about them. So me not wanting to look like an idiot decided against that.

    Finally I began to get somewhere. I twigged it was a permissions error early on, it was sorta obvious anyhow. But one mail I read (sorry can’t find it now) described a similar problem but with a different binary in the vpopmail toolkit and with a similar partition structure as mine. It was to do with suid permissions on the partition. Lo and behold when I looked at the fstab I had nosuid in the defintion for /home/vpopmail.

    I quickly fixked that, and sensing I was close cd’d to the vpopmail bin dir to try my vuserinfo again.

    ./vuserinfo postmaster@somedomain.com
    vmysql: can’t read settings from /home/vpopmail/etc/vpopmail.mysql

    Bollix I thought. I lit yet another smoke and cruised over to Inter 7 again. The answer has to be here. Its the home of vpopmail. Surely some n00bie posted with the same error as me, got flamed, but then got a right answer and I can save face by not having to be the n00bie to post to the list……… well after searching though the mail list with the horrible htdig search engine, I was begining to think that I was going to be the n00bie.

    The I said I would reread the inter 7 docs again and make sure, what Qmail rocks was trying to do and what inter7 advised you to do was right.

    Well straight off, I spotted the error. The Install Doc advises a uid and a gid of 89, F*&@ I said, I remember this….. I had the same problem a year or so ago. The vpopmail and vchkpwd binarys should have the same uid and gid to work correctly. So I removed the users and groups Qmail Rocks had installed (7500 and 7509 for some reason??) and proceeded to do a rebuild. 6 min later I was ready to try again.

    BINGO BABY! It worked! Well I thought to myself, sometimes the most experienced people make mistakes. But I suppose the moral of this is, if you learn something once, don’t forget it. :)

    Anyhow, am posting this to show what an idiot I can be at times, you won’t always get the answer from google, you more than likley if you are not lazy have the answer but mostly, so I don’t forget again… Oh yeah and hopefull this will get indexed to hell by the search engines :)

    *Shamed*

    ILUG Website

    December 3rd, 2005 by admin

    Well another thread has begun on the mail list about the state of the current ILUG website. I have tonnes I can say and tonnes I could do for this website IMHO and together with others I think a combinatin of our ideas could make for an exciting and informative website for a newbiee all the way through to an enterprise.

    However there are a couple of things I will say now. Don’t bother with the technology. We know it exists so thats not such a big problem. We need to formulate a strategy for the web site first. Then come up with permanaent content links, like about, community and then the more fluid dynamic site content. Apoint specialist teams to look after certain areas. For eample those interested in business and linux look after that section with a a chief and sub editor whom can remove content or alter as necessary. How they run themselves is not important, the main thing is that the overall team has one or two points of contact should things go wrong.

    Media watch. Watch whats happening in the media and put a linux spin on it if applicable.

    Make the thing easy to naviagte but hell design it beautifully so that it looks good, but also allows the end user to find what they are looking for quickly and easily. Use CSS to its fullest to provide standards complicance with elegant fall back for older browsers.

    ohh I could go on and on, but in realtiy I am putting my hand up and saying, I want to help, what do you want me to do. If I need to lead I will I don’t care about the politics of it all, just KISS is all and it will rock!

    Zend, IBM and the start of a new Eclipse Framework – Better know as PHP.NET

    October 18th, 2005 by admin

    It’s looking more and more likely that Zend and I.B.M. are jointly announcing a new PHP Framework according to Client Server News. Just what this will mean for the Zend Studio IDE is unknown. Will this spell the end of the IDE or will it now become more open sourced.

    I’ll hopefully be able to find out as the conference goes on, but its looking more and more like there is going to be a big push by Zend to make PHP more attractive to enterprises to compete with .NET

    Zend PHP Conference

    October 17th, 2005 by admin

    Well I arrived in San Francisco alright for the Zend Conference. I must say BA are much nicer than Aer Lingus to fly with. My heads a little screwy at the moment with the time difference to take into consideration. I woke at about 4am local time, which was cool as I manager to get some work done this morning.

    Coffee is a big problem here. The hotel only server starbucks, which I am not a great fan off. I managed to bring some of my own with me, but alas I don’t have a grinder. Apart from that, the hotel is grand.

    Its a little odd as there appears to be no other Irish people attending the conference, but I’ll check the bar later on today and see what acents I hear.

    Am looking forward to the conference. Looks like its going to be good. But whats wrong with the Pay Pal guys. Only an hour for a micro brewery session. Did they not know the Irish were coming?

    Anyhow will use this blog to post anything of interest for the guys back home, if needed otherwise you can take it that I am bored and ranting :) Till later.

    P.S. Anyone attending the conference, please feel free to contact me, I am around and always interested in talking PHP, Beer or whatever :)

    DNS System in trouble again.

    January 11th, 2005 by admin

    An interesting article on The Register on how spammers are making life difficult for all of us, but sending out their crap. This leaves two questions open for debate;

  • Do we solve the spam problem?
  • Do we solve the DNS problem and hope the spam problem goes away?
  • The Friday happy Word

    November 19th, 2004 by admin

    The Friday happy Word is for you and your friends. Fridays are very special days as they are the start of the weekend. Some of us are heading off for the weekend to see family and friends, some are staying put, some are working and some are just going to chill out. Whatever your planning this weekend, take a moment out from work or whatever you are doing and think of a word or sentance that makes you smile, makes you feel happy and add it to the comments below.

    You don’t have to include you email or anything if you don’t want to, but it would be nice to put your name in. All you have to do is add your word(s). If your word(2) are not in english, please translate if possible to english its also nice to add what country or language it is in for those of us who can’t guess :) . Best submission wins nothing except knowing that their word may make someone else smile. Have a good Friday all and an even better weekend. Don’t forget to tell a friend and share your happy word with others :)

    Strange things happen when your listening to Jazz

    October 29th, 2004 by admin

    Ahhh well, what a week this week has been. Life is strange, just when you think there is nothing happening and that the tedium is getting to y9ou, somebody screams from the crowd and suddenly your awake. I’ve been asleep far too long and taking it easy methinks, its about time that I wake up and begin again.

    Anyhow was around at the Cork Jazz festival. Wow what a weekend. Safe to say its one of those weekends that will remain with me for the rest of my life. Things changed, yet remained the same. If anyone has ever heard of a singer called Esther Miller, man you are one of the lucky few. With a voice so powerfull its just not funny how she can make you ride a wave of emotion.

    Anyhow got to run bus is coming, friends to see, loves to live :)

    A

    Nothing Happening

    September 2nd, 2004 by admin

    Its been too long since my last posting. Well I still see that nothing is happening with linux.ie. I must start finalising the blug.biz site and documentation. Don’t get me wrong I am not knocking ILGU, just not seeing anything going on. Maybe there is loads of stuff going on in the background.

    Finally got my Novell Linux kit. Very nice I must say. Some of their ideas are really good. Their groupware stuff seems well thought out except for one thing. They should talk to the designers of Open Exchange as their interface really lets the product down.

    Druid DNS, my baby is finally finished and in productions. We have finally started to serve domains offically now whihc is cool. We will be launching it soon to an unsuspecting public. Sure there will be the usually it does not do X it does not do Y responses, but I expected that. it actually does all of the DNS functinality you could want and more, just we have not enabled it in the user interface for fear of frightening the user. Maybe in 1.2 we’ll add some of the other stuff.

    Anyhow enough ranting. Just letting people know I am still alive and still very linux focused.

    AJ

    Another Suse Kernel Source Issue

    July 9th, 2004 by admin

    Note to self;

    Suse is nice, but when it comes to additonal hardware I have always had problems with the SuSe source rpms. The latest one is brought about by trying to build Qlogic 4010c HBA driver support into the kernel. They actually compile fine but make bzImage fails with the following.

    make[1]: Entering directory `/usr/src/linux-2.4.19.SuSE/arch/i386/kernel’
    make[1]: Circular /usr/src/linux-2.4.19.SuSE/include/asm/processor.h <- /usr/src/linux-2.4.19.SuSE/include/linux/list.h dependency dropped.
    gcc -D__KERNEL__ -I/usr/src/linux-2.4.19.SuSE/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=traps -DEXPORT_SYMTAB -c traps.c
    traps.c: In function `do_int3′:
    traps.c:785: warning: implicit declaration of function `kdb’
    traps.c:785: `KDB_REASON_BREAK’ undeclared (first use in this function)
    traps.c:785: (Each undeclared identifier is reported only once
    traps.c:785: for each function it appears in.)
    traps.c:785: `kdb_eframe_t’ undeclared (first use in this function)
    traps.c:785: parse error before “regs”
    make[1]: *** [traps.o] Error 1
    make[1]: Leaving directory `/usr/src/linux-2.4.19.SuSE/arch/i386/kernel’
    make: *** [_dir_arch/i386/kernel] Error 2

    Now this seems to be cause by the fact that an ifdef was left out somewhere. Ahh well I will upgrade the kernel, however it is Suse/United Linux server and I would not like to have to upgrade the kernel just yet. Would like to see it working first.

    Getting Close

    February 1st, 2004 by admin

    Processed in 1.446637 secs); 01 Feb 2004 20:39:33 -0000
    X-Spam-Status: No, hits=0.0 required=5.0

    Ohh yeah baby :D

    Got to improve the processing time

    February 1st, 2004 by admin

    Yawn, tweaking my little old mail setup. I have moved SPAMD off to another server and passed the host options onto the spamc options in qmail-scanner.pl.

    my $spamc_binary=’/usr/bin/spamc’;
    my $spamc_options=’ -c -f -d 192.168.1.75 -p 783′;

    SPAMD now has a dedicated 512MB Dual 1GZ machine set aside for it alone. The mail server that calls spamc from qmail-scanner.pl is on the same switch as the SPAMD server, however when I look at the headers of the sent mails I am getting a rather larget processing time;

    Processed in 15.544668 secs); 01 Feb 2004 18:48:54 -0000
    X-Spam-Status: No, hits=3.9 required=5.0

    I have to be doing something wrong here, there has to be a way, to speed this up. :roll:

    Qmail Anti Virus & Anti Spam – Message Labs style (well kinda :-) )

    February 1st, 2004 by admin

    Ahhh, finally I can say yes. It works, although not as well as Message Labs mail systems do, I think I got this qmail filtering to work right.

    Its a bit of a hack, and its late, but here is goes. First there is a primary mail server with qmail installed. For domains I want to allow anti virus / anti spam protection for I add them to rcpthosts in /var/qmail/control/rcpthosts. From here I also add an entry in /var/qmail/control/smtproutes like domain.com:[127.0.0.1]:11025. On the same machine I have another installation of qmail, we’ll see why I have this later. The first instance of qmail just does basic rbl checks and some spam checks. Nothing too heavy, thats why we need the second instance. the second instance uses smtproutes :[192.168.1.25]:25 to pass it onto another qmail box, that goes through some heavy spamassassin checks and then uses another smtproute :[192.168.1.30]:25 to pass the mail onto virus scanner one. The first virus scanner I am using is
    Bit Defender. Once bit Defender is happy with the mail (Or does not pick up on a virus), it transfers the mail to the second virus scanner, Vexira. Vexira, does all its stuff, and if it fails to pick up a virus or everything is cool, it then passes the mail to qmail again. Qmail this time using Qmail Scanner again, passes the mail through Clam Anti Virus which, when it is finished, returns the mail to qmail to deliver via an smtproute for the the doamin.com.

    The cool thing about that is I can manage all this using vpopmail and a wee perlscript to write out the smtp routes on the first and last hosts. While it does take a little longer for mail to get through, it does however get well cleaned, and checked. Plus performace is quite good, because the machines that do the work all have a healthy dose of RAM and are dual processor.

    All in all, I am happy, I think its working (Although I am sure somebody will point out a flaw with it, or some way of doing it better). Its now in testing at the moment, with the option of adding another AV scanner or AS scanner in there before it goes into production. Have to find out all the flaws first. I am wondering if I could increase performance by using

  • QMTP
  • QMQP
  • for the qmail instances on the other boxes so the can communicate further. Alas I don’t know anyone who has experience with thee, so I’ll just stick to smtp routes for the moment, till I have had a chance to look at these in more details.

    The other thing is I think spamassassin with qmail-scanner can be a bit slow. Would love to know of ways to speed these up a bit. Even on dual pentium 1Gz boxes with 1GB of ram, they still are not what I would think of as fast. I am running SPAMD and using spamc in my qmailscanner script.

    Righty, now for a cup of tea, and to finish off another project.

    Back and with a vengence

    January 31st, 2004 by admin

    Ahh after a few hours sleep I knew I’d be able to get up and hit this qmail problem. Went out and got the hp photosmart 7660 printer. Ahh finally I can print things again.

    Not happy with getting qmail to pass all the mail onto the virus scanner, I am gonna aim one higher, have the virus scanner pass the mail onto another virus scanner and then onto two spam filters. Should be fun. But then I am gonna try and figure out the Qmail Messaging Queueing Protol and see if I can use that to deliver the mails to the mail cluster. Second phase of that would have the AV/AS boxes get thier mail using QMQP and then do the work. Don’t have a clue as to what I am doing now, but its fun on a wet afternoon.

    The perfect solution

    January 31st, 2004 by admin

    Another late night. This time up playing with qmail. Mmm, the more I play with qmail the more I like it. The setup of it now is coming together for this antispam.antivirus solution. I have qmail accepting mail for all domains now, which is basically an open relay, but the /var/qmail/controls/smtproutes contain :[127.0.0.1]:2525 which passes all the mails onto the virus scanner, then the virus scanner software, passes it onto the dedicated anti spam box, currently running spam assassin (Don’t know if this is ready for the job I am about to give it though)

    Finally once the anti spam box is finished with the mail, it forwards it onto the real host. Bit of a pain really there, casue that means even mails attempting to realy with be “washed” before the reject occurs on the real host. So I know I can add something in there to wmail, to only allow mail for the domains I want to have AV/AS completed on. /var/qmail/control/locals or rcpthosts etc something in there I gotta change. Then that should be it. One thing though, none of the AV products, be they open source or commercial are picking up everything (Which is worrying). Maybe I just have not found the right one yet, but Test Anti Virus is an excellent web site for testing your mail scanners.

    now I am off to bed, fecking knackered.

    Back on DSL road – But what a journey to get there.

    January 16th, 2004 by admin

    Well, it official, I am now finally back on the DSL road. But by god it took a hell of a long time to get here. Now eircom horror stories are two a penny so I am not going to go into it too much. But listen there are GOOD people in eircom too. The problem is that its an organisation that comes from a traditional Irish Civil service mentality, so anyone with a few honours in their junior cert is stuck somewhere in middle management trying to figure out the colour of shoe laces for termites rather than address customers needs. It’ll be a long while before eircom changes, the new heads are slowly working their way in there, but it will be a while before the old cronies are laid off, die or are put out to pasture with the other bloddy idiots that run the majority of the essential services in this god forsaken country.

    Anyhow in response to the Eircom debacle I have or am in the process of lodging a few complaints with COMREG. The basis for the complaints are as follows

    1. DSL Installation fee for corporate users
    Eircom still insists that corporate users hand over 199 Euro to have an engineer come out and install a spliiter on the phone line, despite offering self install packs to users of their lesser dsl services (Lesser as in less cash less bandwidth). There is no lnow technicall reason for an eircom tech to come out to a premises unless otherwise stated by a client.

    2. Eircom Systems Inhibit its ability to operate as a telecoms provider
    Due to repeated errors on their customer and billing systems with myself and of my clients, each of a varing degree, their ability to operate as a telecom provider is questinable due to staff being continually feed incorrect information while update of the information is nigh on impossible to achieve. This has the effect of impairing one ability to attend to other matters as one is continuly on the phone to eircom staff trying to resolve the issues. In a one week period, the aprrox time spent on the phone to eircom trying to resolve issues was approximatly 18 Manhours. This is an increadbly high amount of time and unacceptable. They are failing to respnd to customers needs.

    So if anyone else feels like joining in, well then please do. The more that do, the more that COMREG and Eircom have to listen, the more they listen to us them more they get pissed off. The more pissed off they are the more incentive for them to fix the problem, make a big song and dance about it and shut us up till the next issue.

    Now off to bed, mmmm I wonder if I will still dream I am in between two phone lines. One here and one somewhere deep inside eircom surrounded by that dam hold music (I swear I did dream this.) 8O

    Must remember this the next time

    August 8th, 2003 by admin

    I am building this wee app and a user submits a number. Now I need to find if that number is a direct multipe of 7. Grand easy enough to do one would have thought, except this kept failing for me. Anyhow I had a glass of wine and sent a mail to the nice people at ILUG and lo and behold its now working. Maybe I am just an idiot after all :o


    <?
    $divisor
    = 7;
    $number = 77;
    if (
    $number % $divisor == 0)
    {
        echo
    “Number ($number) submited is a multiple of $divisor\n<br>”;
        
    $multiple = $number / $divisor;
        echo
    “$multiple x $divisor = $number\n;
    }
    else{
        echo
    “Number ($number) submited is not a multiple of $divisor\n<br>”;
        
    $multiple = $number / $divisor;
        echo
    “$multiple x $divisor = $number\n;
    }
    ?>

    CDONTS and Fu****g IIS SMTP Service

    August 5th, 2003 by admin

    Message delivery to the remote domain ‘hotmail.com’ failed for the following reason: Unable to bind to the destination server in DNS.

    Why? Cause this excuse for software is just plain old crap. Never mind the lack of debug messages from a CDONTS mail script, it just decided one day out of the blue to ignore all the unix name servers it could find. Then when the fecking thing did do a lookup properly it still would not send a mail.

    The solution for this shitty problem is in IIS SMTP server admin, go and make remote domains for all the TLD’s. FOR F***S SAKE MS! The have them relay to a real mail server preferably qmail, exim or postfix.

    Another reason why web developers should use LINUX.

    Bloddy hell httpd devel

    July 3rd, 2003 by admin

    Okay, I am not one to bitch about distros very often but I am a little pissed. Trying to compile php4.3 at the moment on a RH8.0 box. Fine in theory but RH in their infinate wisdom have included a broken apxs script for the second (third?) time.

    I suppose install Subversion did not help eiter. BTW Subversion is really nice i have to say. I have ditched CVS in favour of it.

    But all I wanted was an early night tonight and not be arseing around with dody httpd-devl packages. As well why can’t they include apr-utils as well?

    Gripe!

    UPDATE! 01:35 Got the bugger! #mkdir -p /var/www/build; ln -s /usr/lib/httpd/build/libtool /var/www/build/libtool

    Seems there is a bit of confusion somewhere here about where the lib files shoul be

    Linux: Whats in it for Me?

    June 29th, 2003 by admin

    El Rego, has posted an interesting story on the sale and marketing of linux with a bit of emphasis on the home user. One well worth a read if you have the time.

    :arrow: Linux: So whats in it for me?

    Irish APT sources for Redhat

    June 22nd, 2003 by admin

    Just added these to my sources for apt on redhat boxes. Replace version numbers as required.

    # Red Hat Linux 8.0
    rpm ftp://ftp.ie.freshrpms.net /mirrors/ftp.freshrpms.net/pub/ayo/redhat/8.0/i386 os updates freshrpms
    rpm http://ftp.heanet.ie /mirrors/ftp.freshrpms.net/pub/apt/ayo/redhat/8.0/i386 os updates freshrpms
    rpm http://ayo.freshrpms.net redhat/8.0/i386 os updates freshrpms
    #rpm-src http://ayo.freshrpms.net redhat/8.0/i386 os updates freshrpms

    Beer and Jaffa Cakes

    May 2nd, 2003 by admin

    I just discovered that if you wan to tidy up a desk, jusk put all the empty Tiger Beer bottles into a few just as empty Jaffa Cake tubes, you can really clean up a desk in no time.

    My LINUX Transparent Frewall

    May 2nd, 2003 by admin

    I had a major problem with a Netscreen firewall recently that really wreaked my head. It was supposed to act in transparent mode (Become a network bridge essentially) and filter out all those bad and nasty packets that cause problems for the Windows 2000™ servers that a few customers of mine had sent to them on a most regular basis to exploit the many security vulnerabilities that are out there for that particular OS.

    However, probably due to a multitude of problems, like me not knowing the Netscreen too well (Although most of the config is quite easy through a web interface or a command line but the docs really sucked with bad misleading config data), old and buggy OS on it and the wrong type of firewall for the job, it tended to crash and burn on a regular basis. Despite all the research on the net, and the Netscreen resources, I could not rectify this problem.

    With my clients getting annoyed at this problem, but reluctant to shell out additional funds for a new Netscreen firewall, I set out about finding out if Linux was up to the task.

    IPTABLES and IPCHAINS have been around for quite a while now and are doing a marvellous job in fire walling machinery, especially with NAT in place. However I wanted to avoid NAT at all costs. Principally because I don’t want to be binding all the IP addresses to one box and then making up mad rules, but also I just wanted the customer to have as little bother with the technical aspect of this firewall, so that they could just plug in a box with the gateway and all configured as they knew how to and it’d be protected.

    I usually deploy Red Hat as I’ve been using it now for too many years to remember, and it’s the distro that I feel most comfortable with. However with Red Hat, I just hate recompiling my kernel, its just a pain in the ass sometimes and sometimes its fine. This was not one of those days, but luckily for me after I read a few docs on the Red Hat support site, I quickly realise that the kernel bridge patch was standard with Red Hat, so yippee.

    Getting a bridge up and running is really a straight forward task with Red Hat; however you do need Bridge Utils before you can do anything meaningful. To set-up your bridge, do not configure your network cards (eth0, eth1 etc). if your using rpm, you can simply install the bridge utils package, if not it’s the usual make job to build and install. Once bridge utils are installed, you can activate your bridge by doing the below;

    localhost# /usr/sbin/brctld

    root@localhost# /usr/sbin/brctl addbr br0

    root@localhost# /usr/sbin/brctl addif br0 eth0

    root@localhost# /usr/sbin/brctl addif br0 eth1

    root@localhost# /sbin/ifconfig eth0 0.0.0.0 promisc

    root@localhost# /sbin/ifconfig eth1 0.0.0.0 promisc

    Now, plug your new bridge somewhere between yourself and your gateway and do an arpwatch to see it working. That’s the bridge part done. Pretty simple was it not?

    Now for the fun part, IPTABLES. Let’s get this straight from the start, I hated IPTABLES, the syntax was confusing and not something I could get used to by reading the man pages. However I perceived and soon after having a good look at real life examples, little pieces began to sink into my brain. But the config of IPTABLES in bridge mode took on a whole new meaning to my life with IPTABLES. Again though through a little googling and the help of Sourceforge, I found something that was totally invaluable. Its called Firewall Builder and it’s a great GUI to IPTABLES. It even supported IPTABLES in bridge mode, which is fantastic. Anyow, I’m not going to go into too much detail here, its all for you to try, but it is really simple once you get your head around it, its fantastic.

    Eventually I ended up recompiling my kernel to take advantage of some of the nice new features of IPTABLES, namely string matching. This allows me to look for thing like “cmd.exe” in requests and drop them before they hit the target machine. It also stops those stupid worms from showing up in your Apache log files.

    Now before I tell you to get rid of Checkpoint there are a few things to think about. This is a software firewall, so there are drawbacks. There are also issues in terms of redundancy. I am looking into this as I would like two bridges on the network, to load balance and give some level of redundancy. However I am having problems understanding this setup so if anyone has any helpful links or anything please give me a shout.

    There however is one big advantage to this type of firewall. Think about it for a moment. You could in theory add Snort, and then Guardian so it would actively drop connections and deny entry to your network for a specified period of time. Now you would have to mess around with the rules a hell of a lot in Snort, but if you have the time, your going to have a pretty cool and strong firewall at the end of the day.

    Okay I am sure there is little enough info here for the more techie of readers, and I am by no means the best at documentation, but listen, its all out there to find on Google. To please the techies well here is a snip of the IPTABLES rules(Note the 192.168 address was used here to give you an example)

    # Rule 0(lo)
    #
    # allow everything on loopback
    #
    $IPTABLES -A FORWARD -i lo -j ACCEPT
    $IPTABLES -A FORWARD -o lo -j ACCEPT
    #
    # Rule 1(br0)
    #
    # Allow established connections
    #
    $IPTABLES -N br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.20 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.22 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.15 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.5 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.10 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.14 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.9 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A FORWARD -i br0 -d 192.168.15.24 -m state –state ESTABLISHED,RELATED -j br0_In_RULE_1
    $IPTABLES -A br0_In_RULE_1 -m limit –limit 6/minute -j LOG –log-prefix “RULE 1 — ACCEPT “
    $IPTABLES -A br0_In_RULE_1 -j ACCEPT
    $IPTABLES -N br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.20 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.22 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.15 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.5 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.10 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.14 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.9 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A FORWARD -o br0 -d 192.168.15.24 -m state –state ESTABLISHED,RELATED -j br0_Out_RULE_1
    $IPTABLES -A br0_Out_RULE_1 -m limit –limit 6/minute -j LOG –log-prefix “RULE 1 — ACCEPT “
    $IPTABLES -A br0_Out_RULE_1 -j ACCEPT
    #
    # Rule 2(br0)
    #
    # Allow the monitoring server to do what it likes.
    #
    $IPTABLES -N br0_In_RULE_2
    $IPTABLES -A FORWARD -i br0 -s 192.168.15.3 -m state –state NEW -j br0_In_RULE_2
    $IPTABLES -A br0_In_RULE_2 -m limit –limit 6/minute -j LOG –log-prefix “RULE 2 — ACCEPT “
    $IPTABLES -A br0_In_RULE_2 -j ACCEPT
    $IPTABLES -N br0_Out_RULE_2
    $IPTABLES -A FORWARD -o br0 -s 192.168.15.3 -m state –state NEW -j br0_Out_RULE_2
    $IPTABLES -A br0_Out_RULE_2 -m limit –limit 6/minute -j LOG –log-prefix “RULE 2 — ACCEPT “
    $IPTABLES -A br0_Out_RULE_2 -j ACCEPT
    #
    # Rule 3(br0)
    #
    # Allow eircom DSL customers to connect via ssh and web to the secondary name server. This is because # Anton is on the Eircom.net DSL network and have not arsed themselves with a static IP for him yet
    #
    $IPTABLES -N br0_In_RULE_3
    $IPTABLES -A FORWARD -i br0 -p tcp -m multiport -s 159.134.0.0/16 -d 192.168.15.3 –destination-ports 22,80 -m state –state NEW -j br0_In_RULE_3
    $IPTABLES -A FORWARD -i br0 -p tcp -m multiport -s 159.134.0.0/16 -d 192.168.15.5 –destination-ports 22,80 -m state –state NEW -j br0_In_RULE_3
    $IPTABLES -A FORWARD -i br0 -p tcp -m multiport -s 159.134.0.0/16 -d 192.168.15.10 –destination-ports 22,80 -m state –state NEW -j br0_In_RULE_3
    $IPTABLES -A FORWARD -i br0 -p tcp -m multiport -s 159.134.0.0/16 -d 192.168.15.9 –destination-ports 22,80 -m state –state NEW -j br0_In_RULE_3
    $IPTABLES -A br0_In_RULE_3 -m limit –limit 6/minute -j LOG –log-prefix “RULE 3 — ACCEPT “

    MySQL as a DNS Server?

    February 27th, 2003 by admin

    Ahh, finally after a hetic two days I get to chill out for a few hours and catch up on some sleep and mail. Its been a fun move from a rather dodgy & insecure Win2K DNS server to a better higher performance one.

    Thankfully my old friends at PowerDNS came to the rescue with the software I needed. PowerDNS is a great little DNS server. Its efficent, speedy and best of all gets its data from MySQL, the webs favorite Databse Server (IMHO).

    Of course the server was deployed on RedHat Linux on a few Compaq Proliant servers. Which was really nice to see. Just the sheer of these boxes is enough to make a graphics heads mouth water. And what does it run, striped down RH and DNS.. No matter, I don’t expect them to be busy at the moment, but someday, they’ll be banging out the A or AAAA records faster than my granny can slip a shot of sherry (OK both my grannies have been dead for years but you get the idea).

    Its a nice little set up all the same. The master MySQL server is located in a private admi network. Each DNS server has an associated MySQL server assigned to it. So there are two servers on each network really assigned to look after DNS. Each slave MySQL server gets its data via replication from the master through a vpn tunnel that connects at random intervals. The cooler thing about this is, that each DNS server also has a slave Mysql server on it. This slave is a slave to the slave box that is replicating the data from the master server through the VPN connection. This adds to a certain amount of redundancy should there be a problem with the MySQL server in each network. But the best part (well I though it was a cool idea), the MySQL servers monitor the DNS server via serial and ethernet to see it all is okay. If its not, it attempts to restart the services. If not well then it simply shutsdown the DNS server and assumes its identity. All while sending us an email and an rather annoyting SMS using the XIAM kit I rescued recently.

    Ahh that was fun. It works quite well too. As much of a headwreaking experience it ws however, it was nothing like what I had to go through with the domain registries. But thats another rant and another time.