Archive for the 'PHP' Category

Is Ruby slow compared to php?

Like any good nerd, we’ve been experimenting with a little Ruby and Rails development - it is always good to try new things …

One thing we have noticed is that simple Ruby web apps (running on the same server,) are noticeably slower than PHP.

We installed fastcgi with apache 1.3 (took an hour to do) and are running simple web applications.

I will get into more detail in other post / articles.

Book Review: Learning PHP & MySQL

Another great book from O’Reilly.

This book targets beginners to PHP but NOT total beginners to code and programming - I think that certain explanations of the basic programming concepts, may confuse a some people.

Doesn’t matter though, once you’ve done my free video tutorials (found on this site,) you will be able to breeze through this book.

Besides the basics of PHP programming, the book does a good job teaching basic database theory and concepts - but not so much to bore you to death.

Instead (like the rest of the book,) the coverage of database theory is just enough to get you going with MySQL.

Spamming spammers - with PHP.

I have a nasty habit that is born out of my petty and self destructive instinct for revenge: I spam spammers.

I’ve (like many of you,) have been and still am subject to constant spam attack. But not just one ’style’, I actually get spammed on all fronts:

  • Email spam.
  • Blog spam.
  • Forum spam.

… it seems that the spam world considers me to be a ’spam-licious’ target.

REVENGE IS A DISH BEST SERVED WITH PHP

Being an ubernerd … I got me some options to reflect the pain back to my assailants: php mail() and a for loop!

Check it out:

$str = “Automated response From: Killersites.com - you (spammer@some_domain.com) have sent us spam messages … not nice.”;

for($i=0; $i < 250; $i++)
{
$did_send_mail = mail('spammer@some_domain.com','Automated Response From: Killersites.com System', $str);
}

-

Nothing special in the php code here. But it holds a special place in my heart.

:)

Now whenever I see it as required, I fire off this script to the lil' bastard that spammed me. Their lucky I don't slap another zero or two in the loop count:

250 -> 2500 or even 25000!

DOES IT WORK

Well I tend to get much fewer repeat offenders since I’ve been doing this.

What are database driven websites - podcast.


podcast_icon

A quick podcast where I explain the basics behind what database driven websites are.

This podcast targets total beginners.

Database Driven Websites Explained.

Java web hosting is still brittle.

It has been a couple of years since I moved (from in-house hosting) my Java based web applications to using an outside company.

When I was hosting my little apps from my Windows 2000 server (using Caucho Resin,) on a DSL connection, I never had a problem … probably because it was so small.

Since growing and moving to Tomcat on Linux, I’ve found that Java is not the most stable thing … it is not uncommon for Tomcat to lock up.

Contrast this to my PHP based applications (WordPress for example) and I have yet to experience a problem.

THE JAVA FACADE

The Java community loves design patterns (they need them with that overly engineered Frankenstein of a language …) so I’m sure they’ll understand this -> Java is heavy, whenever you start a Java process it like putting on 50 pounds - it slows you down.

The Java facade is the claim that Java is a light nimble thing … the JVM that is. It is not anymore. It once was say back in 1997.

I always wondered why Sun (a billion dollar company) could not get Java Applets to work whereas the relatively tiny company Macromedia, could with the Flash player?

… I’m ranting, so sorry.

CPANEL IS SCARED OF JAVA

Funny, when you activate Tomcat to work with a domain on CPANEL, it gives you a warning about how much juice Java swallows up … and warns against enabling too many Java based websites. It doesn’t say jack about PHP …

JAVA’S FUTURE IS IN LEGACY

It seems a contradiction, but I think that’s where it’s at. Java will become (strictly) a technology of the Enterprise (and legacy integration) while nimble languages like PHP and Ruby will be used to create the new innovative software.

Why?

PHP and Ruby programmers can (and do) code circles around Java developers. You can’t blame the Java developers: the Titanic couldn’t turn on a dime either!

Zing!