Category: Resource Filled

  • Church Sign Generator

    Church Sign Generatorclick here and generate your own sign from God
    Here is a link to a little bit of Friday Fun, the Church Sign Generator. You enter text into four fields, press the ‘Go’ buttona and PRESTO … it re-draws a picture of a First Baptist roadside sign-from-God with your own compelling ‘n’ kitchy come-to-church slogans … sorta like the ones the author of the program lists on his own blog.

    How is this miracle of web wizardry achieved? I suspect the coder behind this fun read some sort of book or article on how to “Create graphics on the fly using PHP,” … or at least read the Image Functions section of the PHP manual.

    Man-o-man … does this give me a funny idea …

  • Knoppix – Delightfully Distracting

    There are things I like about the Microsoft IIS server solution. There are things I like about the Linux Apache webserver solution. Where I work, it is the former. But for my church web sites, it is the later. Part of it has to do with the cost But part of it is *NIX-like approach. Everything is a file. Add only what you need, when you need it. Don’t reinvent the wheel. Simple, brutal efficiency at the cost of assuming the user knew what he/she was doing and was able to read the manual without hand-holding.

    At least that is how it was. Now, just as Microsoft adds more and more networking and servers to their operating systems, so too is Linux adding quite a bit more user interface. That said, without a compelling reason, most individuals haven’t tried, spied or experimented with the new GUI breeds of Linux. Who wants to risk blowing up their valuable data by adding a partition and installing a cryptic operating system just to sneak a peek?

    Well fear not. Not only have recent installs for Linux become amazingly user-friendly and somewhat idiot-proof, but more recently, there are now distributions of Linux that run entirely from a CD. No partitioning, no formatting, no installation necessary. Which brings me to a very cool tool that goes by the name of Knoppix Linux.

    Knoppix is a GNU/Linux distribution that boots and runs completely from the CD. It includes several recent Linux software and desktop environments, such as OpenOffice.org, Abiword, The Gimp, Konqueror, Mozilla, and hundreds more quality open source programs.

    In other words, you can test drive Linux without having to install it on your hard drive!

    What more variety? There is a growing community if geeks creating what are called Knoppix Linux Documentation – Knoppix Customizations. These are ‘unofficial’ distributions of Knoppix offering a variety of interesting modifications. Some are reduced in size. Some in different languages. One adds various security tools. One even adds clustering capability.

    Moreover, if you want to do something crazy, you can remaster Knoppix so it loads the Apache webserver and mod_php on boot-up. Though for those of you without 3 gig to spare, and/ or those of you using Windows, you’re probably better off using Knoppix-customize, a tool that enables you to change boot options and files of a KNOPPIX ISO image or boot disk without .

    The point is, here is your chance to play without having to make a huge investment in time or resource. Just download the ISO. Burninate it to a CD. Boot from the CD. Spend all night exploring Linux.

    Those of you with wives should just have them complain to me directly for distracting you the rest of this weekend.

  • Honeypot for spam harvesters

    In case you didn’t know, a ‘Honeypot’ is usually a site, server, a page, sometimes even a network that is configured to draw the low-life, maggot-bearing flies that are spammers. In doing so, those setting the trap record the spammer’s IPs and user agents so they can be blocked, thwarted, poison, and other things spambots and spybots deserve.

    Mark Pilgrim showed us a version of one such Honeypot in his oft-quoted article, “How to block spambots, ban spybots, and tell unwanted robots to go to … ” … er … h-e-double-hockey-sticks. In the article, Mark shows us how to set up a page to snare those bot’s that ignore or abuse the Robot Exclusion standard. He then adds offenders to a growing .htaccess file to deny the pests access to his server.

    That was back in February. Almost half-a-year later, Merlin Mann at kung fu grippe shows us another ingenious catch and destroy method in his article entitled Honeypot for spam harvesters (now officially Project Honey Pot). Similar to an anti-spam technique for those leaving comments on blogs and bbs’ where one uses a throw-away email address built on the name of the blog and the date (e.g. hycw-21jun03@…), this article gives us a very simple PHP techinque to give spam harvesters what they want, an email address.

    Only the address they get is THEIR (the spammer’s) IP address and date sent back to them. Concurrently, the Honeypot records the IP, time and user agent to whom the address was distributed. If and when spam comes in via the harvested address, you have enough information to complain upstream, and to block that particular user agent and/or IP in the future. Pure genius I tell you!

    One caveat that the article offers, that I entirely agree with — use a throw-away domain name. Which I have. Hmmm .. perhaps a site with more than one technique? (what you don’t hear right now is the evil laughter billowing through the basement of my house !-)

  • Stupid Array Tricks in Perl

    Later tonight, I’m going to talk a little bit about security and ethics and things to keep in mind as church members come and go, or as you as a developer move from one church to another.

    Meanwhile, I’ve had a brain fade this morning. I forgot how to sort arrays in Perl. Good thing way back in June of this past year, I mentioned the Perl Circus as a “Resource Filled” site.

    Here is just what I needed to jog my memory:

    @arr1 = (“zero”, “one”, “two”, “three”, “four”);
    @arr2 = sort{$a cmp $b} @arr1; #in ascii order
    #or
    @arr3 = sort{$b cmp $a} @arr1; #in reverse ascii order
    @arr4 = sort{$a <=> $b} @arr1; #in numeric order
    print “@arr2”;

    RESULT: four one three two zero
    DISCUSSION: The sort function takes a block and an source array. It will use the block to determine how to order the array it returns. The variables $a and $b in the sort block are special and can be used to force the ordering from top-down ($a, $b) or from bottom-up ($b, $a). Beware that using cmp will sort according to the ASCII order of the array elements, while <=> will sort according to their numeric value.

    DUUUHH, I can’t believe I mentally misplaced something so simple as the above. Actually what I forgot was the difference between sorting alpha and numeric entities. I must be getting old. What am I saying? By most coder standards I am as old as dirt.

    So help out this gray covered (but still gargantuan) crainium of mine. How about some comments, who’s got a page full of good PHP array tricks? Python? I’d say VB.Net but their collections class is insanely addictive I dare not mention it …

  • Test your Speed!

    I’ve been up late the past few nights, working on the Redland Baptist redesign … don’t worry, I’m taking notes and I’ll share how I’ve hammered MovableType into a CMS. In the meantime, here is a VERY cool tool, actually a very cool set of tools, I ran across: Bandwidth Place’s Speed Test.

    This little beauty tests the speed of your Internet connection. In fact, it was the tool I used the other day to gauge my DSL speed when I reviewed the Calvary Temple Worship just to make sure it wasn’t a slow Internet connection on my side gumming up the works. As it turns out, Verizon is delivering me respectable 88.5 kilobytes per second.

    You may also notice on the Bandwidth Place’s Speed Test page, you can also test the speed of a remote server. This is an incredibly useful service to test how fast data is getting from your web server to the rest of the world. I’d suggest a 10k image, or downloading the 60k image they provide, which you can then FTP to your web server.

    The benefit of the server test is to make sure your web host provider’s connection is what they say it is. Or in my case 867.4 kilobits per second throughput, which translates into 105.9 kilobytes per second or 9.7 seconds for a 1mb file.

    While this is good news for me, it also means that I need to be careful when sitting at home with my nice fast DSL line developing web sites because both my web server and my DSL line are running faster than the reality of many of the individuals of my church who are still using a dail-up connection. Something those of us with bigger bandwidth sometimes forget about when developing a site.

  • the ESV Bible as a Web Service – API

    Remember last month, when I asked “What About Christian Web Services?” Remember when I listed a series of questions remarking that I was in touch with a major Bible publisher who responded to “An Open Letter to Christian Media Outlets” I posted back in July? Well now I can let the cat out of the bag.

    Late last December, I was contacted by Stephen Smith, the webmaster for the Holy Bible, English Standard Version website. ESV for short. When you were answering the questions posted as comments back in January, he was taking notes. It also didn’t hurt that some of you came up with web services of your own and used this web site as a means of working out the kinks. But I digress.

    Yesterday afternoon, I received the following email from Stephen, announcing that the ESV as the first major Bible publisher to offer their content via web services AND an Application Program Interface (API) similar to those offered by both Google and Amazon. Here’s what Stephen had to say:

    Dean,

    We’ve finished (for the most part–SOAP is still a little shaky) the technical implementation of the ESV Bible as a web service, and I anticipate final approval in mid-February. Based on the feedback you and others had, we made some changes to what I sent you previously.

    In the meantime, we’ve posted two documents for public comment:

    http://www.gnpcb.org/esv/share/services/ – introduction to the service and terms of use
    http://www.gnpcb.org/esv/share/services/api/ – description of the API

    We welcome any comments you may have. Thanks for helping us make this vision a reality.

    Do you understand what this means? Imagine infusing title arguments with Scripture “The Great Commission” so hyperlinks and acronyms have more meaning (i.e. when you hover your mouse over the link) ? Or perhaps rewiring a DHTML trick for long posts to expand Scripture references the actual Word of God? Imagine your Bible Studies, Sermons and Devotionals programatically able to incorporate the Bible in the form of fully annotated footnotes? Imagine the ability to get verses of Bible into countries that would otherwise ban it with a little proxy trickery?

    In other words, imagine if you will, applying Scripture to your online words in ways that are only limited by the imagination God has given us.

    As you can tell, I’m pretty giddy — and grateful to the good people over at the ESV for having the vision and courage to take these steps. I’ve already given the API a spin and I can tell you, it is as easy to implement as their well documented page indicates. And in case you missed it, they are looking for input. If nothing else, send them a thank you note.

    If I could ever find the time, I think the first cool tool I would create would be a MovableType plug-in that would take a custom Scripture reference tag and replace itself with the verses during generation. What about you? Go play with the API. Let the good people over at the ESV know what you think. Then come back an share your thoughts, ideas and visions. I’d be very interested to hear about them — perhaps now, it will get the attention of some other publishers — or at least help out the one who is already listening to us!-)

    Thanks Stephen you really made my week!

  • Sermonizer::Scripturizer

    UPDATE * 30-mar-03,  UPDATE2 * 14-Feb-04 this code has been modified and updated (twice). Please refer to the article entitled “Scripturizer 1.2, now with MT Plugin-ability” for a new and improved version that also includes a MovableType plugin.

    I’ve been working on a tool that will take sermons from my pastor and format and post them to my church web site. The first and biggest step was “scripturizing” – that is, hyperlinking Scripture References to the BibleGateway. Which we did in my article entitled “Scripturizer – core engine.”

    One of the excellent comments I recieved (from Jonathan Fox) mentioned that my original implementation was a bit too “greedy” … meaning that phrases such as “my new job will start if john acts up” would have “Scripturized” job, john and acts even though they were not scripture references. Moreover, the BibleGateway link would not validate due to not encoding the & sign. So I wrote a subroutine that would make sure we were dealing with verse/references and would encode properly.

    Once this was done, the next step was to convert it into a Perl module so it could be reused in any variety of situations. Please to not breeze past this point. Regardless of the language you prefer, abtracting your work into modules and classes is an important time saver downline as are common practices in the world of software resuability and reliability. If you don’t believe me, just check out the CPAN – which is the primary reason I still prefer Perl for many projects.

    You can find some pretty good how-to information regarding Perl Modules over at the Perl Circus for as long as that site lasts. The end product is something that looks like this (sans comments):

     package Sermonizer::Scripturizer;
     #############################################################
     # Sermonizer::Scripturizer             (c) 2002 Dean Peters #
     #                      http://www.healyourchurchwebsite.com #
     #############################################################
     #   This package hyperlinks Scripture references in text    #
     #############################################################
     require Exporter;
     @ISA = qw(Exporter);
     @EXPORT = qw(addLinks encodePassage);
    
    sub addLinks {
        my @data = @_;
        my @output;
    
       my $volumes = "I+|1st|2nd|3rd|First|Second|Third|1|2|3";
        my $books = "Genesis|Exodus|Leviticus|Numbers|Deuteronomy|Joshua|Judges|Ruth|Samuel|Kings|Chronicles|Ezra|Nehemiah|Esther|Job|Psalm|Proverbs|Ecclesiastes|Song of Solomon|Isaiah|Jeremiah|Lamentations|Ezekiel|Daniel|Hosea|Joel|Amos|Obadiah|Jonah|Micah|Nahum|Habakkuk|Zephaniah|Haggai|Zechariah|Malachi|Matthew|Mark|Luke|John|Acts|Romans|Corinthians|Galatians|Ephesians|Philippians|Colossians|Thessalonians|Timothy|Titus|Philemon|Hebrews|James|Peter|Jude|Revelation";
        my $link  = "http://biblegateway.com/cgi-bin/bible?language=english&version=NIV&passage=";
    
       foreach (@data) {
           # include instances of James 2:1-13, 14 - 16, 17 & 18
           my $verses = qr{ \d+ (: \d+)* \s* (?: [-&] \s* \d+)*    }x;
           my $passage;
    
          # don't just match, replace
           s/
              (?:($volumes)\s*)*         # any number of vols.
              \s*
              ($books)                               # the book
              \s*
              ( $verses (?: \s* , \s* $verses)* )
           /$passage = ($1 ? "$1 ":"").($2 ? $2:"").($3 ? " $3":"");
           "<a>$passage"
           /gcex;
    
          push (@output, $_);
        }
        return @output;
    
    }
    
    sub encodePassage {
    
       my ($vol, $bk, $ver) = @_;
        $ver =~ s/:/%3A/gi;          # convert to encoded colon
        $ver =~ s/[,&;]/%2C/gi;       # convert to encoded comma
        $ver =~ s/\s*//gi;
        my $passage = ($vol ? "$vol+":"").($bk ? "$bk+":"").($ver ? "$ver":"");
        return $passage;
     }
    
    1;
     __END__
    
    =head1 NAME
    
    Sermonizer::Scripturizer - hyperlink Scripture references in text
    
    =head1 SYNOPSIS
    
    use Sermonizer::Scripturizer;
     foreach (addLinks()) { print $_; }; 
    
    =head1 DESCRIPTION
    
    Sermonizer::Scripturizer searches a text stream and replaces any
     instances of a Scripture reference with a hyperlink to the to the
     Bible Gateway online Bible.
    
    =head1 BUGS
    
    Need to allow user to define which online Bible to use
     Need to not link up Scripture already linked
     It's probably make sense to create instance variables global to the scope of the module to contain the book volumes, etc.
    
    =head1 AUTHOR
    
    Copyright Dean Peters 2002, 
    
    =head1 EXAMPLE
    
    BEGIN { push(@INC, "C:/Inetpub/wwwroot/perl/lib/"); }
     use Sermonizer::Scripturizer;
    
    my $filename = "sermon01.txt";
     open(FILE, $filename ) or die "Couldn't open the file '$filename'. \n$!";
    
    foreach (addLinks()) {
        print $_;
     }
     close FILE;
    
    =cut

    Installation and Use

    I suspect a number of you will have some problems with your scripts not finding “Sermonizer::Scripturizer” … an error that reads “Can’t locate Sermonizer/Scripturizer.pm in @INC (@INC contains: /perl/lib /perl/sit
    e/lib .)
    “. This is because the @INC array contains a list of directories that are use to search for all external files/modules that are used by the perl script – and Scripturizer.pm ain’t in that path. Since the @INC array tells the Perl interpreter where to look for the files/modules/external scripts you need to create as subdirectory named “Sermonizer.” Then you copy Scripturizer.pm into that directory. Then atop perl program that needs ‘Scripturizing’, you write ‘BEGIN { push(@INC, “C:/Inetpub/wwwroot/lib/”); }‘. In the end, your test script may look like this:

    BEGIN { push(@INC, “C:/Inetpub/wwwroot/perl/lib/”); }
    use Sermonizer::Scripturizer;

    my $filename = “sermon01.txt”;
    open(FILE, $filename ) or die “Couldn’t open the file ‘$filename’. \n$!”;

    foreach (addLinks(<FILE>)) {
    print $_;
    }
    close FILE;

    As always, your mileage may vary

  • W3Schools Online Web Tutorials

    Completely Free Web Building Tutorials – Inside W3Schools you will find a large number of free Web building tutorials, from basic HTML and XHTML tutorials, to advanced XML, XSL and WAP tutorials.

    Sometimes, the best things in life are indeed free.