Camping on the island

I’ll be camping for the next few days on Vancouver Island with some friends.  We don’t know exactly where we will be going.  We’re just going to drive until we find a good spot.  Then we will set up camp and relax.

It may be difficult to get away from work, but I think my soul needs this break. 

Source Guardian

This is a follow-up on my experimentation with PHP compilers.  After trying Bcompiler and choosing not to use Zend Guard, I tried out Source Guardian.  It will compile PHP into byte codes for either PHP 4 or PHP5 using a command line executable (or a GUI in Windows).  The PHP file is encoded in place and can be used just as if it wasn’t encoded at all.  You only need to copy a directory of dynamic php extensions into a parent folder of the script (e.g. the web server’s document root would work fine) which are used to decode and run the encoded script.

I tried this out and it worked flawlessly.  Not only that, but this product opens doors to add limited licensing to your products.  You can, for example, set an expiry date on code, or stipulate that the code can only be run on a certain IP or MAC address.

All I can say is that I will definitely be purchasing this product and I recommend it for anyone who distributes PHP source code and doesn’t want to give away all intellectual property. 

Adventures with PHP Compilers

I am in a situation where I need to protect some intellectual property in a PHP script.  The recommended solution is to use a code obfuscator (or compiler) to encode the script.  Currently the landscape leaves much to be desired in this area as far as PHP is concerned.  The industry standard seems to be Zend Guard (http://www.zend.com/products/zend_guard) which is created by Zend – the guys who make PHP – but this has a couple of down sides:

  1. It costs $1000 US.
  2. The web server must be equipped with the Zend Optimizer extension in order to run encoded scripts. AFAIK this extension needs to be compiled statically into PHP.  This would drastically reduce the portability of my scripts. 

The biggest open-source compiler is bcompiler (http://php.net/bcompiler), a PECL extension.  Code that is compiled using this extension can be run with the assistance of the bcompiler extension.  Since bcompiler is a dynamic extension (i.e. it can be loaded at run time) it is theoretically much easier for users to install it (for my script).  Not a perfect solution, but I was willing to accept this hassle in order to ensure the protection of my intellectual property. 

In the past I have had nothing but bad experiences with PECL.  The extensions never install like they are supposed to.  If you make it past the compilation errors and actually get it installed, it is usually an ordeal to turn it on, and can be even more difficult to get it working properly.  These problems are usually related to incompatibilities with versions of gcc, automake, libtool, etc.., and a few hours (or sometimes days) reading through the PECL bugtracker can usually get these problems solved, but, … you get the point.

Unfortunately my experience with bcompiler was no better.   I tried installing it on my laptop running OS X 10.4 and PHP 4.3 (and also PHP 5), but couldn’t get past make.  It gave an undescriptive error "Make failed".  A little bit of googling revealed that bcompiler may be incompatible with GCC 4.x – a bug report suggested I downgrade to version 3.x.  Frankly, I don’t feel like installing an older version of GCC just to get bcompiler to install.

No problem, I don’t need it to run on my lap top.  I have a web host running red hat linux.  Surly it will compile on there.  In fact it did compile.  After about 45 minutes of tinkering with the php.ini file and the bcompiler.so file, I was even able to compile a simple php script into bytecode with the help of bencoder (http://bbs.giga.net.tw/bencoder.php) a script created by Shen Cheng-Da to harness the power of bcompiler.  The only problem is that the compiled code doesn’t work properly.  I can include the compiled script into another script, but cannot call any methods from it – and the script gives a Segmentation Fault on exit without any explanation.

I’ve looked far and wide for a solution to this one.  PECL bug tracker is full of reports of segmentation faults but the solutions don’t appear to transfer easily to this context.

Conclusion:  bcompiler is not ready for primetime yet.  Please someone correct me if I’m wrong on this point.

On to another commercial compiler: Source Guardian.  This is perhaps the most promising of the bunch.  It takes an approach similar to bcompiler in that scripts encoded with this product can be run on any server using a dynamic php extension.  The difference is that this is much more polished and feature rich, and the dynamic php extension is distributed as a binary, so the user doesn’t have to mess around with make and gcc.

I downloaded a 30 trial version of this software and tried to encode one of my scripts.  I am still in the process of trying to get this to work, … I’ll let you all know how it goes.

IFTPd

Ran across IFTPd (http://iftpd.sourceforge.net/)today and installed it on my westhost server.  This is great because I can run it on my virtual private server and create accounts for multiple users giving them access to exactly what they need access to.  It has a simple mechanism for defining groups and users, allowing you to create virtual file systems for the users and groups to work on. 

The default FTP daemon on my server was a little more difficult to work with, confining users to only their home ftp directory.  This is insufficient when there are multiple group projects under way.

IFTPd is also written entirely in Java and is distributed with all dependencies, so getting it running was a snap.

Still looking for a similar product for SSH, but for now, this works GREAT! 

 

Back down to earth

After our amazing victory against the decepticons we succombed to the lesser (yet still more talented than us) District 5.  Our 12 minutes in penalties didn’t help.  As a forward I didn’t get to play very much because we were short-handed so much.  The floor was quite slippery and difficult to play on.  None-the-less we gave a good effort and I am proud of our team.

 We still have at least one more game tomorrow (Thursday) against the Jumping Jalepenos at Killarney at 8:45pm.  We will be missing some core players due to injuries and suspensions, and our number one goalie will be MIA, but we will do our best to best these guys.

We won!!

I have been playing as a spare for a roller hockey team in the VIHL (Vancouver Inline Hockey League – http://www.vihl.net).  Our team has great spirit and it it a positive environment.  That said, we finished 7th out of 8 teams in the regular season.   A few games ago there was one team, in particular, that seemed superior to us in every way, easily beating us 13-1.  This team is called the "Decepticons" (they have the cool decepticons insignia on their jerseys and everything!!).   We are "The Killer Bunnies".

 Anyways, we played the Decepticons tonight in the first game of the play-offs. (2nd place against 2nd last place).  We knew what we were up against and we had hope – but no illusions about our chances.  However, our team came out swinging with some early goals.  We were up 3-1 after the first half – which was about the best period of hockey we have played this year. We were skating and pressuring them to make mistakes – while our scorers were putting the puck in the net!.  With 2 minutes left in the game we were up 5-2 when they pulled their goalie for an extra attacker.  They scored 2 quick goals – then with 10 seconds left they took a slap-shot from centre that went in.  How disheartening.  But the game was not over yet. 

 Overtime:

After 3 overtimes we were still tied at 5.  The 4th overtime had us playing 3 on 3.  A few minutes in, our power defenceman Tim Poon ripped a shot from inside the blueline that caught the top corner… and…. we WON!!!  We beat the unbeatable— possibly the biggest upset in the division.

 This was a very satisfying victory both because we played well, and we played well as a team.  There was a synergy out there tonight that was truly a treat to be part of.

 

Next game Tuesday.. hopefully we can keep up the intensity! 

Canada Day Long Weekend Camping

Went camping over the weekend with Joshua fellowship at Golden Ears park.  It was a lot of fun and quite relaxing.  We ate like kings (thanks to Grace and Dennis), and we explored the local terrain when we were tired of relaxing.  Went kayaking, swimming (sort of), played a bit of baseball (at least catching and throwing the ball), and slap Jack.  Oh well.. back to work now…

The Heart of the Game

Saw a pretty good documentary on Wednesday called "The Heart of the Game".  It followed Seattle’s Roosevelt highschool’s girls basketball team through 4 or 5 seasons capturing the drama and hardships that go along with competitive highschool sports.  It was amazing to me that they were able to get all of this great footage, since, when the filming began, there was no way to know that this coach and group of girls would achieve such great things and go through such great adversity.

Beverly’s driving!

It took a 5:45am lap around Swanguard stadium to get her into the driver’s seat of a car, but now that she has driven around town a little bit, there’s nothing holding her down.  She went to Pitt Meadows last night for an MK appointment – ON HER OWN!   Who knows where she’ll be spotted next 🙂

Ramblings about Xataface, Java, and other software development issues