All posts tagged ‘tutorial’

File Under: Backend, Security

Set Up a Linux Firewall on Your Network

Go outside and pop the hood of your car. You should see a thick metal barrier at the back of the engine compartment. This is called the firewall. To see how it works, poke a small hole in the fuel line so that a tiny amount of gasoline starts dripping on the engine block. Now close the hood, start the car, and head out on the highway (Some of you may choose to save life and limb (and time!) by merely visualizing this exercise).

If you have positioned the puncture correctly, within a few minutes the escaped gasoline should ignite and cause a small engine fire. At this point you may see smoke emerge from the engine compartment. Continue driving. You should be able to proceed a considerable distance before the heat becomes uncomfortable and toxic fumes and flames start to enter the passenger compartment.

The reason you can drive so far with a flaming engine is because the firewall is a highly effective barrier between the engine compartment and the passenger compartment. If your car had no firewall, the engine fire would have already melted the dashboard electronics and plastic, destroyed the upholstery, and toasted you to a crisp.

Now. Pull over and very carefully extinguish the fire.

A similar principle can be applied to networked computers. Picture your machine as the cozy, tricked-out interior of your automobile, and the outside world as the dirty but powerful engine that makes it go. It won’t do to have the vulnerable components of your network exposed to the engine’s maliciously raging heat — it’s best to install a firewall.

Let us abandon our weakening metaphor here before it carries us into a ping-pong tournament without a paddle. A firewall, in the networking sense, is a machine that straddles the interface between a private network and the Internet at large, and follows predetermined rules for allowing certain traffic to pass, while blocking traffic that’s unwanted.

So, how to get yourself one of those disaster-averting firewalls? You can start by reading on.

Continue Reading “Set Up a Linux Firewall on Your Network” »
File Under: Programming, Software

Use Includes with CFML

The concept of using “includes” when programming is not a new one, and just about every programming language has this feature in one form or another. However, if you are new to programming, the basic idea of an “include” is to take a piece of code that you will use over and over, and put it in one simple place. That way, whenever you need to make a change to that code, you only have to update one page, instead of updating every page on your site that you used that code on.

In the following example, I’ll be demonstrating how to use includes with the CFML development language. CFML has been around for almost 10 years now, with commercial servers available from Adobe and NewAtlanta, and is widly regarded as one of the easiest web development languages to learn because of it’s HTML-like tag-based structure. A free CFML server is available from the Open BlueDragon project, which is licensed under the GPLv3 and can be used freely on any web server.

Some good examples of code you would use over and over on a site would be your site header, or your site menu, or your site footer. All are relatively basic aspects of your site that usually don’t change much as a visitor moves from page to page throughout your site. This makes those aspects of your site perfect to use includes with.

Continue Reading “Use Includes with CFML” »
File Under: CSS

Update Your Old Site to Use Web Standards


Web standards? You can’t afford to ignore them anymore.

Just two years ago, coding your site to the emerging guidelines from the World Wide Web Consortium was next to impossible. After all, many surfers were still saddled with browsers from the days when Netscape and Microsoft deliberately built incompatible products.

But now, thanks to outspoken advocates such as the Web Standards Project (aka WaSP) and developers who refused to choose sides, browser makers have stopped using HTML as a weapon. Today’s browser offerings are more and more alike in their support of standards such as CSS and XHTML. Microsoft and AOL-Time-Warner-Netscape seem to have taken their battle to lock up consumers elsewhere.

The change comes just in time:Most sites’ million-dollar boom budgets have been cut to as low as a few thousand bucks. According to the WaSP’s official estimate, supporting incompatible browsers adds an average 25 percent to site budgets. So maintaining different code for two, three, or more browsers is no longer an affordable option.

Instead of trying to support multiple versions of the same pages, it’s much more cost-effective to piggyback on the millions of dollars Microsoft, Netscape, Opera, and others have spent building standards-compliant browsers and just stick to using standards-compliant markup on your site.

If you don’t, you may be relying on bugs instead of features to deliver the goods. They won’t work forever. And by focusing on specific browsers instead of one syntax that works for all of them, you may be locking out surfers with alternative Web gadgets or special technologies, such as talking browsers for the blind.

Still, times are tough. As one developer said, “Try telling your boss about standards when she just found out her accounting firm didn’t have any.” With that in mind, here are three simple, fast, cheap things many sites can do to come up to speed on standards and make your site less costly to maintain.

The first:One line that makes all the difference in the world.

Continue Reading “Update Your Old Site to Use Web Standards” »
File Under: Programming

PHP Tutorial for Beginners

PHP is a powerful scripting language that fits gracefully into HTML and puts the tools for creating dynamic websites in the hands of the people — even people like me who were too lazy to learn Perl scripting and other complicated backend hoodoo.

This tutorial is for the person who understands HTML but doesn’t know much about PHP. One of PHP’s greatest attributes is that it’s a freely distributed open-source language, so there’s all kinds of excellent reference material about it out there, which means that once you understand the basics, it’s easy to find the materials that you need to push your skills.

Continue Reading “PHP Tutorial for Beginners” »
File Under: APIs, Location

Get Started With Google Geocoding via HTTP

Google’s mapping API is one of the most-used application interfaces on the web. It’s largely responsible for the recent explosion of map-based mashups. The massive popularity of Google Maps has also given rise to a new word in the web developer’s lexicon — geocodes.

Maps require a latitude and longitude point to plot specific locations. Whenever you’re programming a custom map using Google’s API, you will nee to convert the relevant city name, ZIP code, or address to latitude and longitude points. This process is called geocoding.

Google currently makes the process available via the GClientGeocoder Javascript class. That JavaScript class makes the geocode available immediately to the browser. But sometimes, such on the fly access isn’t enough. We want to store location information for later use. In that case, we need another service to grab the geocodes permanently.

That’s where geocoding via HTTP comes in handy.

Continue Reading “Get Started With Google Geocoding via HTTP” »