Subnavigation
  • # Front Page
    Displays posts from every section of the site on one page.
  • # Blog
    Only show blog posts.
  • # Archive
    List of all posts for quick browsing.

Hosting
  • Anything is appreciated, even a dollar can cover my hosting costs for a while, depending on bandwidth usage.

Recent Comments
RSS Feeds
Friends
  • # Film Guys
  • # Josh Billions
  • # Charles Woods
  • # Gordon Lowrey
  • # Cody Girdlestone
  • # David Baines
  • # Ian Hamilton
  • # Henry B. Rosenbush
  • # Jimmy Cantrell
  • # IT Pros on the Go
  • # Paul Chater
  • # Locust Fork Journal
  • # Matt Friel
  • # Jamie Smith

  • Index

    Rolling out some updates later today hopefully...

    Posted on Saturday, May 22, 2010 at 10:13:10 AM.

    I've been really busy for the last few months, and on top of that haven't had a stable internet connection. At one point I had a router on the roof in a plastic bag; was the only place I could get a decent signal, unfortunately... and it was such a crappy signal that it wasn't worth building a waterproof enclosure because it would drop all the time and I'd have to reboot the router.

    Well, now I've got a good signal from the front part of the house (inside thankfully) and have a stable connection for the time being. Anyway, I've got lots of photos to upload, and lots of work to do... Hopefully I'll be able to get some photos uploaded today, and soon I will start blogging again.

    :] Gordo

    [Q]Comments (0)

    PHP: .htpasswd Access Functions

    Posted on Sunday, March 28, 2010 at 01:17:45 PM.

    This is for a friend who is learning PHP and trying to parse lines from a .htpasswd file... Following the full example below, this will work for any PHP enabled server, you don't need Apache anymore. ;]

    All he really needed (at the moment anyway) was this:

    // Loads htpasswd file into an array:
    // Array( username => crypted_pass, ... )
    function hta_open(){
        if ( !file_exists(HTPASSWDFILE)) 
            return Array();
        
        $res = Array();
        foreach(file(HTPASSWDFILE) as $l){
            $array = explode(':',$l);
            $user = $array[0];
            $pass = chop($array[1]);
            $res[$user] = $pass;
        }
        return $res;
    }

    But I was bored, so I extended it out a bit more...

    View the source: http://linuxinit.net/site/sviewer/?source=hta_functions.php

    Examples below:
    Once you learn more, consider extending this into a class.

    User Validation Example:
        $pass_array = hta_open();
        if ( hta_check( $pass_array,  $user, $pass ))
            print "Access granted."
    User Creation Example:
        $pass_array[$new_user] = rand_salt_crypt($new_pass);
        hta_add($pass_array);
        
        $pass_array[$new_user2] = rand_salt_sha1($new_pass2);
        hta_add($pass_array);
    Here's a real example of how to use what's been done so far:
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: public");
        
        require_once('hta_functions.php');
        $pass_array = hta_open();
        
        if (isset($_SERVER['PHP_AUTH_USER']) && hta_check( $pass_array,  $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] )){
            print("Welcome!");
            // Do stuff
        }else{
            header('WWW-Authenticate: Basic realm="Restricted Area"');
            header('HTTP/1.0 401 Unauthorized');
            echo 'Access denied. Please enter valid login credentials.';
            exit;
        }

    [Q]Comments (10)

    Been too long...

    Posted on Saturday, March 27, 2010 at 01:07:17 AM.

    I've been away from home for almost a month now... I have tons of photos to upload, but seem to have misplaced both of my card-readers. I have one at home, but last time I was there I forgot to offload all of the photos. Anyway, been looking for a job, got a few promising leads, but nothing concrete as of yet. The job market sucks right now... :[ Between that and car troubles, it's been a rough start to the year. It'll get better though, it has to. :]

    [Q]Comments (0)

    ❤ Brittney ❤

    Posted on Tuesday, February 9, 2010 at 07:16:47 AM.

    i love you          i love you
    i love you bri       i love you britt
    i love you brittney   i love you brittney
    i love you brittney lewis i love you brittne
    i love you brittney lewis i love you brittney
    i love you brittney lewis i love you brittney l
    i love you brittney lewis i love you brittney le
    i love you brittney lewis i love you brittney lewi
    i love you brittney lewis i love you brittney lewis
    i love you brittney lewis i love you brittney lewis
    i love you brittney lewis i love you brittney lewis
    i love you brittney lewis i love you brittney le
    i love you brittney lewis i love you brittney
    i love you brittney lewis i love you brittn
    i love you brittney lewis i love you b
    i love you brittney lewis i love
    i love you brittney lewis
    i love you brittney
    i love you br
    i love yo
    i lov
    i l
    i

    [Q]Comments (4)

    Christmas 2009

    Posted on Wednesday, January 13, 2010 at 12:29:44 PM.

    [Q]Comments (0)

    New Year's Eve - 2010

    Posted on Wednesday, January 13, 2010 at 10:26:48 AM.

    [Q]Comments (0)