The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Cat and inetd...help? by Kickstart2005-08-16 10:42:05
  cat isn't getting the file argument by pyroteknix2005-08-16 10:53:54
    Further strangeness by Kickstart2005-08-16 10:59:22
      Missing a Content-Type? by pyroteknix2005-08-16 11:01:29
        Here's a sample by Kickstart2005-08-16 11:02:49
          Give me a few... by pyroteknix2005-08-16 11:13:37
            I've got some of that... by Kickstart2006-11-19 12:55:59
              Oh. Heh. by pyroteknix2005-08-16 11:21:06
                I wonder about improving reportsock.pl by Kickstart2005-08-16 11:25:42
                  OK, Here's what I have so far. by pyroteknix2005-08-16 11:51:23
                    Some cleanup... by Kickstart 2005-08-16 12:14:00
#!/usr/bin/perl
$|=1;

$nowdate = `date +'%a, %d %b %Y %T %Z'`

my $file = shift;
if(!$file) {
 # Needs sanity checking, but this is just a quickie
 print 'Usage: '.$0." <file>\n";
 exit;
}

$filedate = `date +'%a, %d %b %Y %T %Z' -r`

# Wait for HTTP request to finish
my $in_line = '';
while($in_line ne "\r\n") {
 $in_line = <STDIN>;
}

# Send HTTP response headers
print <<'END_HEADERS';
HTTP\1.1 200 OK
Server: reportsock/1.0 16aug2005
Content-Type: text/plain; charset=iso-8859-1
Date: $nowdate
Last-Modified: $filedate
Accept-Ranges: bytes
Connection: close
Cache-Control: max-age=0
Expires: $nowdate

END_HEADERS

# Send file
open(REPORT_FILE, $file);
while(<REPORT_FILE>) { print; }
close(REPORT_FILE);

exit 0;
[ Reply ]
                      Yup. by pyroteknix2005-08-16 12:15:48
                        No worried...thanks very much! (n/t) by Kickstart2005-08-16 12:16:25
                          No problem ;) by pyroteknix2005-08-16 12:27:38
                            Absolutely by Kickstart2005-08-16 12:36:00

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)