<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>World Wide Creations Scripts</title>
	<atom:link href="http://www.worldwidecreations.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.worldwidecreations.com</link>
	<description></description>
	<lastBuildDate>Mon, 25 Aug 2008 15:37:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Finding Age Ranges With MySQL</title>
		<link>http://www.worldwidecreations.com/finding_age_ranges_with_mysql.htm</link>
		<comments>http://www.worldwidecreations.com/finding_age_ranges_with_mysql.htm#comments</comments>
		<pubDate>Mon, 25 Aug 2008 15:37:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[between]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[birthdays]]></category>
		<category><![CDATA[curdate]]></category>
		<category><![CDATA[date_sub]]></category>
		<category><![CDATA[interval]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.worldwidecreations.com/?p=116</guid>
		<description><![CDATA[If you have ever stored a birth date in a MySQL database, it will not take long before you figure out that timestamps can be somewhat useless.  They are only good for dates between 1970 and 2038 on most systems.  Trying to find an age range using a Unix timestamp will uterly fail, especially if [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever stored a birth date in a MySQL database, it will not take long before you figure out that timestamps can be somewhat useless.  They are only good for dates between 1970 and 2038 on most systems.  Trying to find an age range using a Unix timestamp will uterly fail, especially if you want a platform independent solution.</p>
<p>There is a simple way to do this, and that is to first of all, save the birth dates in a &#8220;date&#8221; type field.  This will usually be by default a pattern like so &#8220;YEAR-MONTH-DAY&#8221; or &#8220;0000-00-00&#8243;.  Once your dates are in that format, you can use MySQL to do a comparison like so:</p>
<pre>select * from user where birthday between DATE_SUB(CURDATE( ),INTERVAL 59 YEAR)</pre>
<pre>and DATE_SUB(CURDATE( ),INTERVAL 50 YEAR);</pre>
<p>This will give you results from the &#8220;user&#8221; table for users who are between the ages of 50 to 59 providing that the birthday column is a &#8220;date&#8221; type.  It actually took me a while to figure this one out because I cannot ever remember needing such a data result.  Searching around the Net, I found no examples on how to exactly do this, so I hope this will help someone else a few hours of coding. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/finding_age_ranges_with_mysql.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hannafords Security Breach Affecting Paypal</title>
		<link>http://www.worldwidecreations.com/hannaford_security_breach_affecting_paypal.htm</link>
		<comments>http://www.worldwidecreations.com/hannaford_security_breach_affecting_paypal.htm#comments</comments>
		<pubDate>Wed, 26 Mar 2008 00:04:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Card]]></category>
		<category><![CDATA[Debit]]></category>
		<category><![CDATA[Hannafords]]></category>
		<category><![CDATA[Paypal]]></category>

		<guid isPermaLink="false">http://www.worldwidecreations.com/hannaford_security_breach_affecting_paypal.htm</guid>
		<description><![CDATA[So I get an email from Paypal today:
Dear XXXX,

We have been informed that your PayPal Debit Card number may have been obtained by an unauthorized party as a result of a security breach at a merchant where your debit card was used to make a purchase. The security of your PayPal account information was not [...]]]></description>
			<content:encoded><![CDATA[<p>So I get an email from Paypal today:</p>
<pre>Dear XXXX,</pre>
<pre>
We have been informed that your PayPal Debit Card number may have been obtained by an unauthorized party as a result of a security breach at a merchant where your debit card was used to make a purchase. The security of your PayPal account information was not compromised in connection with this event. To help ensure your security, we have taken the proactive step of cancelling your PayPal Debit Card. To request a new debit card, please follow the instructions below:</pre>
<pre>
   1. Log in to your PayPal account by opening a new browser.</pre>
<pre>   2. Click the "ATM/Debit Card" link in the footer of any PayPal page.</pre>
<pre>   3. Click "Request Debit Card."</pre>
<pre>   4. Make sure your name and address are correct.</pre>
<pre>   5. Click to confirm that you have read and agreed to the PayPal MasterCard ATM Debit Card Agreement.</pre>
<pre>   6. Click "Submit."</pre>
<pre>
We also suggest that you check your recent History Log for any unauthorized activity. If any unauthorized activity has occurred with your PayPal Debit Card, please follow the instructions below to dispute the charge:</pre>
<pre>
   1. Log into your PayPal account and click the 'Contact Us' link, located at the bottom of any PayPal page.</pre>
<pre>   2. Click on the 'Contact Customer Service' link.</pre>
<pre>   3. Select 'PayPal Debit Card' from the 'Choose a Topic' box.</pre>
<pre>   4. Select 'Unauthorized Transactions' from the 'Choose a Subtopic' box.</pre>
<pre>   5. Click the 'Affidavit Of Disputed PayPal ATM/Debit Card Transactions' link.</pre>
<pre>   6. Once completed, click 'Preview this Form'</pre>
<pre>   7. Click on ‘Print Form’</pre>
<pre>
You can fax the affidavit to 303-395-XXXX or mail it to:</pre>
<pre>
PayPal, Inc.</pre>
<pre>Attn: Debit Card Chargebacks</pre>
<pre>PO Box 45950</pre>
<pre>Omaha, NE 68145-0950</pre>
<pre>USA</pre>
<pre>In order to process claims for unauthorized account access in a timely manner, we must receive the affidavit within the first 60 days from the date of the transaction.

We want to assure you that security is a top priority at PayPal, and we appreciate your business.

Sincerely,

PayPal Account Review Department
PayPal, an eBay Company</pre>
<p>Assuming it to be a scam but noticing there was not even one link in the email, I go to a local ATM to see and sure enough, the card is declined.  I then find <a href="http://forums.ebay.com/db2/thread.jspa?messageID=2009798496쪅">this thread</a> over at the Ebay forums.  Having used my Paypal debit card at Hannafords over the last 6-8 months it seems to have gotten my card destroyed.  According to those at the Ebay forums, 15-20% of all Paypal debit cards were deactivated today.</p>
<p>Surely Paypal and/or Mastercard could have sent out the new cards first and then waited 7 &#8211; 10 days before canceling the old one?</p>
<p>No official release has been made by Paypal at the time of this writing.</p>
<p>According to others who have called Paypal, this move was requested by Mastercard.   It is not known if other cards bearing the Mastercard logo that were used at Hannafords have been affected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/hannaford_security_breach_affecting_paypal.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Sitemap Generator MemoryError Workaround Fix</title>
		<link>http://www.worldwidecreations.com/google_sitemap_generator_memoryerror_workaround_fix.htm</link>
		<comments>http://www.worldwidecreations.com/google_sitemap_generator_memoryerror_workaround_fix.htm#comments</comments>
		<pubDate>Wed, 06 Feb 2008 19:27:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[around]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[sitemap]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.worldwidecreations.com/google_sitemap_generator_memoryerror_workaround_fix.htm</guid>
		<description><![CDATA[If you have ever used the Google Sitemap Generator python script on a busy Linux/Unix server where your access logs grow huge, chances are you have run into this error:
MemoryError
Basically, the script is calling the entire log file into memory before parsing it, and depending on your log file size and amount of memory on [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever used the <a href="https://www.google.com/webmasters/tools/docs/en/sitemap-generator.html">Google Sitemap Generato</a>r python script on a busy Linux/Unix server where your access logs grow huge, chances are you have run into this error:</p>
<pre>MemoryError</pre>
<p>Basically, the script is calling the entire log file into memory before parsing it, and depending on your log file size and amount of memory on your machine, this could just be too much for it.  So what do you do now?</p>
<p>Myself, I did what I assume you are doing right now and began Googling for answers, and other than an old fix for an older version (which didn&#8217;t work for the latest), nothing fixed the issue.</p>
<p>I just sat there wondering how I was going to shrink this log file down so the script could handle this, especially when I wasn&#8217;t there to monitor it (i.e. a cron job).  I asked myself, &#8220;I wish I could just <em>split</em> it into smaller files&#8221;&#8230; Finally, the light came on: Duh, isn&#8217;t this one of the reasons the split command was created?</p>
<p>So I wrote up this little shell script that I could call via cron and placed it in a non web-accessible directory named sitemap (download <a href="http://www.savedpage.com/338/Split-access-logs-for-sitemap.html">here</a>):</p>
<pre>cd /home/username/sitemap

rm -f log-*

rm -f access_log

cp /var/log/access_log ./

split -l 50000 access_log log-

/usr/local/bin/python2.4 /home/username/sitemap/sitemap_gen.py  --config=/home/username/sitemap/config.xml</pre>
<p>This worked like a charm.  So what is happening here?</p>
<p>When the script is executed, it deletes all files in the sitemap directory that start with log- and the file access_log, copies the access_log file from the /var/log directory, splits the file into smaller files of 50,000 lines each, and then executes the sitemap generator.</p>
<p>The sitemap generator allows you to use a wild card for access logs, so I just told it my log starts with log- in my config.xml file:</p>
<pre>&lt;accesslog path="/home/username/sitemap/log-*" /&gt;</pre>
<p>That was it!  It can now handle any size log file.  Now if you still get the MemoryError error, try reducing the size of the split files to less than 50000.</p>
<p>Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/google_sitemap_generator_memoryerror_workaround_fix.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stopping SPAM BEFORE the door with Spamcop &amp; IPTables</title>
		<link>http://www.worldwidecreations.com/stopping_spam_before_the_door_with_spamcop_iptables.htm</link>
		<comments>http://www.worldwidecreations.com/stopping_spam_before_the_door_with_spamcop_iptables.htm#comments</comments>
		<pubDate>Wed, 10 Oct 2007 05:29:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[mailscanner]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassassin]]></category>
		<category><![CDATA[spamcop]]></category>

		<guid isPermaLink="false">http://www.worldwidecreations.com/stopping_spam_before_the_door_with_spamcop_iptables.htm</guid>
		<description><![CDATA[As many of you who are stuck with the task of administering your own server know, SPAM is one giant pain in the neck.  There are usually fifty other things you would prefer to be doing than finding new ways to defeat spam.
For those of us using Sendmail on some flavor of Linux, there [...]]]></description>
			<content:encoded><![CDATA[<p>As many of you who are stuck with the task of administering your own server know, SPAM is one giant pain in the neck.  There are usually fifty other things you would prefer to be doing than finding new ways to defeat spam.</p>
<p>For those of us using Sendmail on some flavor of Linux, there are a few ways to slow down the barrage of junk coming in.  Spamassassin, MailScanner, etc., and of course there are always black lists.  One of the more popular is <a href="http://www.spamcop.net/">Spamcop</a>.  Spamcop can plug right into the Sendmail configuration files.  It checks a sender against a known database of spamming IP addresses and will deny mail delivery. (More below)</p>
<p><!-- Default Block: default DISABLED-->
</p>
<p>This method is fine and will work but would it not be nice to take it a step further and once Spamcop has denied a sender, to just block them from even knocking on the mail servers door?  Not only would this reduce the overhead of a Sendmail child, it would also stop another query to spamcop.net saving myself and them a bit more overhead/bandwidth.</p>
<p>After examining the maillog file generated by Sendmail, I found I was able to easily parse out the IP addresses of offending senders.  From there, it was as simple as issuing a drop to IPTables of that IP.  Basically this tells your Linux firewall to refuse connections from the IP address.</p>
<p>This worked good at first but I found that running a cronjob to go through the mail log and ban IP&#8217;s got rather resource intensive so I decided to rewrite it a bit so it had a memory and would only ban IP addresses that haven&#8217;t already been banned.  This saved a lot of overhead.</p>
<p>After thinking about it a bit, I also decided that dropping the IP totally was overkill.  Many of these spam bots are just home users who have no clue on how to secure their PC and why should I deny these idiots access to my websites/advertising?  So I rewrote it just to block them from accessing port 25 (my SMTP port).</p>
<p>Here is the Perl script:</p>
<pre>## The port you wish to block (25 is the normal SMTP port).</pre>
<pre>my $port = 25;</pre>
<pre>## Path to where you want the ip_hash.txt file stored (ip database of previously dropped IP's) - NO TRAILING SLASH!</pre>
<pre>my $path_to_ip_hash = '/home/anywhere';</pre>
<pre>## You should change the path here to where you uploaded serialize.pm.  Cron env probably won't find it otherwise.</pre>
<pre>use lib '/folder_where_this_file_is_located';</pre>
<pre>## Path and name of the maillog file.</pre>
<pre>my $maillog = '/var/log/maillog';</pre>
<pre>## Location of iptables.</pre>
<pre>my $iptables = '/sbin/iptables';</pre>
<pre>####################################### No more editing required #######################################</pre>
<pre>use serialize;</pre>
<pre>## If you need the serialize module, it is located here: http://www.hurring.com/scott/code/perl/serialize/</pre>
<pre>my $y = 0;</pre>
<pre>if ($ARGV[0] eq 'flush') {</pre>
<pre>my %ip_flush = ();</pre>
<pre>my $ip_flushed = serialize(\%ip_flush);</pre>
<pre>open (IPS, '&gt;' . $path_to_ip_hash . '/ip_hash.txt');</pre>
<pre>flock(IPS, 2);</pre>
<pre>print IPS $ip_flushed;</pre>
<pre>close IPS;</pre>
<pre>print "List flushed\n";</pre>
<pre>exit;</pre>
<pre>}</pre>
<pre>open (IPS, $path_to_ip_hash . '/ip_hash.txt');</pre>
<pre>flock(IPS, 2);</pre>
<pre>my $ip_hash = &lt;IPS&gt;;</pre>
<pre>close IPS;</pre>
<pre>my $ip_list = unserialize($ip_hash);</pre>
<pre>my %ip_list = %$ip_list;</pre>
<pre>open(FH,$maillog);</pre>
<pre>my @log = &lt;FH&gt;;</pre>
<pre>close FH;</pre>
<pre>my ($ban, $key, @ip, @temp, %ban);</pre>
<pre>## Here is where the log is parsed, searches for rejected (by spamcop) mail attempts (553).
 ##
 ## You may need to alter this to parse your log files.  This was written for for mail logs generated by
 ##
 ## Sendmail 8.14.1 (and probably updated by now).  This line gives a positive result:
 ##
 ## Oct  9 01:50:13 ns1 sendmail[26040]: ruleset=check_relay, arg1=[123.123.123.123], arg2=127.0.0.1, relay=[123.123.123.123], reject=553 5.3.0 Mail Rejected: http://spamcop.net/bl.shtml?123.123.123.123
 ##</pre>
<pre>foreach (@log) {</pre>
<pre>if ($_ =~ m/reject\=553/) {</pre>
<pre>@temp = split(/\,/, $_);</pre>
<pre>@ip = split(/[\[\]]/, $temp[3]);</pre>
<pre>if (!(exists $ip_list{$ip[1]})) {</pre>
<pre>$ban{$ip[1]}++;
 $ip_list{$ip[1]}++;</pre>
<pre>}</pre>
<pre>}</pre>
<pre>}</pre>
<pre>## End parsing.  IP's are in the %ban hash. IP's are the key values.</pre>
<pre>foreach $key (keys %ban) {</pre>
<pre>print "Issuing $iptables -I INPUT -s $key -p tcp --dport $port -j DROP\n";</pre>
<pre>$ban = `$iptables -I INPUT -s $key -p tcp --dport $port -j DROP`;</pre>
<pre>## If you want to ban them completely, comment out the above line and use the next line instead.</pre>
<pre>#$ban = `$iptables -I INPUT -s $key -j DROP`;</pre>
<pre>$y++;</pre>
<pre>}</pre>
<pre>my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);</pre>
<pre>my @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);</pre>
<pre>my ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime();</pre>
<pre>my $year = 1900 + $yearOffset;</pre>
<pre>my $theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year";</pre>
<pre>print "\n$theTime: $y new bans " . (keys %ip_list) . " total bans.\n";</pre>
<pre>$ip_hash = serialize(\%ip_list);</pre>
<pre>open (IPS, '&gt;' . $path_to_ip_hash . '/ip_hash.txt');</pre>
<pre>flock(IPS, 2);</pre>
<pre>print IPS $ip_hash;</pre>
<pre>close IPS;</pre>
<pre>1;</pre>
<p>Make sure you download the module serialize from <a href="http://www.hurring.com/scott/code/perl/serialize/">Scott Hurrings&#8217; website </a>and place it in the same directory where the above code will go.</p>
<p>Calling this file every ten minutes or so via a cron job will execute the parsing routine.  You should test this out on the command line before using it live.  The parsing routines work on my version of Sendmail on my flavor of Linux.  As far as I know, it should work on any other flavor too.  You will need to have Sendmail configured to use Spamcop.</p>
<p>All it does is parse the log file searching for 553 rejects and drops them via iptables.  Previous drops are saved to a file that contains a serialized hash.  I chose to store it this way so it could be easily accessed by PHP scripts too.  This can come in handy if you want to show people the IP&#8217;s you have banned like <a href="http://www.worldwidecreations.com/banned_ips.php">I have done here</a>.</p>
<p>Here is the PHP code to do this:</p>
<pre>echo "&lt;P&gt;List of IP's recently banned:&lt;/P&gt;";

$ips = file_get_contents('/path/to/ip_hash.txt');

$ips = unserialize($ips);

foreach ($ips as $key =&gt; $value) {

echo "&lt;a href=http://spamcop.net/bl.shtml?$key&gt;$key&lt;/a&gt;&lt;BR&gt;";

}</pre>
<p>I piped the output of this file to a log in my /var/log directory and set up logrotate to handle the rotation.  I have been watching it slowly ice spammers and have noticed a serious improvement in server load especially during peak spam times.  It also seems to have slowed down the spam itself a bit.</p>
<p>So you are probably saying, ok, you saved some resources and have lowered your spam intake a little too, so what?</p>
<p>Well, first, I know that I am probably at least slowing a bit of the spam by rejecting packets from these spammers, but I think the bigger picture here is just the concept.  If this type of approach was used by a majority of mail servers, would it not take a bite out of spam right there?  Imagine every Linux box running Sendmail using this?  It could easily be modified to use any other mail log or firewall.  Would this not also reduce the usefulness of a bot army used for the purpose of sending spam?</p>
<p>Now of course, one could be concerned about false positives.  This is something handled more on the Spamcop end of it, but flushing your IPTables and the above perl script from time to time will lower the chances of this.  (use the flush command line argument to flush the database).</p>
<p>Anyway, feel free to comment. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/stopping_spam_before_the_door_with_spamcop_iptables.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AdSense Loading Order Affects Click Value</title>
		<link>http://www.worldwidecreations.com/adsense_loading_order_affects_click_value.htm</link>
		<comments>http://www.worldwidecreations.com/adsense_loading_order_affects_click_value.htm#comments</comments>
		<pubDate>Tue, 14 Aug 2007 03:39:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.worldwidecreations.com/adsense_loading_order_affects_click_value.htm</guid>
		<description><![CDATA[OK, you now have been using AdSense for a while but find that many of the clicks you are getting are only paying you pennies. Does it seem that you should be getting more for these clicks?
When an advertiser creates an ad and puts it on the AdSense network, they bid on how much they [...]]]></description>
			<content:encoded><![CDATA[<p>OK, you now have been using AdSense for a while but find that many of the clicks you are getting are only paying you pennies. Does it seem that you should be getting more for these clicks?</p>
<p>When an advertiser creates an ad and puts it on the AdSense network, they bid on how much they want to pay for a click. If they have the highest bid, their ads are generally placed first in the ad blocks when their ads match and are displayed. This makes perfect sense if you think about it, they are paying the most, they should get top billing. Google of course wants the highest paying advertisers to get the best exposure so they can make their money. There is more to this when it comes to &#8216;Smart pricing&#8217; but we will not get into that here. It is sufficient that you know the top paying ads are usually first in an ad block.</p>
<p><!-- Default Block: default DISABLED-->
</p>
<p>This may make you ask &#8220;But I have three ad blocks on each page, how does this affect the pay out of a click?&#8221;. AdSense will rarely display the same advertisement twice on the same page, in fact, I have never seen them do it. What this boils down to is, not only are the best paying links at the top of an ad block, they are also contained in the FIRST ad block you display. Display is actually not the proper way to say it, what I mean is, the first one the browser reads in your HTML source code for the page. The browser will generally execute javascript and anything else in the source code in a sequential order. So if you have three ad blocks on a page, the browser executes the javascript in the same order as you have it listed in the HTML source code.</p>
<p>Now we have established that the highest paying clicks come from the first ad block.  How can you use this to earn more?</p>
<p>If you use channels (which everyone should), you should be able to tell which of your ad blocks have the highest Click Through Rating (CTR). If you log into your AdSense account, view the basic report for the last month and see how it broke down with your channels. Find the channel with the highest CTR for the month. This channel should always load first in the browser. If it loads second or third, then the lower paying clicks are in these blocks. The ad block with the highest CTR is your premium advertising space and you should get a premium price for it.</p>
<p>Redesign your code so the highest CTR block gets loaded first. There are many ways you can do this, but I would suggest doing it with CSS so if the CTR&#8217;s should change in the future, it will not take much work to adjust which block loads first.</p>
<p>In conclusion, make sure the area that gets the highest Click Through Rating loads the AdSense javascript first. Adjust your other areas so they also load in the order of which has the better CTR.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/adsense_loading_order_affects_click_value.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ban IP Addresses With Your .htaccess File</title>
		<link>http://www.worldwidecreations.com/ban_ip_addresses_with_your_htaccess_file.htm</link>
		<comments>http://www.worldwidecreations.com/ban_ip_addresses_with_your_htaccess_file.htm#comments</comments>
		<pubDate>Tue, 14 Aug 2007 03:12:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.worldwidecreations.com/ban_ip_addresses_with_your_htaccess_file.htm</guid>
		<description><![CDATA[It is inevitable that sooner or later you will get a visitor to your site that will, in one way or another, become a nuisance. For example, perhaps some user comes in an keeps posting SPAM to your forum. Wouldn&#8217;t it be nice to be able to ban this users IP address or even their [...]]]></description>
			<content:encoded><![CDATA[<p>It is inevitable that sooner or later you will get a visitor to your site that will, in one way or another, become a nuisance. For example, perhaps some user comes in an keeps posting SPAM to your forum. Wouldn&#8217;t it be nice to be able to ban this users IP address or even their IP range? This can easily be done if you are on an Apache server by just using your <a href="http://www.worldwidecreations.com/php_perl_help/what-is-a-htaccess-file">.htaccess file</a>.</p>
<p>Once you find the IP address of the user(s) you wish to ban (example: 123.255.123.1), just add them to the .htaccess file with an entry like so:</p>
<p>deny from 123.255.123.1</p>
<p><!--adsense--></p>
<p>Perhaps this isn&#8217;t enough because the user has a dialup account with their ISP and just hangs up, calls back, and gets a new IP. Most of the time, the ISP will have the same first 2 sets of numbers, as our example shows: 123.255. You can eliminate that entire range:</p>
<p>deny from 123.255.</p>
<p>You should be VERY CAREFUL when you do this because you could have just denied access to everyone from a popular ISP such as AOL, MSN, etc.. Sometimes if you are under attack from such users you have no choice but to temporarily ban an entire ISP. There are a few good tools to find out the ISP of an IP address:</p>
<p>American Registry for Internet Numbers (ARIN): <a href="http://arin.net/">http://arin.net/</a></p>
<p>&amp;</p>
<p>RIPE NCC: <a href="http://ripe.net/">http://ripe.net/</a></p>
<p>Generally, these services will not tell you any information about the user themselves, but will list out ISP information and how to contact their abuse departments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/ban_ip_addresses_with_your_htaccess_file.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Separate Designers &amp; Coders With Smarty Templates</title>
		<link>http://www.worldwidecreations.com/separate-designers-coders-with-smarty-templates.htm</link>
		<comments>http://www.worldwidecreations.com/separate-designers-coders-with-smarty-templates.htm#comments</comments>
		<pubDate>Thu, 04 May 2006 02:59:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Many times the case seems to be that a person who can code great scripts can rarely do great design.Â  This is why many large sites have programmers AND designers.Â  A problem can arise with this arrangement when customizing the look of the application.Â  Generally the designer doesn&#8217;t have the first clue about PHP and [...]]]></description>
			<content:encoded><![CDATA[<p>Many times the case seems to be that a person who can code great scripts can rarely do great design.Â  This is why many large sites have programmers AND designers.Â  A problem can arise with this arrangement when customizing the look of the application.Â  Generally the designer doesn&#8217;t have the first clue about PHP and very bad things can happen.</p>
<p>Wouldn&#8217;t it be nice if the output could somehow be separated from the code so coders and designers don&#8217;t have to clash?</p>
<p><!--adsense--></p>
<p>Well there is a way, and it is called The <a href="http://smarty.php.net/">Smarty Template Engine</a>.Â  What is the Smarty Template Engine?Â  The technical definition of a template engine is code that facilitates a manageable way to separate application logic and content from its presentation.Â  Basically, your script provides all the information to the engine, and Smarty uses it, along with a template file to display it with standard HTML tags.Â Â  There are many built in Smarty tags that allow you to perform many functions found in PHP if necessary.Â  You can even add your own functions to Smarty!</p>
<p>Smarty allows you to separate code from layout.Â  You do not need to add anything special to your PHP installation, and can include all the Smarty files with your application.Â  Just require smarty in your scripts and you can use the code to handle all of your output.Â  It even facilitates output buffering with filters.</p>
<p>One large benefit to using Smarty is caching.Â  Smarty can cache pages or even just parts of pages to drastically increase load times, especially on pages where content doesn&#8217;t change frequently.</p>
<p>You can find more on Smarty at the PHP web site here: <a href="http://smarty.php.net/">http://smarty.php.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/separate-designers-coders-with-smarty-templates.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is a CMS &amp; why you should you care?</title>
		<link>http://www.worldwidecreations.com/what-is-a-cms-why-you-should-you-care.htm</link>
		<comments>http://www.worldwidecreations.com/what-is-a-cms-why-you-should-you-care.htm#comments</comments>
		<pubDate>Tue, 02 May 2006 14:04:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Content Management Systems or CMS&#8217;s are becoming very popular these days.  Many people just do not have the time to write code all day when they want to add new content to their site.  Many hobbyists want to design a site that also allows others to participate in or help webmaster.
This is where [...]]]></description>
			<content:encoded><![CDATA[<p>Content Management Systems or CMS&#8217;s are becoming very popular these days.  Many people just do not have the time to write code all day when they want to add new content to their site.  Many hobbyists want to design a site that also allows others to participate in or help webmaster.</p>
<p>This is where a CMS will shine, but what is a CMS?  A Content Management System primarily does exactly what it says: manages content!  Generally a CMS is software that you install on your site that will allow you to add/edit content, manage layout, manage users, and add extra functionality to your site.  Instead of creating a new page by hand, with all the HTML tags, etc., the CMS will generally present you with a <a href="http://www.webopedia.com/TERM/W/WYSIWYG.html">WYSIWYG</a> editor and let you enter the content and presents it on your site in a predetermined style.Â  This is very similar say, to a message board or forum except with greater control.</p>
<p><!--adsense--></p>
<p>One of the most popular CMS systems today is <a href="http://joomla.org/">Joomla</a>.  The Joomla team is filled with most of the development staff of the CMS Mambo.  The company that distributes Mambo parted ways with their developers and Joomla was born.  Joomla is an open source CMS and is completely free.  There are many other such systems out there such as PHPNuke, PostNuke, Wordpress, etc..  For this article, we will use Joomla as our primary example.</p>
<p>With Joomla as your CMS, you can write your content all day and save it to your servers SQL database and display it to your visitors.  You can also create many users with different responsibilities such as authors, administrators, editorial, etc..</p>
<p>All of your content is now instantly searchable since Joomla comes with powerful search capabilities.  This is something you just cannot do with static HTML pages without a lot of work, or waiting for a search engine to spider your site.</p>
<p>As with most CMS software, you can add on software to do many different things.  In Joomla, these are called Modules, Components, and Mambots.  With these add-ons, you can incorporate software such as forums, classifieds, webmail, etc., to your CMS giving you and your users many features.  You can even write your own add-ons if you are proficient with PHP.</p>
<p>Another benefit using a CMS is consistency.  Your pages will generally use the same style, keeping your layout consistent throughout your site.  Want to change your layout?  You do not have to change thousands of HTML pages, just one or two layout pages and they will instantly be used in all of your current content.  Most CMS software uses templates, so you can get pre made styles for your site, or even hire a designer with knowledge of your CMS to design you something unique.</p>
<p>In the end, a good CMS will save you hours of time maintaining a site and give you and your users a much better experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/what-is-a-cms-why-you-should-you-care.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What Is CHMOD?</title>
		<link>http://www.worldwidecreations.com/what-is-chmod.htm</link>
		<comments>http://www.worldwidecreations.com/what-is-chmod.htm#comments</comments>
		<pubDate>Tue, 02 May 2006 13:04:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[So you have a script to install on your server and your reading the directions and it mentions that certain file or directory permissions must be CHMOD 755 or 777 or 666, etc..  What is CHMOD?  CHMOD is short for Change Mode.  It is a Unix command that sets the access limits [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a script to install on your server and your reading the directions and it mentions that certain file or directory permissions must be CHMOD 755 or 777 or 666, etc..  What is CHMOD?  CHMOD is short for Change Mode.  It is a Unix command that sets the access limits on a file or directory.</p>
<p>For any operating system based on Unix (i.e. Linux), permissions are very important.  There are many files you don&#8217;t want other files to touch.  It wouldn&#8217;t be a good situation is for example, your forum PHP script started overwriting, or reading your servers password files, or deleted directories all over the place.</p>
<p><!--adsense--></p>
<p>When using Perl, generally most operating systems will require you CHMOD a Perl script executable before it can be run.  This is a security plus compared to PHP where generally, if the PHP file exists, it is automatically executable.  So if you have a PHP script that can write to your server, and that script creates another PHP script, it could run arbitrary commands on your server.  This is of course, not a good idea.</p>
<p>So what do the numbers mean when you see &#8220;CHMOD 755&#8243;.  This is a bit technical, as the numbers are just a binary representation of a permission scheme.</p>
<p>The CHMOD command takes three arguments, for example:</p>
<p>&#8220;CHMOD rwx r-x r-x somefile.cgi&#8221;  tells the server that the owner of the file can read it, write to it, and execute it.  If this was a directory, substitute search for execute.</p>
<p>Breaking it down:</p>
<p>rwx <- file owner<br />
r-x <- user group<br />
r-x <- everyone else</p>
<p>How does this convert to numbers?  Basically the "-" symbol equals 0, and everything else equals 1.  So the first part of our CHMOD command: rwx equals 111, the second and third part, r-x equals 101.  In binary, this comes to 755.  Here is a simple binary chart:</p>
<table cellpadding="3" border="1">
<tr>
<td>000</td>
<td>0</td>
</tr>
<tr>
<td>001</td>
<td>1</td>
</tr>
<tr>
<td>010</td>
<td>2</td>
</tr>
<tr>
<td>011</td>
<td>3</td>
</tr>
</table>
<table cellpadding="3" border="1">
<tr>
<td>100</td>
<td>4</td>
</tr>
<tr>
<td>101</td>
<td>5</td>
</tr>
<tr>
<td>110</td>
<td>6</td>
</tr>
<tr>
<td>111</td>
<td>7</td>
</tr>
</table>
<p>So instead of writing &#8220;CHMOD rwx r-x r-x somedirectory&#8221; you can write &#8220;CHMOD 755 somedirectory&#8221;.  Many FTP programs such as WS_FTP allow you to use check boxes to set permissions.</p>
<p>You should take care in setting files CHMOD 777.  This basically means anyone can read/write/execute/search the file/directory.</p>
<p>Permission structures can be a bit tricky from server to server depending on file ownership.  Usually only the file owner can change permissions.  Most FTP programs will let you view the entire directory listing which should show you who owns the file, and what group has access to the file as an owner.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/what-is-chmod.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Crontab &#8211; Run Scheduled Tasks WITHOUT Crontab!</title>
		<link>http://www.worldwidecreations.com/virtual-crontab-run-scheduled-tasks-without-crontab.htm</link>
		<comments>http://www.worldwidecreations.com/virtual-crontab-run-scheduled-tasks-without-crontab.htm#comments</comments>
		<pubDate>Thu, 27 Apr 2006 16:24:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the drawbacks in using a shared server is you rarely have access to Crontab.Â  What is Crontab?Â  Crontab is a program that allows you to execute programs on a schedule.Â  These are referred to as jobs or tasks.Â  If you use a Windows machine, you may be familiar with the Windows Scheduler.Â  Crontab [...]]]></description>
			<content:encoded><![CDATA[<p>One of the drawbacks in using a shared server is you rarely have access to Crontab.Â  What is Crontab?Â  Crontab is a program that allows you to execute programs on a schedule.Â  These are referred to as jobs or tasks.Â  If you use a Windows machine, you may be familiar with the Windows Scheduler.Â  Crontab is basically the same thing.</p>
<p>This comes in very handy for many reasons.Â  Perhaps you have written a CGI or PHP script that reads the server load, and will notify you by email if that load is high.Â  It doesn&#8217;t do you much good unless it runs every few minutes.Â  With Crontab, you can execute it as often as you wish.</p>
<p><!--adsense--></p>
<p>What do you do if you have no access to Crontab?Â  Well, many server admins would rather not give access to their users because almost any command can be issued from it.Â  Of course, almost any command can be issued in a Perl or PHP script, but we can save that for another article.Â  There is an alternative!Â  A free PHP script called <a href="http://www.worldwidecreations.com/free_scripts.htm">Virtual Crontab</a>.Â  This script is the next best thing to Crontab and runs almost exactly like it.Â Â  Using your web browser, you can schedule tasks to execute at any time of the hour, day, and month.</p>
<p>Many PHP scripts run certain processes on a schedule.Â  For example, the popular Vbulletin forum software has a section called &#8220;Schedules Tasks&#8221; where certain operations are run at certain times.Â  One task is to recount all of the posts, and all of the users.Â  Since this is a bit CPU intensive, it is only run about once per hour.Â  The problem is, it requires a user activate the script before the action can take place.Â  With Virtual Crontab, you can set up a task to call the URL to the script, in essence activating it.</p>
<p>If your PHP installation has not restricted access by turning safe mode on, you can even execute software and commands on the server.</p>
<p>For those of you who do not have access to Crontab, or are baffled by how it works, Virtual Crontab is the answer!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidecreations.com/virtual-crontab-run-scheduled-tasks-without-crontab.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
