Holy crap, I need to slow down on the downloads or Comcast is going to shut me down! In my defense, I did change from Sugarsync to Dropbox this month. This usage is from uploading my documents, photos and music to the cloud.

, ,

Use the following commands to enable and disable sites in Apache 2.

# enable site
sudo a2ensite

# disable site
sudo a2dissite

# enable an apache2 module
sudo a2enmod

# e.g. a2enmod php4 will create the correct symlinks in mods-enabled to allow the module to be used. In this example it will link both php4.conf and php4.load for the user

# disable an apache2 module
sudo a2dismod

# force reload the server:
sudo  /etc/init.d/apache2 force-reload
, , ,

I recently developed a script that will geocode an address for work. Bellow is the simple PHP function that I’m using to geocode an address and get the lat and lng results. Simply pass the address to the function.

define("GOOGLE_MAPS_HOST", "maps.googleapis.com");
function google_geocode_address($address) {
 
	// Create the URL to retrieve the XML file
	$request_url = $base_url . "&address=" . urlencode($address) . '&sensor=false';
        $base_url = "http://" . GOOGLE_MAPS_HOST . "/maps/api/geocode/xml?";
 
	// Load the XML file
	$xml = simplexml_load_file($request_url) or die("url not loading");
	$status = $xml->status;
 
	// If the returned status was OK, then continue
	if($status == "OK") {
		$coords['lat'] = $xml->result->geometry->location->lat;
		$coords['lng'] = $xml->result->geometry->location->lng;
		return $coords;
	}
	// Anything other than OK, return false.
	else {
		return false;
	}
}