Archive for October, 2008

My Router Doesn’t Support Dynamic DNS, No Problem!

Well I just recently hooked up a DSL connection via a DSL modem that was also a router. For regular home users this DSL modem/router is probably good enough but for more complex setups it is useless. In this particular setup we had a custom built firewall. This firewall had a built in dynamic DNS service for ISP’s that rotate IP addresses. The problem however, is that the firewall was behind the DSL modem’s NAT. So it was reporting a private 192.168 number to Dyndns.

We couldn’t turn off NAT on the DSL modem unless we purchased a block of static IPs. The DSL modem, being home orientated, didn’t allow for dynamic DNS.

Fortunately dyndns offers a service to detect your public IP address. They also have an API to change your IP for dynamic DNS. Knowing this I quickly did a search on my favorite perl code repository, CPAN. Sure enough someone made a module that sends updated IP info to dyndns. Read more »

Learning Regular Expressions for Beginners: The Basics

If you consider yourself a programmer and you have not learned regular expressions yet now is the time! At some point in your development you will need to manipulate strings in more complicated ways that simple string functions can’t provide. Regular expressions are used in almost all programming languages and are considered the de facto standard for string manipulation. Regular expressions can also be used in searches and many other utilities.

The problem with regular expressions is that nobody wants to learn them because they look very intimidating. Don’t worry though, we will try to make it as painless as possible.

When I first looked at regular expressions I have to admit they looked absolutely foriegn. You can’t really look at a example snippets and learn a whole lot as you can with some languages.

For example a regular expression might look like this:

((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15})

If you are new to regular expressions this will look like absolute gibberish or some encrypted code. With regular expressions you have to start with absolutely nothing and build up. Examples snippets simply wont do. Read more »

New UPS PHP Project at Google Code

Out of popularity I have decided to take UPS modules written in PHP found in my article, Calculating UPS Shipping Rate with PHP, over to the next level. I am rewriting all the code in object oriented PHP and publishing the code on Google Code under GNU General Public License v3 to ease implementation.

I am also going to be writing official documentation in the Google Code wiki pages.

This doesn’t mean that I am going to stop writing articles about UPS here on this blog. I will still add more detailed articles about the code and provide tutorials for implementation. The project at Google code is just so the project can grow and provide support, bug tracking, svn access, and official documentation. Read more »