Category Archives: Code

DbTable and all its glory

The example: http://www.koopman.me/dbtable/ I got the concept of the class, DbTable, from a book called PHP5 Professional. The idea is we have a class, this abstract class, that allows us to quickly make a new class out of any database … Continue reading

Posted in Code | Leave a comment

Deduplication Snapshots on Amazon S3

Deduplication is a term that refers to the practice of storing files by breaking up into chunks (or slices), getting a unique hash for each chunk, then storing the chunks and keeping metadata that explains how to reassemble the file … Continue reading

Posted in Code | Leave a comment

Amazon S3 Tools, Using PHP

If you haven’t heard of Amazon S3, check it out here. It’s remote storage for your files, at $0.15 per GB per month. You sign up for an account for free, then pay at the end of each month for … Continue reading

Posted in Code | 1 Comment

Store a file on Amazon’s S3 service

s3put.php:Note: This file requires:pear install Crypt_HMACpear install HTTP_Request Share This Post On:u=http://www.koopman.me/2008/02/store-a-file-on-amazons-s3-service/&title=Store+a+file+on+Amazon%26%238217%3Bs+S3+service” title=”Share ‘Store a file on Amazon’s S3 service’ on BlueDot”>

Posted in Code | Leave a comment

Using XAJAX to autocomplete emails from address book

PostPosted: Sat Sep 10, 2005 6:00 pm Post subject: Reply with quote Imagine that you are supposed to type in an email address into a form. You would typically type an email address that may be stored in your address … Continue reading

Posted in Code | 1 Comment

nusoap WSDL service return array of complex data

I’m just getting the code in the post for now… hopefully I’ll have time to come back and document it for you. I am excluding my config.php on purpose, you’ll need to define you’re own constants in there. <?php require_once(“config.php”);require_once(“nusoap.php”); … Continue reading

Posted in Code | 1 Comment

Net_IPv4 Coolness

Available from the PEAR website, http://pear.php.net/package/Net_IPv4, the Net_IPv4 package is pretty cool. Check this out: <?phprequire_once(“IPv4.php”);$ip = $argv[1];$netmask = $argv[2]; $ip_calc = new Net_IPv4();$ip_calc->ip = $ip;$ip_calc->netmask = $netmask;$ip_calc->calculate();$ip_calc->min = $ip_calc->network;$ip_calc->max = $ip_calc->broadcast;$ip_calc->min_long = $ip_calc->ip2double($ip_calc->network);$ip_calc->max_long = $ip_calc->ip2double($ip_calc->broadcast);$ip_calc->gateway = long2ip($ip_calc->max_long-1); print_r($ip_calc);?> Share … Continue reading

Posted in Code | Leave a comment

Playing with Wake-On-Lan (WOL)

Pre-req:+ Must have php5 with –enable-sockets What is a magic packet?It’s a udp packet sent through the broadcast address to all servers on the network (ie, all servers serviced by the broadcast address). It’s called magic, because the format of … Continue reading

Posted in Code | Leave a comment