Installing Windows IPsec Firewall

Just recently I found a post that described using the ipseccmd in Windows. I honestly had no idea that this tool existed for Windows. I found this article while searching for a way to block outgoing traffic on the local computer as apposed to making firewall policies. This was the perfect solution for network testing, forcing productivity, optimization and security in Windows.

To get the firewall for Windows you will need to download, Windows Support Tools. When installing make sure you select the complete option. Read more »

PHP Include Injection and Google Referral Hijack

So recently a friend of mine, had a client that had a very odd problem. His website was working fine when you go to it directly by typing in the domain name; however, if you searched for the site in Google and clicked the link for the site it would take you to a hijacked page.

So the page only appeared hijacked when the referral was coming from Google. The hijack could go unnoticed for months. You would either have to be googleing yourself or wait until a good samaritan sends you an email warning you of the problem. I must say this sort of attack is quite clever on the hijacker’s part. The hijacked page gets the original site’s page rank and Google visits while the site owner has absolutely no clue. Read more »

Random Password (String) Generator for PHP

Random string generators are something we programmers end up using quite a bit. Sometimes you want to generate a random file name, a random email verification link, a random password, random token, etc.. Here is the one that I have been using lately.

This password generator uses the Mersenne Twister algorithm to generate random digits. You can learn more about it at Wikipedia or on Makoto Matsumoto’s website. Read more »

Printing a Label for USPS with PHP

If you have been following the posts on USPS you should know how to calculate USPS shipping rates with PHP. Today we are going to use the same USPS API to print out a label. One of the advantages of this is that you get free tracking on all priority shipments when you create your own label. The other advantages is that you get to integrate automatic label generation with your website for customers or for your own shipping.

Start off by making a file called, USPSLabel.php and copy and paste the code below and save it.

Then Change the userName variable with your USPS username and change the rest of the variables to match your label. Read more »

Using a Live CD

Let’s say you are working on an important email, document, or a critical website bug and your computer suddenly crashes and wont boot up. You have to get this work done right away what do you do? With a live CD you can be up and running in two minutes with the tools you need to finish the job. When you are done with your work you can use the live CD to actually fix your computer. Whether you are a computer techie or an average Joe, I think everyone should have a live CD next to their computer ready to go.

What is a Live CD?

 
A live cd is a temporary operating system that runs from a CD instead of a hard drive. This means that it doesn’t permanently effect your computer. When your computer is rebooted and the CD is ejected everything returns back to the way it was. Unless of course you want to use the Live CD to make changes to your computer, like fixing a computer that wont boot. Maybe you need to reinstall but you don’t want to loose those family pictures you saved. Maybe there is 4 minutes left on an Ebay auction and your computer wont boot. Read more »

Why I use the Zend Framework

Frameworks seem to be popping up all over the place for all sorts of languages. These frameworks all have one goal. They are looking to reduce development time. Time is money and when you are working on client’s sites frameworks can drastically reduce the development time. For this reason frameworks are not going away any time soon.

Why a framework?

 
If you haven’t tried a framework for web development do yourself a favor and just go try one. Adding skills to your skill set will help you in future projects. You may find yourself forced to work on a framework in the future so why not get a head start and learn one.

They say a good programmer is a lazy one. Why reinvent code? Why come up with custom code that other programmers will have to decipher when it comes maintenance time. Why not have code that is already well documented and widely known. Why not allow someone else to research the industry standard way of doing the mundane tasks while you focus on the real programming? Read more »

Validating an Email Address With Zend Framework

Email addresses are one of trickiest input types to validate because there are multiple ways emails can be written according to the RFC2822 specification. You could have me@gmail.com, or me+spam@gmail.com, or “mark@server”@marksanborn.net, common on Linux/BSD systems.

A lot of times people will use a regular expression like:

(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})

This regular expression would work for almost all email addresses but would fail for others. For example mark@gmail.co.uk would not match. Either would mark+spam@gmail.com. Which by the way is a very useful feature for email hosts that support it. Read more »

Validating Credit Card Numbers with Zend Framework

Ever wonder how websites can tell you made a mistake entering your credit card number before you even submit it? Like most identification numbers credit cards have checksum digits built into them. Just like barcodes.

If you ever look at a EAN-13 UPC barcode (on all retail products) you will notice there is a digit outside of the regular set on the right. If any digit is out of order or mistyped you can tell that the barcode is wrong based on this checksum. It also allows barcode readers the ability to “guess” what the barcode if part of the barcode got riped or damaged. This is also how PAR files can repair corrupt damaged or even missing files. Read more »

« Previous PageNext Page »