Archive for November, 2008

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 »

Why I Would Never Hijack Someone’s Internet

Well for the short answer all you have to do is ask your self this simple question. Would you give your mail, credit cards and other personal information to a complete stranger? Probably not. By connecting to someone else’s internet connection you are giving them complete control over the data that you send from your computer. This may include mail, credit card information, and personal information.

Although crucial information like bank passwords are transmitted through SSL (encrypted) almost all traffic is sent in plain text. For example this blog and all blogs running Wordpress don’t use SSL to encrypt the credential exchange. Thus if you were connected to a untrusted internet service like your neighbor’s wireless they could easily see your blog’s password. This is just one out of thousands of examples where personal information could be hijacked on the account of YOU hijacking their service. Read more »

Install Adobe Flash for Opera on Ubuntu

Flash doesn’t come with Ubuntu by default so we need to install if for all of our browsers if we want to view any sites that have flash. Adobe provides an easy deb installation file to install it for browsers like Firefox but not Opera. Although the package from Adobe doesn’t automatically install flash for Opera, adding it manually is as simple as copying over a file.

Download the .deb file from Adobe and install it like you normally do. Read more »

Learning Regular Expressions for Beginners: Building a Regular Expression Tester

When learning regular expressions it is helpful to be able to quickly test regular expression patterns. It doesn’t really matter which proramming language you use to build it but I will give you two examples, one in Perl and one in PHP.

If you are new to regular expressions first check out, Learning Regular Expressions For Beginners: The Basics. It will run your through your first example. Once you have the hang of it you can come back here and build a test program to practice your own regular expressions. Read more »

Setting Up a Sandbox Server with SVN

SVN is one of those things that you love once you know what and how it works. SVN is a version control system used by almost all major open source projects and is an absolute dream to work with. If you have ever worked with a team of developers you probably have had the experience of having your code accidentally written over or deleted.

With SVN you have version control where you can revert changes, kinda like Wikipedia. It also keeps track of which files were actually modified and gives you an option to describe to other developers what changes were made. No more unfortunate mishaps. :)

What is great about SVN is that the code can be checked out to any server at any time with the latest code. I use SVN to make a “sandbox” server. A server that I can play around in without worrying about deleting code or messing something up. When I am happy with my changes I can type one command and the two servers are synced with the newest changes. If for some reason it doesn’t work out I can revert back to the old way in one easy command. Read more »