Online fax service with SSL API

Problem

You need to create an online application that is capable of sending a FAX securely (PCI, HIPAA or other compliance).

Solution

After trying trustfax and eFax, neither of which has a secure API, Ralph found that Metro Fax has a SSL API for developers and the cost is reasonable.

The following SDK as well as some supporting documentation below will help you get started: WsfSDK

The MetroFax webservice gateway is available at:

https://wsf.metrofax.com/webservice.asmx

And there is supporting documentation (NDoc) available below:

https://wsf.metrofax.com/doc

The attached SDK contains sample implementations of numerous common methods.


How to change a link everywhere throughout one or multiple websites?

To do a recursive search and replace in a file system tree, the most effective way is to work directly on the file system. Using a tool like DreamWeaver is slow and cumbersome. Unix offers perl and find, which combined allow to do a search and replace recursively very easily. This implmentation is in perl, but sed could also be used to achieve the same result.  At the prompt (with ssh or putty) go to the root of the tree you would like to modify, and type the following commands:

for i in `find . -name .html`

do

perl -p -i~ -e 's/original text/replacement text/g' "$i"

done

The above shell script will cycle through all the subdirectories starting with the current directory and look for all .html files. “original text” can be any regular expression valid in perl.


Connection pooling with mod_perl

I found this info in the PostgreSQL archives. Here are  2 methods:

Best method from Dan Lyke: Apache::DBI will pool across Perl programs, and you don’t have to change anything in your scripts.

Next best method from Gilles DAROLD: in your perl script use the following code

use vars qw($dbh);

$dbh ||= DBI::connect($datasrc, $dbuser, $dbpwd);

These can be use to create a database connection class in Perl that can handle transparently the connection / reconnection and disconnection for your code. The end use code doesn’t have to be OO, thus the connection object can be reused in any legacy code.


How to install Perl modules on a Unix / Linux server

From the command line, as the root user, run:

  # perl -MCPAN -e shell

And then at the cpan command line run:

  cpan> install Module::Name

Alternatively, using sudo on one line, as any user you can directly intall a module by running:

sudo perl -MCPAN -e 'install Module::Name'