The best CGI I've ever written. :) :) :)
Basically it says take anything posted to this cgi and write it to a datafile with the timestamp (where I have other scripts come and process it).
In this case I'm just having one machine post json files to another (but I don't control the source machine).
This works because apache pipes all incoming data in as standard in, so you can cat it down to a file. And I return a "Content-type: text/html\n\n" so the sending servers get a "200 OK" response code.
$ more /var/www/html/foo.cgi
cat > $TMPFILE ; printf "Content-type: text/html\n\n"