Category: PHP

  • And We’re Back

    After a short 101 days of downtime, postneo.com is back. Sorry about that.

    The very ancient VPS that the site was on died one day and never came back. I figured that it would be a huge pain to bring it back online but it actually went pretty quickly.

    I brought up a new box at DigitalOcean since I had been meaning to try them out. It’s still early but I’m definitely impressed. I ended up moving all of my small utility box stuff off of Cloud Servers and on to this new box as well.

    The first thing to do was to bring back the old blog back up on the new box with a new web stack (Nginx instead of Lighttpd) with nothing but a MySQL dump and my web content. Once the database was loaded, content put in place, and configuration updated I was good to go. Aside from the fact that it pretty much just worked in its new home, the thing that blew my mind about WordPress was that the upgrade from 3.1.2 circa 2011 to 3.8 was about as quick and simple as it gets. I followed the instructions and was on the latest release in literally 10 minutes.

    There’s definitely a lesson to be learned there in how to delight and amaze your users as we write our software. I was delighted and amazed as a user and humbled as a software developer by this collection of PHP files that “just worked.”

  • Pardon the Dust

    Sorry about the short outage there. I finally consolidated the various co-location, shared hosting, and virtual private hosting services that I was consuming every month in to one VPS account. I still have some legacy URLs to do some rewrite magic for, but the archives back to 2002 is here.

    Because my new box is very Django-oriented, I am now running WordPress via PHP5 (FastCGI) and MySQL5 on lighttpd behind perlbal.

    One of the things I really enjoyed about the move from WordPress on Apache with a really gnarly .htaccess file for URL rewriting to lighttpd was the simplicity of it all. Getting WordPress to “just work” for me on lighttpd was as simple as adding a 404 handler for the site:

    server.error-handler-404 = "/index.php?error=404"

    Everything should be smoothing out shortly and of course the eventual goal is to move this blog over to Django trunk. I did just that a few months ago but I need to revisit the code, find the importer, and give it a lot of layout love.

  • Lighty Rocks My PHP/MySQL World

    A few weeks ago I was tasked with moving boards.kusports.com from an old, overloaded XServe to a newly appropriated Xeon box. The boards were notorious for going down after big games and during big news events and usually took other things on the same server down with them.

    Thankfully that is no more. A week or so before the Big 12 and NCAA tournaments we finally bit the bullet and committed some time to move the boards over to their own box with more horesepower and more RAM.

    I put the ubuntu-server version of Breezy Badger on the box and took the opportunity to see if I could get UBB Threads running under lighttpd and php fast-cgi. I’m glad that I took the time, because it’s smoking fast.

    The process was quite painless thanks to the Ubuntu packing system. I had to build lighttpd by hand but everything else was installable with command-line tools (aptitude/apt-get). The changeover process consisted of little more than shutting down the boards on the old box, doing a dump/restore of the database to the new server, updating DNS entries and issuing temporary redirects to get the board users through the day.

    The best thing about the conversion is that lighttpd, mysql, and php-fcgi barely register any load on the server, even at peak usage. While we were scrambling with stom coverage the other weekend, the boards box quietly registered a new high water mark for usage. After a painful first-round loss in the NCAA tournament, the boards registered yet another high water mark (1134 simultaneous users). The server barely flinched with a load anywhere from 0.00 to 0.20 with plenty of resources free. Previously a third of that number could potentially bring the XServe to its knees.

    While we were turbocharging things, I also installed eAccelerator on the box, which was equally painless and yielded about a 20-30% performance increase.

    All in all I’m gaga over lighty, mysql, and php-fastcgi for when the situation warrants it. It really is insanely fast. At the same time I’m really glad that I work in Python all day.

  • WordPress Trackback Validator Plugin

    I just saw the WordPress Trackback Validator plugin fly by my aggregator and immediately installed it. I knew Dan online back in middle school, so with this endorsement, I installed it instantly:

    The Computer Security Lab at Rice just released the first public version of the Trackback Validator plugin for WordPress blogs. Since I’ve been using it, I’ve had 100% classification accuracy on Trackbacks (read: every legit Trackback makes it through, not a single spam Trackback). Maybe Trackback isn’t quite so dead after all.

    The system checks to make sure that the URL of the trackback links to your page. This reminds me a lot of Sam Ruby’s feedback mechanism. As a bonus, there’s a great use of sparklines in the plugin page.

  • In Search of a Javascritpt WYSIWYG HTML Editor that Doesn\’t Suck

    The title says it all. I’m looking for a Javascript-based What-You-See-is-What-You-Get HTML editor that doesn’t suck. I fell in love with HTMLArea when I bought my copy of Radio back in 2001. I’ve since used HTMLArea 2 which is pretty decent but is IE only. Until recently I had been tracking the HTMLArea 3 pre-releases which worked in both IE and Mozilla and were beginning to deal with things like copy/paste content from newer versions of Microsoft Office products that embed all that nasty XMLish markup. The other day I went to htmlarea.com to see if there was a new beta release only to find that the lead contributor had mothballed the project:

    htmlarea 2 and 3 have been discontinued. They were free wysiwyg editors that were distributed on this site. Visit the directory to find similar products.

    What a bummer. The source is still in CVS, and I’m hoping that a leet Javascripter will take over the project, because HTMLArea 3 seemed pretty darn stable and quite near release. I’ve looked quickly at a bunch of possible replacements, but each one seems to have a showstopper. RTE is quite good for when you need a small, simple, compact editor, but it has its quirks. For instance, it’s an editable iframe instead of a layer over textarea, so there are some limits to the script-fu you can do with it. Don’t get the post title wrong, RTE does not suck at all, but it has its limitations.

    And so I ask you, dear reader, what the heck are you using these days for something like this? While I take the time to look closer at the lists of editors that I’ve glossed over before, I’d love to hear from you. Feel free to drop me a line (matt at ooiio dot com) or take a look at my JavascriptWyswiygHtmlEditors page and add your two cents. Please help, I’m at my wits end!

  • Apache2 and PHP5 in Less than 10 Minutes

    This weeks Debian Weekly News featured a link to some unofficial debs of PHP5. I’ve been meaning to tinker with PHP5 for some time now and jumped on the opportunity to do so.

    I took a fresh and minimal Debian Testing install (updated from a tiny stable install) and added the following line to my /etc/apt/sources.list:

    deb http://people.debian.org/~dexter php5 sid

    After an apt-get update I used apt-get install to install the following packages:

    • apache2-mpm-prefork
    • libapache2-mod-php5
    • Many of the standard Apache2 modules
    • Many of the standard PHP5 modules listed here
    • A few suggested and recommended packages.

    I ran the install command with -s a few times to see what would be installed, but zero to working Apache2 + PHP5 took me less than 10 minutes. Of course this is running unofficial stuff on a Testing system (though if you ask nice enough you should be able to pull this off on an otherwise Stable distro, but why would you do that?), so use it at your own risk. I’d suggest that you not try this on a production system. Until we see PHP5 incorporated into the various distros, this might be the quickest way to give it a go.

    I’m excited to tinker with the new OOPness features in PHP5. I’ve also got my eye on a particular MVC framework called Mojavi.

    Update (1/12/2005): As some have noticed it looks like there has been some moving and shaking in this unofficial unstable php5 build. After an apt-get update; apt-get dist-upgrade a few days ago, I lost the ability to use DomDocument. I checked the dists directory and changed my sources.list to reflect sid-old.

    I changed my sources.list back to sid after noticing that there were fresh new (5.0.3-0.3) pakages dated this morning at 4am. The new packages are excellent!

    Let me say again, don’t use this on a production system. But do look around, have some fun, and get a feel for php5. Special thanks to Piotr Roszatycki (dexter) for generating these packages.

  • /me is back.

    It’s been a long couple of months and I apologize for the hiatus. It’s a long story for another day, but lets put it this way, I’m back! I’ve moved from Radio Userland to WordPress. I promise that I’ll share my (semi-painful and procrastination-ridden) migration process in due time.

    The .css that is currently driving the site is Dots by Alex King, which I’m currently tweaking. I’ve still got some random bits that I need to find and url rewrite to fit the new engine, but I’ve done my best to keep the old permalinks. If you find something that’s whacky, please drop me a line at matt at the domain ooiio.com. Thanks!

  • MMSlib: Encode and Decode MMSes with PHP

    Via freshmeat, I spotted MMSlib this afternoon:

    Mmslib is a PHP library for encoding and decoding MMS:es. MMS is short for Multimedia Messaging Service. In short it is the successor of SMS (Short Message Service) with the enhancements that you can not only send text but basically any content type your phone can handle such as images, text, videos, ring signals and audio clips.

    I’m going to file this one away for a rainy day when I’m hacking on code at three in the morning and need to deal with MMSes in a LAMP environment.  This looks like a great little library.

  • PHP5

    The big news this evening is the release of PHP5. The nitty gritty details are in the changelog, but this is a huge release. PHP5 bings los of OOPish goodness to the table and promises to rock.

  • PmWiki: Tarball to Wiki in 60 Seconds

    Via freshmeat, PmWiki is a PHP-based Wiki with a clean but nice look to it.  I really like the editable sidebar.  Also, if you add a URL of a .gif, .jpg, or .png, it’ll display the image on the page.  Pretty slick.  The basic syntax looks good, though as with every other wiki on the plant, it’s just different enough to leave you constantly scratching your head.

    “which wiki planet am I on right now?”

    Update: Wow.  I decided to install PmWiki.  I was thoroughly impressed with how lightweight it is (no mysql neccesary) and how easy it was to set up.  I followed the installation instructions and went from a tarball to a working wiki in less than 60 seconds.

    Now to be fair, I should probably edit a few things in the config file in order to customize my wiki.  However, being able to go from a bunch of files to a working installation in a minute is awesome.

  • Yawiki and text_wiki

    Yawiki builds upon text_wiki.  Both projects had new releases today.

  • Text_Wiki 0.8.2

    Via freshmeat, there is a new version of Text_Wiki out.  I’ve mentioned it in the past, but I have not had a chance to play with it yet.  Here are the changes in the new version:

    There is a major change to the Wiki class property $rules definition which breaks backwards compatibility with 0.7 alpha and earlier for any user-defined rules. The $rules property is now an associative array (‘rule_name’ => ‘/path/to/classfile.php’). A bug where marked up numbers would sometimes be mistaken for delimited token numbers has been fixed. Rules are now loaded in the constructor method, not on-the-fly as part of the parse() method. This corrects the “can’t parse twice” bug. There are many other bugfixes and feature additions.

  • Thumbnails From 3GP Video

    Chris Davies has scripted some PHP that grabs a thumbnail image from a 3GP video.  The cup of tea lives on!  I agree with Chris, it would rock if TextAmerica were to incorporate something like this instead of the canned ‘this is a video’ graphic.

    Excellent work, Chris!

  • Kses: A PHP HTML/XHTML Filter

    While trawling the depths of mailing lists this evening, I stumbled upon this new release:

    kses is an HTML/XHTML filter written in PHP. It removes all unwanted HTML elements and attributes, and it also does several checks on attribute values. kses can be used to avoid Cross-Site Scripting (XSS), Buffer Overflows and Denial of Service attacks.

    The current version (0.2.1) is mostly a bugfix release.  This looks like a good package to wrangle mangled HTML/XHTML and should be helpful in avoiding those pesky HTML/XHTML script kiddies.

  • OETrends Roundup

    From the recent Open Enterprise Trends newsletter:

  • A Little Bit of This, A Little Bit of That

    It must be Monday again.  Here’s a collection of links from the weekend:

  • RSS Creator

    RSS Creator 1.2 is out:

    RSSCreator is a PHP class that provides an easy way to create RSS feeds from within PHP. RSS 0.91, 1.0, and 2.0 are supported.

    1.2 is a bugfix release, and is darn useful if you need to produce RSS with PHP.

  • Typical Sunday Roundup

    Here’s a roundup from another weekend spent offline:

    • Aaron Swartz has been dodging trains and dealing with parental units to get his site back up.  Somehow I’d like to think that I wouldn’t take a bullet for my server, but right now I’m not too sure.
    • Via Erik, via Mark, Beggregator is an RSS aggregator of some sort.  I don’t have the energy to try it out tonight.  Does anyone have some screenshots to share?
    • Via my friend Adam, Interakt has some interesting php stuff.  He also pointed out Edit-X, some kind of CMS, but the $495 pricetag doesn’t seem worth it.
    • DrBacchus muses on comunnity and open source.
    • Gizmodo points to a Palm C vs. Palm W celebrity deathmatch.
    • addns.pl is a DynDNS.org updater written in *gasp* Perl.
    • There’s a new development release of Armagetron, a pretty slick Tron Light Cycles clone that I’ve been playing since it was featured on The Screen Savers.  It’s got network play too. Much fun.
    • My colo’d server might be down for a few minutes between 10PM and 2AM Eastern time tonight.  They’re upgrading and rebooting all of their Cisco equipment.  This site won’t be affected as I still haven’t transfered it over.
    • I tried to go to my local Sam’s Club today but couldn’t.  Someone had driven an SUV through the front door earlier in the day.  Needless to say, it was closed.
  • Channels Are Back

    Sorry for the outage, but I’ve not been using categories for quite some time because of space issues.

    My web provider recently gave me more storage, so I’ll be posting to categories again.

    Enjoy.

  • PHP 4.3.1

    PHP 4.3.1 has been released to fix a CGI security problem.

    PHP contains code for preventing direct access to the CGI binary with configure option “–enable-force-cgi-redirect” and php.ini option “cgi.force_redirect”. In PHP 4.3.0 there is a bug which renders these options useless.