Blog

  • 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.

  • PERL program for linking Scripture references

    Here is an article that explains how the author used PERL script to interface thousands of Bible quotations with Bible Gateway. Included on the page is a link to a program that runs through a document an ‘Scripturizes’ Bible references. What I mean by ‘Scripturize’ is that it takes a Bible reference and converts it a hyperlink at the BibleGateway.

    I thought this might be useful to our discussion regarding regular expressions and fun stuff like that. Mostly because I suspect any of you who want to post sermons and Bible studies may also want to do the same. Granted, bib.pl was written back in 1998, so it employs some ‘old-school’ Perl parsing techniques. And later this week, we’re going to see how much of this can be reduced to a simple regular expression. Still, it offers some features and approaches we need to consider in our own “Scripturizer” application.

    One thing it does that my own concept didn’t … it deals with abbreviations for Bible book names..

  • /^Reg(ular)*\s*Exp(?:ression(s)*)*/gi

    For those of you looking to shoot your foot clean off with some programming fun, may I suggest some study in a dialect of pure geek otherwise known as regular expressions … please, you can stop screaming NNNNNNNNOOOOOOOOOO now.

    Arguably the most powerful of text manipulation tools, regular expressions allow you match and/or modify variant text blocks. For example, the following snippet allows me to find books of the Bible within a given text block:
     


    my $BibleBooks = “Genesis|Exodus| … |Jude|Revelation”;
    my $varTextBlk = “In the book of Exodus we find a reference to Genesis …

    if ($varTextBlk =~ m/$BibleBooks/gi) { …

     
    Pretty nifty eh? Well, yes, only if you can actually create some compelling content with it. And I intend to do just that in the form of a little script that will look through text and tag Scripture references to the BibleGateway … yeah, I knew that’d get your attention.

    But before I can make sense of my ‘Scripturizer’ script, you’re going to need to do some homework (you may begin screaming again) … here is a suggested reading list of mostly Perl-centric approaches to regular expressions:

  • Lorem Ipsum Generator

    For
    this Friday’s fun, something productive – programs that fill your page full of the type of compelling content that is likely to get your church web site critiqued here, and/or your commercial web site ‘analyzed’ by Vincent Flanders.

    To it is with goulish pleasure that I treat you with Mean Dean’s Semi-Definitive List of Lorem Ipsum Generators (*bonus* my comments in bold case) :

    • I still can’t believe someone wrote a Dreamweaver Extension for this:
      Subterrane – lorem ipsum generator – This version of Lorem Ipsum is based on the code written by Captain Cursor, aka Taylor, originally distributed as a Dreamweaver extension and was later adapted by Travis Spencer. This web version by Will Munslow (Subterrane). It’s essentially just stolen outright and tweaked barely to post the data to a form field instead of the clipboard.

      This code is public domain. Taylor and Travis don’t care if you tweak it, bend it, send it, sell it, etc. (So I stole it!)

       

    • The page actually contains some compelling content by documenting the history of the Internet’s must abused filler:
      Lipsum.com – Lorem Ipsum, or Lipsum for short, is simply dummy text of the printing and typesetting industry. Lipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book …. Visit the site for more compelling history.

       
    • This page has a neat picture of a monkey at a typewriter … hmmm … good metaphor … wonder if it has been used?
      i-r-genius.com – Lorem Ipsum Generator
      This page will generate random lorem ipsum with convincing sentence and paragraphing constructs. Just fill in the fields below to suit your needs and a customised random load of pseudo-latin guff will be sent back to you. There is an 100K limit, to stunt the ambitions of l33t haX0rz with novelty DOS attack plans.

       
    • MangyDog.com presents: The Random Dr. Phil Quote Generator
      During these times of trouble and turmoil, nothing sedates a soul or stifles common sense quite like words of wisdom from Dr. Phil.
      Whoops, how Freudian of me … oh well, too late to strike it from the list!

       
    • Want to wind up on next year’s hall-o-horrors? Then you need to roll-your-own generator. Here’s how:
      SourceForge: Development: Tutorial: Drag and drop saving
      This tutorial shows how to write a simple Lorem Ipsum generator, with drag-and-drop saving. It also shows how to add extra widgets to the savebox.
  • The (not so evil) Color Schemer

    Last week, I preached on the evils of color inconsistency. One of the comments to that post reminded me of yet another useful tool for warding off bad color combos: Color Schemer – Online Color Scheme Generator.

    A word of caution though. Just because this chart offers 16 colors, doesn’t mean you have to use them all!

    Remember, in order for colors to be effectively used as visual cues, you need to make sure they have enough contrast soas not to get lost in the background, and used sparingly enough TO MAKE SURE IT DOESN’T LOOK LIKE YOU’RE YELLING AT US ALL THE TIME, FOR ALL YOUR LINKS ON ALL YOUR TOPICS JUST THE SAME WAY WE STOP READING EMAILS SENT TO US BY OUR AUNT RUTH WHO JUST GOT A NEW COMPUTER AND AN AOL ACCOUNT AND WHO HASN’T LEARNED THE JOYS OF THE CAPS KEY!

  • Son of Not So Simple Redirect

    Some good email going back-n-forth on this redirect issue. The funniest being NZ’s reply to one of us who said “work through your service provider” to which he responded with a very politely worded version of “duh!” Sometimes we geeks tend to throw stuff out there like spagetti – these last few pieces sliding down the wall under the category of “stating the obvious.”

    Grins’n’giggles aside, I wanted to cover some of the information that has been exchanged. Keith Devens writes: “Just for reference, here’s the mod_write redirect, but it’s expensive because
    Apache has to do a sub-request on every request. It’s basically something like
    (this assumes they’re on different servers):

    RewriteEngine on
    RewriteCond %{HTTP_HOST} wmdi.com
    RewriteRule . http://www.truthlaidbear.com/blogmd/%{REQUEST_URI}

    Anders Jacobsen adds I’ve used Apache redirect a lot myself, and it works like a charm.

    Keith; the solution you are proposing is very ISP specific, and if they make it that easy for you to set up virtual hosts (at no extra charge) something makes me think that they aren’t using “Real” virtual hosting (i.e. separate IPs for all virtual hosts). I use pair.com, and an explanation of their policy can be found here…

    I personally have been so busy with my ‘real job’ that I haven’t had a chance to test out these various approaches – or some variation on a theme. Though I did have some redirect fun at the expense of an individual who has been harassing a member of Redland Baptist Church. This individual, frustrated by the court system, has linked some pages of Redland’s website – why? I don’t know. Though we were recently spammed. Perhaps that same someone wants others to do the same? Regardless, because the RBC site implements Server Side Includes, I have been able to take any traffic from identifiable ‘hate pages’ and give them an entirely different message. Here’s an example from the staff/contacts page at RBC

    <!–#if expr=”($HTTP_REFERER = /ImaBigJerk\.com/) ” –>
    <h4>All inquiries via the Big Jerk should be referred to our attorney at …
    </h4>
    <!–#else –>
    <!–#include virtual=”/includes/contactinfo.shtml” –>
    <!–#endif –>

    I’m going to return to this issue later this week when I figure out a solution, but until then, here are some resources you may find useful in your quest to redirect:

    In the meantime, try tinkering with the following that I found via the support page at Prestwood.com – as this is where I’m going to start once I get some free time:

    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /
    # Rewrite Rule for machine.domain-name.net
    RewriteCond %{HTTP_HOST} machine.domain-name.net$
    RewriteCond %{REQUEST_URI} !machine/
    RewriteRule ^(.*)$ machine/$1
    … The Israelites are wandering around the land in confusion … Exodus 14:3
  • Not so Simple Redirect

    From time to time, redirecting users is necessary. Take for example the a request/email I got from N.Z.Bear over at “The Truth Laid Bear:”

    I finally got www.wmdi.org up and running. But here’s the deal:
    … I’ve currently got all our stuff (weblog & forums) in a subdirectory of
    TTLB: http://www.truthlaidbear.com/blogmd … So, I have a DNS forwarding service routing all requests for www.wmdi.org to 216.218.144.66, which is the IP address of www.truthlaidbear.com

    In theory, I thought I would be able to use my .htaccess file to
    implement mod re-write rules that would then allow me to transparently send
    any requests to www.wmdi.org/blah to www.truthlaidbear.com/blogmd/blah …

    Being that I’ve been remiss in helping NZ out with the WMDI, I figured I’d better reply him with some solutions. Here are four that you might also find useful if/when you run into a similar situation with your church web site. The first requires you add the following line to your .htaccess file in your website’s root directory – assuming you have a Linux/Apache configuration.

    Redirect temp /blah http://www.truthlaidbear.com/blogmd/blah

    Since NZ wants to redirect everything incoming to the /blah directory, he would need to modify the .httacess in his /public_html and/or the /www directory. The status argument [temp|permanent|seeother|gone] is only available in Apache 1.2 or later.

    Keep in mind, redirect directives take precedence over Alias and ScriptAlias directives, irrespective of their ordering in the configuration file. Also, Url-path must be an absolute path, not a relative path, even when used with .htaccess files or inside of <Directory> sections. Finally, don’t forget to chmod -644 that .htaccess file.

    Then there are programatic approaches. First in PHP, then in Perl.

    // —————- index.php ———————–
    <?php
    header(“Location: http://www.truthlaidbear.com/blogmd/blah”);
    ?>
    #!/usr/bin/perl
    # —————- index.cgi ———————–
    $url=”http://www.truthlaidbear.com/blogmd/blah”;
    print “Location: $url\n”;
    exit;

    Being programatic approaches, this would mean you need to places these files in the “FROM” directory (/blah) and then chmod -755 the script files so you’ll know they execute. You also need to make sure your server is set up to look for index.cgi and/or index.php the same way it looks for index.html. This is default on most Linux/Apache configs, but if you mileage varys, then you may need to add the DirectoryIndex directive to your .htaccess file.

    Of course, many of you who now have Linux/Apache set-ups do so through host providers that give you nifty little control programs such as CPANEL that let you set up redirects and such w/out having to SSH and PICO your way to fun and frustration – wimps.

    And speaking of lightweight – there is always the HTML based solution:

    <META HTTP-EQUIV=”Refresh” CONTENT=”0; URL=http://www.truthlaidbear.com/blogmd/blah”>

    However, I’m not too fond of this one because it “blinks”, it sometimes fails, and it breaks the back button. That and its not as flexible as the above solutions, as you’ll see in blog a bit later how I’m dealing with someone linking the Redland site via a hate page. You know, the whole returning evil with good thing – more on that later.

  • Mean Dean’s Anti-spam Obfuscator

    Enjoying so many hits from /., I figured I better give the geeks something worthwhile. Here is an article I posted back in late June of this year. For those of you who need to post your email address on your website, this should help:

    With apologies to Edwin Star, and sung to the tune of his populist hymn "War,"
    let us put forward in full-throated conviction:

    spam, HUH!
    What is it good for?
    Absolutely nothing – say it again,
    spam HUH!
    What is it good for?
    ABSOLUTELY NOTHING

    Anyone who has run a church web site for any period of time has had to deal
    with call from the pastor asking why he’s getting spam for porn sites – well,
    at least I hope your pastor is complaining about that !-) How does this happen?
    Easy, you put the pastor’s email address up on the web, then indexed the site
    with various search engines (even though Google still hasn’t got mine right)
    and then you sit back and wait for spambots to come visit your site, slurping
    down all your email addresses – later using them to bombard you with an insidious stream of ads for snake-oil, getting rich quick or attempting to lure you into oggling their dysfunctionally licentious wares.

    There are several ways to handle these ‘bots, methods I’ll be talking about
    in the next few weeks that I’ve found moderatly successful. I say moderatly
    because there is no full-proof method, especially as church staff gives away
    their email address to various online vendors and e-zines, unwittingly "opting-in"
    to a world of virtual hurt. That said, the damage from bots can be minimized
    provided you understand what they are and how they work.

    Essentially these ‘bots’ are software programs that act as browsers, sucking
    down your content the same way MSIE or Netscrape does. Only these programs toss
    out everything except hyperlinks, and email addresses. Anyone familiar with
    Perl understands how easily this can be accomlished with a combination of LWP, HTML::Entities
    and HTML::TokeParser. Regardless of the language, these bots traverse the found
    links, and sell/store the email addresses either to spam you, or to sell our
    email address to other spammers.

    The trick then is to either mangle or ‘hide’ your email in plain site. One way
    to do this is to use NUMERIC or HEXADECIMAL encodings, that is use codes instead of characters
    to represent your email address. The advantage to this is that when a normal/nice visitor clicks on your link to an
    email address, it works just fine. But for the spambots, they either send their tripe to an invalid email address because they
    didn’t unencode it – which raises their operating costs and adulterates any list they’re selling — or they miss harvesting the address altogether because it doesn’t ‘look-like’ your average everyday email address.

    This technique was the topic of conversation over at A
    List Apart
    in which Dan Benjamin offers the NUMERIC encoded approach in combination
    with Javascript. This is a very good approach, up to a point. Considering that up to 20% of those
    on the web have Javascript turned-off on their browsers and keeping in mind what I said about the use various of CPAN libraries,
    this approach may not be well suited for your site &/or audience. So instead, what
    I offer is a sans-javascript approach that randomizes elements of the e-mail address between HEX, NUMERIC encodings, along with a salting of plain old characters. Unless
    the “industrious” spammer has taken the time to build a smart flexible ‘bot, then I’m safer using my ‘obfuscated’
    address as opposed to hanging one out there in plain text. I also encode the
    "mailto:" in a further effort to make email links look-n-feel like
    hyperlinks. To wit, I offer you the following little application:

    Mean Dean’s Anti-Spam E-Mail Address Obfuscator

    Go ahead, give it a try, then try some others like the one mentioned at A
    List Apart
    . What I’m hoping is that many of us will use a wide variety of anti-spam approaches. My thinking is that if we all used the same obfuscation tool, then spambots would have our lunch and eat it too. The more tools, the more moving targets. The ‘bot-heads, being a lazy and unoriginal bunch, would hopefully ignore us.