Slashdot Mirror


Httpd Written In Postscript? Shell?

eMBee writes: "You thought the kernel-httpd is weird? then look at these: a shell script, and another one in Postscript." Ya know, this kinda stuff gives me faith in humanity. Faith that we've evolved too far: it's time to back-up to, say ... using bone chips as knives ;)

108 comments

  1. Why only the httpd? by yiegie · · Score: 4
    I've heard some people are building an entire operating system in LISP

    YDD

    --

    .sigmentation fault

    1. Re:Why only the httpd? by Z00100 · · Score: 1

      Wowza!!!

      LISP......heh!! What will they think of next!!

      --
      Visit http://hardwareflux.com
    2. Re:Why only the httpd? by Anonymous Coward · · Score: 5
      (repost; better formatted)

      A modestly ugly HTTP server written in emacs lisp.

      ;;; Luke's Emacs Webserver ("LEW" aka "Loo" aka any toilet joke you please)
      ;;; Copyright (C) 1998-1999 Luke Gorrie
      ;;;
      ;;; This program is free software; you can redistribute it and/or
      ;;; modify it under the terms of the GNU General Public License
      ;;; as published by the Free Software Foundation; either version 2
      ;;; of the License, or (at your option) any later version.
      ;;;
      ;;; This program is distributed in the hope that it will be useful,
      ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
      ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      ;;; GNU General Public License for more details.
      ;;;
      ;;; You should have received a copy of the GNU General Public License
      ;;; along with this program; if not, write to the Free Software
      ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

      ;;; TODO list:
      ;;; support HEAD requests
      ;;; add some sort of dynamic content facility, either for elisp `servlets' or cgi

      ;;; $Id: http-server.el,v 1.2 1999/07/01 19:01:06 luke Exp luke $

      (setq http-hits 0)

      ;;; configuration

      (setq http-404-message
      (concat "File not found."
      "File not found"
      "

      "
      "The file requested does not exist, or is not a regular file, "
      "or something."
      ""))

      ;; regex path -> mime-type mappings
      (setq mimetypes-alist
      '(("\\.gif" .
      "image/gif")
      ("\\.jpg" .
      "image/jpeg")
      ("\\.png" .
      "image/png")
      ("\\.\\(el\\|txt\\|erl\\|scm\\)" .
      "text/plain")
      ("\\.html" .
      "text/html")
      ("\\.\\(tar\\|gz\\|tgz\\|zip\\|exe\\|pdf\\|ps\\)" .
      "application/octet-stream")))

      ;; document root directory
      (setq document-base "/mnt/baked/www/vegetable.org")

      ;;; http server code

      ;; open a socket to the connection-connector with a transaction callback to
      ;; serve the request when it arrives
      (defun offer-http-service ()
      (let ((service-successful nil))
      (unwind-protect
      (progn
      (lexical-let ((proc (open-network-stream "bar" "baz" "localhost" 8012)))
      (set-process-sentinel proc 'http-sentinel)
      (let ((tq (tq-create proc)))
      (tq-enqueue tq "" ".*\r\n\r\n" "Http Connection"
      #'(lambda (closure answer)
      (lexical-let ((answer answer))
      (handle-http-request proc answer))))))
      (setq service-successful t))
      (if (not service-successful)
      (progn (offer-http-service) (message "service failed"))))))

      ;; called if there's an error in between offer-http-service
      ;; and handle-http-request -- usually when the connection is broken
      (defun http-sentinel (proc sentinel)
      (offer-http-service))

      ;; read a file as a string
      (defun filestring (filename)
      (save-excursion
      (switch-to-buffer "*loading-work*")
      (insert-file-contents filename)
      (let ((contents (buffer-string)))
      (kill-buffer "*loading-work*")
      contents)))

      (defun process-send-file (process filename)
      (save-excursion
      (switch-to-buffer "*loading-work*")
      (insert-file-contents filename)
      (mark-whole-buffer)
      (process-send-region process (point) (mark))
      (kill-buffer "*loading-work")))

      ;; returns the file length
      (defun load-file-for-io (filename)
      (save-excursion
      (switch-to-buffer "*loading-work*")
      (insert-file-contents filename)
      (mark-whole-buffer)
      (- (mark) (point))))

      (defun send-current-file (process)
      (save-excursion
      (switch-to-buffer "*loading-work*")
      (mark-whole-buffer)
      (process-send-region process (point) (mark))
      (kill-buffer "*loading-work*")))

      ;; handle a http request. Takes a process and request with headers,
      ;; and sends the response
      (defun handle-http-request (proc request)
      (unwind-protect
      (progn
      (string-match "\\( \\)\\(.*\\)\\( \\)" request)
      (let ((r-path (concat document-base (match-string 2 request))))
      (message r-path)
      ;; append "index.html" to and directory name
      (if (string-match "/$" r-path)
      (setq r-path (concat r-path "index.html")))
      ;; protect against accessing ../../ to get above document base
      (if (string-match "\\.\\." r-path)
      (setq r-path (concat document-base "/index.html")))
      ;; file exists?
      (if (file-regular-p r-path)
      (let ((length (load-file-for-io r-path)))
      (message "request")
      (process-send-string
      proc (concat "HTTP/1.0 200 OK\r\n"
      "Content-Type: "
      (get-mimetype r-path mimetypes-alist "text/html")
      "\r\n"
      "Content-length: "
      (number-to-string length) "\r\n"
      "Server: " (version) "\r\n"
      "Last-Modified: " (current-time-string) "\r\n"
      "Connection: close\r\n"
      "\r\n"
      ))
      (send-current-file proc))
      ;; not a regular file
      (process-send-string
      proc (concat "HTTP/1.0 404 Not Found\r\n"
      "Connection: close\r\n"
      "Content-Type: text/html\r\n"
      "\r\n"
      http-404-message)))
      (delete-process proc)
      (setq http-hits (+ 1 http-hits)))))
      (offer-http-service))

      ;; show number of hits
      (defun show-http-stats ()
      (message (concat "HTTP hits: " (number-to-string http-hits))))

      ;; determine the mimetype of path
      (defun get-mimetype (path map default)
      (if (eq map nil)
      default
      (let ((element (car map)))
      (if (string-match (car element) path)
      (cdr element)
      (get-mimetype path (cdr map) default)))))

    3. Re:Why only the httpd? by Azza · · Score: 1

      Sad... Y'know, I just bet this'll be moderated as 'Troll'. It really doesn't deserve troll status. Here's a couple of tips:

      1. Don't be so fscking obvious. This is about 0.0001% more talented than 'Linux sux'.
      2. Adding 'Thank you' to the end of trolls works for grits boy. Don't try and rip it off, it's pathetic.

      Hey, Rob, why isn't there a 'stupid' moderation option?

    4. Re:Why only the httpd? by Anonymous Coward · · Score: 2

      Hey, Rob, why isn't there a 'stupid' moderation option? There doesn't need to be, it's already assumed.

    5. Re:Why only the httpd? by Woodlark · · Score: 1

      Well, people who've been around for a while will recognize this rant. I've seen it verbatim several times before *shrug*

      Droit devant soi on ne peut pas aller bien loin...

      --
      Droit devant soi on ne peut pas aller bien loin...
      Straight ahead of him, nobody can go very far... -- Le P
    6. Re:Why only the httpd? by asink · · Score: 1

      donno... seems like a joke to me, but whatever.
      a) Linux is a product?
      b) the famous rm 'security hole' :) so funny.
      c) the black screen argument... yeah, windowmaker == black screen. Sure. Great stuff, we get some of the best gui stuff around. The only thing that you can succesfully attack is the integration. If only both desktops would just use the _X_ copy area instead of thier own stupid ones... It would save me headaches.

      --
      "Hex, Bugs, and Rockn'Roll"
    7. Re:Why only the httpd? by Jeremiah+Cornelius · · Score: 1

      Yeah! One of the Guys I work with is a contributor to this project! Weird and cool...

      --
      "Flyin' in just a sweet place,
      Never been known to fail..."
    8. Re:Why only the httpd? by segmentation+fault · · Score: 1
      I've heard some people are building an entire operating system in LISP
      So? I've heard that several operating systems are written in C. That's far beyond weird and funny :)
      --
      -segfault
    9. Re:Why only the httpd? by SpringRevolt · · Score: 1

      The is mind-bogglingly cute. Presumably you didn't think this up on the spur of the moment?

  2. My gosh. It's only a matter of time by ghazban · · Score: 2

    until... web browser include http servers in their scripting language... so warez kiddies can setup their own http servers really easily, hell.. it happened with xmms and icecast.. ;)

    1. Re:My gosh. It's only a matter of time by yerricde · · Score: 1

      until... web browser include http servers in their scripting language...

      Done. Emacs-W3 is a web browser, and an Elisp http server has been posted above.

      so warez kiddies can setup their own http servers really easily

      Heck, they could use the WinApache server for that.

      --
      Will I retire or break 10K?
  3. TeX? by Anonymous Coward · · Score: 1

    Hey guys
    Any voulonteers for writing a web server in TeX?

    P.S. Assembly?

  4. C by 3247 · · Score: 1

    Hey, what's so weired about that? Some people even wrote one in C.

    --
    Claus
  5. Mirrors!? by Anonymous Coward · · Score: 1

    The postscript-server seems to be slashdotted (surprise!). I want to see the code!

    1. Re:Mirrors!? by pugo · · Score: 1

      The student-network where my server lives has some serious problems with a switch, which causes about 10 seconds of downtime every minute. We have phoned the responsible people and hope they will reset the switch. Sorry about that!

  6. Mozilla by JLucero38 · · Score: 1

    speaking on different types of html language, what about the newest that seems to be leaving its mark ?? xml ? what Netscape 6, and Mozilla is made from ?? its quite user friendly, and purty =) u can find Mozilla Milestone 15 @ http://www.mozilla.com/binaries.html or Netscape 6 PR-1 @ http://www.netscape.com/download/previewrelease.ht ml?cp=djusea

  7. Umm by Anonymous Coward · · Score: 1

    how about making it a bit hard for the average slashdotter to access these handicapped servers ?
    A small riddle, simple encryption, etc. would work I guess.
    There is not much use in posting a direct link coz it will be down in a minute.

  8. PS Source Code (GPL) by Mignon · · Score: 5

    "To install it, run from inetd:"

    8080 stream tcp nowait nobody /usr/bin/gs gs -dNODISPLAY -q \
    /home/pugo/src/postscript/pshttpd/pshttpd.ps

    Here's the source, in case the server gets PSDotted:

    %! %================================================= == % PS-HTTPD V1.0 %
    Copyright 2000 Anders Karlsson, pugo@pugo.org % License: GNU General Public License
    %=============================================== ==== /get_file % read file /infile
    and send it to %stdout { /buff 2048 string def { % loop infile buff readstring { stdout exch writestring
    } { stdout exch writestring infile closefile exit } ifelse } bind loop } def /read_command % read
    command from stdin and define it to /command { /stdin (%stdin) (r) file def /inbuff 256 string def
    stdin inbuff readline pop /command exch def } def /concatstr % (a) (b) -- (ab) { /beta exch def /alfa
    exch def /buffer 1024 string def alfa buffer copy pop buffer alfa length beta putinterval buffer (\000)
    search pop exch pop exch pop } def /hitcount { /hitfile (/usr/local/psweb/hits) (r) file def /hits 16
    string def hitfile hits readstring pop hitfile closefile /hitfile (/usr/local/psweb/hits) (w+) file def cvi 1
    add hits cvs hitfile exch writestring hitfile closefile } def /print_header { stdout (HTTP/1.0 200
    OK\n\n) writestring % stdout (Server: PS-HTTPD/1.0\n) writestring % stdout (Content-type:
    text/html\n) writestring } def /parse_result { command token { (GET) eq { ( ) search { root exch
    concatstr % build path /filename exch def pop pop % define filename and clean stack filename
    filename length 1 sub 1 getinterval (/) eq { filename (index.html) concatstr /filename exch def } if %
    add index.html filename (..) search { stdout (4711 Stupid user error!\n\n) writestring quit } if pop
    filename /infile exch (r) file def % open file print_header get_file } if } if } if } def % Init
    environment /stdout (%stdout) (w) file def /command () def % Root-path (root of WWW-pages)
    /root (/usr/local/psweb) def %% Uncomment this and place a file named "/usr/local/psweb/hits" %%
    (you can change the path in hitcount above) containing only a "0" to %% get a hitcount % % hitcount
    % add one to the hitcount % Read a command from the server read_command parse_result quit

    1. Re:PS Source Code (GPL) by Mignon · · Score: 1

      The Dude has spoken.

    2. Re:PS Source Code (GPL) by Jason+Earl · · Score: 1

      Writing a web server in sh or Postscript is a very wizardly feats. To be truly sick, however, your project must be written in Intercal.

  9. (OT) Retro technology comes full circle by Morbid+Curiosity · · Score: 5

    "... it's time to back-up to, say ... using bone chips as knives"

    Funny you should mention that - a lot of very delicate eye-surgery these days is done with glass or obsidian knives because at the small sizes needed they're a lot sharper than steel. The blades are flaked by Aleuts, who've been fashioning such knives for centuries, because they're the only ones who still have the skills to do it (incidentally making some of the most dangerous water-based weaponry in the world).

    OK, it's mostly off-topic, but it's still damned cool :-)

    1. Re:(OT) Retro technology comes full circle by wheezy · · Score: 1

      Anybody read Snow Crash recently?...

    2. Re:(OT) Retro technology comes full circle by Morbid+Curiosity · · Score: 1

      "I have trouble believing this. There would be no quality control, no sterile conditions, etc."

      Just because you've got a person from an unsterile place not renowned for its quality countrol doesn't mean you can't take that artisan somewhere else to do his work, and subject it to quality control.

      "Furthermore, the knowledge to flake blades is alive and well. There are amateurs, including some very skilled archaeologists who want to understand how primitive peoples made points, who have such skill that they can fool experts."

      I didn't say it was dead - however, the skill level needed to fool experts as to the authenticity of archaeological specimens would probably not be as high as that needed to make blades for surgery, would it?

    3. Re:(OT) Retro technology comes full circle by xeer0 · · Score: 1
      "... it's time to back-up to, say ... using bone chips as knives"

      I take this to mean that writing an httpd in shell script is backing up.

      It's actually just the opposite. It's a step up to a higher level language than c, which is what they are most frequently writing them in these days.

      Now writing one in PS is just plain wack. :)

      --
      "Hey... don't be mean." --Buckaroo Banzai
    4. Re:(OT) Retro technology comes full circle by PD · · Score: 1

      Just because you've got a person from an unsterile place not renowned for its quality countrol doesn't mean you can't take that artisan somewhere else to do his work, and subject it to quality control.

      If you take the artisan somewhere else and subject his work to quality control, then it's art no longer.

    5. Re:(OT) Retro technology comes full circle by goliard · · Score: 2

      I, too, have been informed (when I worked at the Exploratorium) that napped obsidian blades are used for surgery. The reason given was that obsidian can be napped down to monomolecular edges. These are, of course, incredibly fragile. Obsidian can be napped absolutely smooth (no burs), because it naps along a grain. In obsidian the grain is curved, so you get a scalpel-shape naturually. I see no reason they wouldn't be easy to sterilize: obsidian is volcanic glass, and as easy to sterilize as a test tube.

      As it happened, while I was working in the Exploratorium, they had an obsidian napper as a guest artist a couple of times. Intrigued by this idea, I used a couple of his shards -- not blades, just leftovers -- to perform an eye dissection. They worked quite well.

      As to whether they are actually being used, or who would be manufacturing them, I could not say.

      FYI, for Stephenson fans: I have also done stained glass work, and broken/cut/ground a fair amount of window glass. Normal window glass doesn't have much of a grain, and I don't think it can be napped worth a damn. It's not like obsidian at all.
      ----------------------------------------------

      --
      -*- Any technology indistinguishable from magic is insufficiently advanced -*-
  10. dd/sh by oyvindmo · · Score: 5

    Some years ago, somebody set out to implement various things using only dd and sh. Their accomplishments included a text editor, a web server and -- to prove a point -- a Turing machine. The things could be found on the now non-existant http://dd.sh/ (fantastic, eh? :) but are now located on http://www.assurdo.com/dd.sh/. These things warm my heart. *happy sigh*

  11. PostScript flexibility by Tet · · Score: 4

    Few people realise that PostScript is a full programming language, not just a page description language for printers (for the uninitiated, it's similar to Forth -- remember the Jupiter Ace?). I used to have a ray tracing program that someone had written in PostScript (in under 2K as well!). Of course, performance wasn't too great...

    --
    "The invisible and the non-existent look very much alike." -- Delos B. McKown
    1. Re:PostScript flexibility by blane.bramble · · Score: 1

      Somewhere I still have a Jupiter Ace... it's probably being kept company by my Sinclair QL, ZX81 and Philips CP/M machine. Shhh, I've just uncovered the fabled computer graveyard.

    2. Re:PostScript flexibility by Roger_Wilco · · Score: 1

      I wrote a program to calculate the Mandelbrot set in Postscript, as well as a few simpler fractals. If you're interested, you can find them here.

    3. Re:PostScript flexibility by Tet · · Score: 2
      Somewhere I still have a Jupiter Ace... it's probably being kept company by my Sinclair QL

      I can do better than that. Although I never had a QL, I do have a BT Merlin Tonto phone. It's basically a QL with a handset bolted onto the side! Complete with twin microdrives and all. It's very cool having a phone that you can program (even if it is in basic). It also had a great UI. Pick up the phone and type a 3 digit mnemonic representing whoever it is you want to call, and it dials the number for you. I just wish there was a modern equivalent...

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
  12. Sacrilage!!! by Z00100 · · Score: 1

    Yo do realize the magnitude of the sin you have just committed?

    For punishment, you shall be sacrificed at the altar of tux!!

    --
    Visit http://hardwareflux.com
  13. HTTPD in assembler by Anonymous Coward · · Score: 4

    At the asmutils page. 586 bytes standalone executable. Make that!

    Best regards,
    The Anonymous Coward from Estern Europe

  14. Re:The Future is Here! by The+Evil+Beaver · · Score: 1

    Heh, give it a year or so, and Emacs will be a complete operating system. I am sure that by now, there's a spreadsheet system for Emacs, and Tetris for Emacs, and even a Z-Machine emulator for the thing! It's amazing... Emacs is like Lego, you are limited by your mind only (well, with Lego, you are limited by what bricks you have too, but that's besides the point).
    All hail Emacs! (=

    ----------
    Is this sig off topic?

    --
    Chris 'coldacid' Charabaruk Meldstar Entertainment
  15. From the i-cant-connect dept. by wolvie_ · · Score: 1
    Is it just me, or is everything except Slashdot slashdotted?

    --
    You're full of crap, Fry! *bzzt* You make a persuasive argument, Fry!

    1. Re:From the i-cant-connect dept. by lubricated · · Score: 1

      no you are wrong. slashdot will often become slashdotted itself.

      --
      It has been statistically shown that helmets increase the risk of head injury.
    2. Re:From the i-cant-connect dept. by PollMastah · · Score: 2

      Indeed. All too often, we see the Recursive Slashdot Problem... slashdotters attract more people to slashdot, and so slashdot slashdots more sites causing more slashdotters to come to slashdot, with the slashdot effect that slashdot becomes slashdotted because of the slashdot effect caused by slashdotters endlessly slashdotting on slashdot and slashdotting more sites bringing more slashdotters to the slashdotted slashdot...

      Gah, I lost my train of thought ... my brain got slashdotted! :-P

      --

      Poll Mastah

    3. Re:From the i-cant-connect dept. by z4ce · · Score: 2

      dang sed s/slashdot/geek on this post and JonKatz has a new article:)

  16. Jigsaw by David+A.+Madore · · Score: 4

    While we're talking about HTTPD's written in various languages, the W3 Consortium has written a free (as in speech) HTTPD entirely in Java for maximal portability: Jigsaw (see also the Jigsaw test site — that is, let's see how Jigsaw reacts to being slashdotted:-).

    As you can guess, Jigsaw is fully HTTP/1.1 compliant (last time I checked, Apache still had some problems with that). While it's certainly much less efficient than Apache, it's probably also more flexible, modular and reusable. Personaly I haven't given it more than a cursory glance: I wonder if some people have tried it more thoroughly and would care to review its pros and cons?

    1. Re:Jigsaw by hargettp · · Score: 3

      I use to run Jigsaw at home to serve up various documents on my network and to test server-based programming (Perl/CGI, Java servlets, etc.).

      As a positive, Jigsaw is a feature rich server.

      - Permits configuration of MIME types, content negotiation

      - Security-based access to selected resources (not SSL--just standard HTTP USER and PASSWORD authentication)

      - A Java-based admin tool suitable for remote administration

      - Support for virtual servers

      - Enables server-side processing, such as server side includes, CGI (through executables or through interpreters such as Perl), servlets, and a form of page scripting that allowed Java to be embedded in HTML (pre-JSP), among other techniques.

      - Conformance to current specifications.

      Eventually, I've abandoned Jigsaw, preferring either Apache or Tomcat. Here are my reasons:

      - Performance. Although Jigsaw is not abominable, this was never a fast server.

      - Frequent hangs. Although it is possible this was a WinNT issue, I found Jigsaw would frequently hang, often while serving images (?) for a document. On NT it would hang so badly Windows Explorer itself would no longer be able to display images for Web Folders unless I rebooted.

      - An arcane architectural model. Jigsaw has a very powerful yet very abstract design based upon resources, frames, and filters. Sure, that was great for providing nearly limitless ways of customizing it's behaviour, but it was pretty hard to figure out what type of class to extend in order to customize the server. Frankly, servlets +JSP+all else Java give me just about all the customization I need.

      - Slow integration with non-W3C standards. That's definitely a whine, but Jigsaw was usually a fraction of a step behind Sun's latest servlet spec, and took forever to adopt JSP in place of it's own Java-in-HTML service (although I did like their implementation). In fairness, this has been simply because W3C hasn't had resources for more than 1 or 2 people to handle the code, and the original author has unfortunately moved on from the W3C.

      So, I haven't found Jigsaw worth running on a regular basis, but I will leave you with this: there's a *heck* of a lot of free code inside that server, so if nothing else one can learn from their design and even borrow some bits (haven't checked the license recently) for other projects. Good source of samples for Java network programming.

      My $.02

  17. In shell by David+A.+Madore · · Score: 3

    It's too easy. Try this for example:

    #! /bin/sh
    # Set the following to the location of Apache:
    APACHE_LOC=/opt/apache/bin/httpd
    exec $APACHE_LOC "$@"
    exit 1

    1. Re:In shell by David+A.+Madore · · Score: 2

      Easy:

      `r`.n`.e`.d`.d`.i`.b`.r`.o`.F`. `.3`.0`.4i

  18. GS is cheating by Bassthang · · Score: 2
    Running it under Ghostscript is cheating. Now, if you could actually run a web-server from a Postscript printer, that would impress me ...!

    --
    "What I look forward to is continued immaturity followed by death."
    1. Re:GS is cheating by Megane · · Score: 3

      Later model Apple Laserwriters do have an Ethernet port, but no TCP/IP stack that I am aware of. Would it be cheating to set up a protocol proxy to translate TCP/IP into PAP (Printer Access Protocol)? Would it be cheating to also translate the request into a Postscript command?

      But the real problem with running it on a real printer is that older (pre-EnergyStar) laser printers suck electricity like crazy. Once I decided to leave my Laserwriter (a IIntx at the time) on continously for a whole month. At the time I lived in a small apartment, with a $35/mo average electric bill, and leaving the printer on caused it to jump by about $20!

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    2. Re:GS is cheating by pugo · · Score: 1

      Of course it's cheating, as I say on the webpage. The problem is that there aren't any support for TCP/IP in normal Postscript. Maybe I should mail Adobe and tell them that they should add support for TCP/IP in next version of Postscript.

    3. Re:GS is cheating by alannon · · Score: 2

      I have a LaserWriter II with a IIg board in it, and I'm pretty sure that it drops to a low power mode after being idle for 5 minutes or so, since the fuser goes cold, and after an extended period the printer takes a minute or two to print something, needing to warm up first.
      I seriously would recommend getting yourself a IIg, as it has an Ethernet port and far better print quality than the IIntx.
      I actually find it amazing that Apple was able to produce a print engine (the LaserWriter II) that sold for 8 or 9 years, though 5 I/O board revisions, before finally being retired, and that a IISC (1 Meg of Ram, Postscript 1) can be upgraded to a IIf (up to 32 megs of RAM, Ethernet and Postscript II) by a simple I/O board swap.

    4. Re:GS is cheating by INT+21h · · Score: 1

      There used to be a printer just about next door that had its own ip-stack and webserver... I only saw one webpage from it, a status-page basically... what brand was it again? T'wasn't a HP...

    5. Re:GS is cheating by Grimoire · · Score: 2

      The IBM Network Color Laser printer has a builtin web & ftp server. You can manage the printer via www and submit jobs via ftp. This is the OEM version of a printer made by Cannon. Not sure if the Cannon model is still available but I know the IBM model was discontinued awhile back.

      12PPM in B/W 4 in color. I put 32MB memory in it and it had it's own LPR spooler with a 480Mb (I think) HD in it. Sweet printer.

      --
      To misquote Churchill, never has an operating system (FreeBSD) used by so many been administered by so few. - NetCraft
    6. Re:GS is cheating by RobertEdwards · · Score: 1

      Lexmark printer network addapter/server cards have a tiny built in web server. This is mostly for displaying printer status and such, but they included a link to www.lexmark.com for ordering new supplies. Cute.

    7. Re:GS is cheating by swb · · Score: 1

      The hard part about using a printer's PS engine to execute it would be that most printers PS engines are seperate from their IO engines. The IO engines will pass your code to the PS interpreter for execution, but once you got the server running how would you get requests to the server?

      Even if there was some way for the executing PS code to get additional data AND you could get something approximating an HTTP request to the printer through the IO engine's print server, there's probably no way to get the data back from the program -- the IO engine probably can get "I'm can't render this" messages back from the PS engine and that's about it. I suppose you could actually PRINT the replies, but would that enable the code to keep running?

      What this makes me think wonder is: why are there no Postscript compilers? You would think that it might make sense to compile postscript to a faster native machine code than to simply interpret it. I'd bet that a lot of printer-driver generated postscript throws in a lot of the same code for print jobs that could be compiled, the object code cached, and re-used for subsequent jobs. OrNot.

    8. Re:GS is cheating by Megane · · Score: 2

      All Laserwriter II models use the same engine. The engine is the problem. It was not designed to have a power saving mode. OTOH, Apple has made at least one model of printer (the Personal LW 600, I think -- whatever it is, it's a QuickDraw printer) that doesn't even have a power switch!

      And yes, I do have a IIg board now. That's why I said it was a IIntx back then. In fact, I now have two spare IInt printers and passed up another because they are so old they show up cheap (like $15-20!) at thrift stores these days.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  19. Coding in unusual languages by Nilz · · Score: 3

    Despite the funny things about it, I like these 'senseless' projects of programming. They sometimes show up possibilities nobody ever expected.

    A good example is 'The Towers of Babylon' programmed on the editor VI.

    About ten years ago I 'programmed' a Texas Instuments 53 pocket calculator. With just 32 commands and almost no memory (one number could be stored) I was able to program the square root function. OK, it was about 20 times slower and also not as accurate as the square root key of the calculator, but, hey!, it worked! ;o)

    Actually I'm messing around with CGI and WAP. Right now I'm focussing on a script that sends a 'whois' query to a bot placed in the IRCnet and displays it on the mobile phone. No one I talked to thought this script has any sense. Well, I'm not sure, but it's fun to program!

    1. Re:Coding in unusual languages by Titanhead · · Score: 2

      Remember this page?
      It has implementations for "99 bottles of beer" in over 200 languages, including some really obscure ones. (trumpet winsock, turing machine, pov-ray just to mention a few).
      Have a look and laugh.

    2. Re:Coding in unusual languages by alarosa · · Score: 1

      Haha, excellent page. They don't seem to have a LotusScript implentation of the song though. I'll fix THAT when I go to work on Monday!

    3. Re:Coding in unusual languages by j-pimp · · Score: 1

      I love that page. Hopefully the slashdoting it recieves is appreciated by the owner.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
  20. bash-httpd by Morty · · Score: 2
    Writing a web server in sh-style shell is relatively easy. Here's mine:

    bash-httpd

    But writing one is postscript is cool. :)

  21. Remember the Atari server? That was BASIC by Pflipp · · Score: 2

    Hi,

    Some time ago someone posted on slashdot about an Atari 800 server. I was one of the lucky to get through the "slashdot effect", and I saw the source code of this thing. It was in BASIC. It first redirected the output, and then it went like:

    40 PRINT ""
    50 PRINT "This page serverd by Atari"

    ...ertc.

    Great.

    Haven't figured out yet how Postscript should be executable, though. This time I haven't yet get through the /.ted page.


    It's... It's...

    --
    "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
  22. virii? by Pflipp · · Score: 2

    Hi,

    It should, then, be so damn easy to embed a virus in a PostScript document, right? Or am I being paranoia? (Or has it been done n times before, and didn't I notice?)

    (BTW at my last post (just above) the HTML tags have fallen away cause I had Extrans on. I don't understand: if I want these tags to work (like here) they never do. Whatever.)


    It's... It's...

    --
    "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
    1. Re:virii? by Pflipp · · Score: 1

      Listen dude, *I* come from Holland, so *I* have an excuse. You should be glad that I am able to talk English anyway.

      *You* have NO excuse for talking the way you do. Offensive language, and even anonymous. You're even a lower life form than those that call you anonymously by telephone to offend you.

      Furthermore, my question was *not* "what is the plural of virus?" and as it seems, I don't seem to be the only confused around here (see your own link), so I think "fucking bitch as nigga" is a little bit overdone!

      Now smart ass, *answer my question* or die silent, please.


      It's... It's...

      --
      "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
  23. Way back then by redhog · · Score: 2

    Way back then, there was an entire computer system type that run LISP as its machine language. They had an entire LISP OS, and even a windowing system. Everything written in LISP. History repeats... Soon, all our programs will be scriptable with guile...

    As with Pugo - he's a real freak (I know him personally)...
    --The knowledge that you are an idiot, is what distinguishes you from one.

    --
    --The knowledge that you are an idiot, is what distinguishes you from one.
    1. Re:Way back then by dlc · · Score: 2
      • Everything written in LISP. History repeats...

      Not repeats, recurses ...

      darren


      Cthulhu for President!
      --
      (darren)
  24. secure sh-httpd? by kijiki · · Score: 5

    Man, trying to secure a httpd written in sh is gonna suck. Just for starters, try:
    http://jester.vip.net.pl:8081/../../../../../../ ../../../../etc/passwd

    It also appears you can execute arbitrary commands by changing your reverse DNS to contain the command and '|', ';' and/or '&'.

    There is a good reason not to write CGI scripts in shell, and an even better one not to write a whole httpd!

    1. Re:secure sh-httpd? by jefp · · Score: 1

      To avoid security holes in shell scripts the main trick is to always put argument expansions inside double quotes. Doing this would fix the abovementioned reverse-DNS hack, among others.

      Blocking the .. snooping would also be pretty easy - just add a little switch statement.

      Along the same lines as these servers, here's my web server in 150 lines of C. It's more featureful than these - it does index.html, and even directory listings.

    2. Re:secure sh-httpd? by jefp · · Score: 1

      Why don't you try it and report back to the class?

    3. Re:secure sh-httpd? by toh · · Score: 1

      Actually, the AC's example will work. Try

      foo="`/bin/ls`"
      echo "stuff $foo stuff"

      The real trick is to never, ever subject user-supplied input to a shell eval. This is one of the reasons I never, ever use the csh (among other things, it implicitly does an eval on variables like HOME, TERM, and USER when the shell is invoked).

      --
      -- Life is short. Forgive quickly. Kiss slowly. ~ Robert Doisneau
    4. Re:secure sh-httpd? by Mr+Z · · Score: 1

      Your example appears to work, but for the wrong reason. The `/bin/ls` gets executed before being assigned to foo in the first line. This is due to using back-ticks inside single-quotes. What you really want is double-quotes contained inside single-quotes (not back-ticks).

      To mimic the AC's example, you need the following script:


      foo='"; /bin/ls; echo "'
      echo "stuff $foo stuff"

      When you run this, you'll discover that quote pairing happens before variable expansion (as you'd expect), yielding the following output: stuff "; /bin/ls; echo " stuff .

      The remainder of your post is correct, though. Oh, the horrors of csh and even some variants of sh!

      --Joe
      --
    5. Re:secure sh-httpd? by toh · · Score: 1

      You're right, of course - that's what I get for posting during daylight hours. Sorry about the misinfo, but then the vagaries of shell quoting have bitten us all.

      I think what I actually had in mind when I posted that was something still different:

      foo='`/bin/ls`'
      eval echo "stuff $foo stuff"

      Which doesn't actually even relate directly to the example. Oops.

      --
      -- Life is short. Forgive quickly. Kiss slowly. ~ Robert Doisneau
  25. Symbolics Lisp Machine (was Re:Way back then) by oyvindmo · · Score: 1

    I imagine you're thinking of the Symbolics Lisp machine. It was/is indeed a very nice machine, running an operating system called Genera.

    The user interface was quite special, indeed. It can best be explained as "XMLTerm on speed". It was basically a command line interface, but pretty much everything could be clicked on with a mouse. A status line on the bottom of the screen showed what different mouse button actions would do to the "object" currently pointed at -- very helpful.

    Lots of information can be found on the Sy mbolics Lisp Machine Museum.

    Oh, and by the way: Symbolics (the company) is currently developing and delivering Open Genera for Alpha-CPUs. :-)

    1. Re:Symbolics Lisp Machine (was Re:Way back then) by daviddennis · · Score: 2

      I used a Lisp machine at MIT in the late 1970s.

      There were a lot of really cool things about it, but it was way ahead of its time in terms of computing power. The mouse action was so sluggish it gave me an intense prejudice against GUIs which lived on for decades.

      D

      ----

    2. Re:Symbolics Lisp Machine (was Re:Way back then) by cracauer · · Score: 1

      I have two working Symbolics Lisp machines to give
      away for free in Hamburg/Germany. I will
      even ship in northern Germany to get a new home
      for them now that I'm moving to a smaller house.

      Martin Cracauer cracauer@seagull.cons.org

  26. muLinux by Andrew+Cady · · Score: 1
    I'm not sure if this is the same sh-script http server (I can't get in to the site), but muLinux has an http server with directory listing built in ash-script (in fact, most of muLinux's apps are in ash-script) the point being that they can be edited without another machine. IMHO it's not at all pointless as many of you are saying. If you look at what muLinux has done with ash, it's really incredible and very useful. I always keep a disk with mu on hand. :)

    (I've plugged it so much, I feel compelled to say I have no vested interest in muLinux, except as a fan.)

  27. actually.. there is (an httpd in ASM for linux) .. by *borktheork* · · Score: 1
    an httpd written in IA32 (x86) assembler for linux. It's amazingly fast, doesn't use libc (does straight kernel syscalls) and is, get this, about 750 BYTES! Yes, BYTES! Don't believe me?

    Go to http://linuxassembly.org and look at the asmutils package. That Konstantin is one mighty assembler wizard.

    --
    *borkborkbork*
  28. Be Kind... by idoru · · Score: 1

    ...at least they didn't do it in C++

  29. httpd written in hell - are you talking about IIS? by xmedh02 · · Score: 2

    OOPS, a typo. :-)

  30. More absurd programming by kcarnold · · Score: 1
    Somebody wrote a bc(1) replacement in... AWK! I'm not linking to it here because it was so cool that they distributed it with the package. On Debian systems it can be found in /usr/doc/awk/examples. It can even do square roots. I would like to know what its algorithms are, but talk about obfruscated... everything except the few comments are either strings of incomprehensible symbols, or strings of letters in no particular order that I can discern. Even if I did know awk, trying to understand how it works would still elicit an "awk!" from just about anyone except the author.

    Next project: port Linux to a Turing machine. Then I could run it on my TI-89 calculator, in the Turing machine simulator I wrote...

    Seriously, if someone wants to try that, for it to be at all useful, you would need to define extensions to the normal TM functionality to handle things like keyboard and monitor IO. Maybe these could be added as states in the state machine. It would also be useful for the simulator to be a multi-track TM, knowing that a single-track TM can simulate a multi-track TM so there is no change in computing power, just ease of coding.

    Kenneth

  31. Where's OOG the Caveman when you need him? by Netsnipe · · Score: 2
    "Faith that we've evolved too far: it's time to back-up to, say ... using bone chips as knives ;)"

    Httpd can be written in something more primitive than Postscript or shell script, let alone Lisps. All we have to do is get OOG the Caveman to write it up in simple grunts and groans. Throw in a few cave paintings and it'll even have a state of the art GUI!

    Then caveman shall once again rule the world. Don't forget to pay him in dead sabre-tooth carcasses and mammoth skins!

    --
    -- "I can't tell the future, I just work there." -- The Doctor
  32. Re:The Future is Here! by sirket · · Score: 1

    Amazingly enough, only Linux people actually use or like emacs (with a few minor exceptions). Everyone else uses (and loves) vi or vim.

    Just a side note.

    -sirket

  33. Re:What is the point of shell scripts? by darango · · Score: 3

    Because building good things is not limited to the likes of folks who think everything has to be re-written from scratch just becuase we have fancy new tools.

    Shell scripts and their bretheren (perl, tcl/tk, python) are great glue-ware for folks who are smart enough to realize that the wheel does not need to be redesigned every few years. I can glue together existing command line tools using a few well-written lines of script to perform complex tasks that the original developers of CLI tools could not imagine.

    I am thankful that CLI tool builders use stdin and stdout so that my tools can feed and be fed.

    In short, people still pulling out their visual IDE tools are the people that are holding the information revoltion back. We must embrace the existing technologies and tools that make our life easier rather than waste our time building everything from scratch, simply because they are old.

  34. Big Deal by roman_mir · · Score: 4

    I heard about a company who wrote a graphical interface to a 4 bit operating system and called the whole thing NT Server!

    1. Re:Big Deal by Old+Wolf · · Score: 1

      Wonder if Microsoft will sue them..

  35. Re:What is the point of shell scripts? by NevDull · · Score: 1

    Agreed. The people who insist on GUIs for everything are the same people who want to be shown how to do everything, to learn nothing on their own.

    "Oh, no. I have to remember something."

    I'm fully a believer in bringing a person up to the level of a decent computer rather than bringing the computer down to them.

    Theoretically, we could have a computer that boots up, dials up to the net, opens up Netscape, loads Yahoo's front page, closes Netscape, hangs up the modem, shuts down the OS and the computer.

    Ease of use? Can you switch on the power?
    Flexibility? Uh... none?
    Value?

    Pretty pictures assist in comprehension of abstract concepts... sometimes... but are not a fully-functional substitute for the nitty-gritty information which we want to get in and out of a computer.

  36. Grunt = On; Groan = Off by Brecker · · Score: 1

    You fail to mention that OOG is a machine-language guru!

    1. Re:Grunt = On; Groan = Off by sumana · · Score: 1
      You fail to mention that OOG is a machine-language guru!
      Isn't OOG short for Object Oriented Guru?

      --
      Ceterum censeo Microsoftam esse delendam.
  37. First mp3 Stream Was written in Shell Script by szyzyg · · Score: 2

    Beleive it or not there is a point to coding things in shell script... speed of development.

    My first version of mp3 server was written in less than an hour using bash and a few unix commands. Sox would record from the sound card, pipe the pcm audio to l3enc which would write an mp3 stream to a file. Meanwhile netcat would listen for connections and start 'tail -f mp3file' to send the 'live' data to the client.

    Mp3 streaming in the days before winamp was even capable of recieving mp3 streams, never mind sending them to shoutcast.

  38. The Poll Mastah's Poll Suggestion of the Day by PollMastah · · Score: 2

    What is the best language to implement HTTPD in?

    1. C... because httpd is written in C
    2. C++... because it's OO and therefore it is better by definition.
    3. BASH... because you wanna bash competing httpd's
    4. CSH... because "csh" sounds cooler than "bash"
    5. AWK... because it represents the evolved single syllable from caveman language (cf. UF comic strip)
    6. sed... because it's all about text-processing isn't it?
    7. grep... because that's the closest thing to something you can grok...
    8. Lisp... becauspe web spelling isp so bad is soundsp like lisping
    9. ELisp... because Emacs is an operating system
    10. PostScript... because those dumb Web designers got it all backwards!
    11. Java... I mean, how else would you taut compatibility with JavaScript?!?!
    12. Visual Basic... because webpages must be visual and basic enough for people to understand
    13. Horn shell... I mean, what about all that pr0n?! (And yes this is a deliberate mispelling of Korn shell)
    14. Perl... after all, that's all the Web is: pathologically eclectic rubbish listings!
    15. Slashcode... because Slashdot is all geeks ever need on the Web!!!
    --

    Poll Mastah

  39. Re:What is the point of shell scripts? by PollMastah · · Score: 1

    And before some GUI zealot posts their rebuttal to this, I'd like to add:

    I fully agree and endorse the idea that users should be trained to use a computer at a reasonable level of proficiency; computers should not be dumbed down to "their" level.

    Just think of the ancient world. Mathematics was something only educated people understood (and mind you, literacy was almost nil back then) and only philosophers enjoyed. Today, if you don't know math, you can hardly make a decent living. Does this mean we should "dumb down" the world so that "everybody" can understand it without needing to go through all that hectic trouble of actually learning how to count?

    Of course not. This is called "education". I don't see why the same principle shouldn't apply in computers. Let's just face it -- our young generation today grew up with computers. They are educated with a high level of proficiency with computers. We do not need to ruin them with dumbed-down UI's that only limits their full utility of these machines.

    This is just the same as the ancient generations who did not know how to count beyond trivial numbers. Today's generation throw around multi-digit numbers every day (and how few of them are actually mathematicians!). Keep the requirements high, and the future generations will grow up to it. Believe me, in a few decades' time, computer proficiency will become as integral to our lives as basic arithmetic is. Dumbing down only slows down literacy.

    --

    Poll Mastah

  40. java by Anonymous Coward · · Score: 1

    // Fin's small httpd (h.java) (C)1999, 2000, W.Finlay McWalter. // Licence: licenced for use by anyone without limitation. // Compiling: javac h.java // Executing: java h // Features: // - works correctly on win32 & unix. // - if URL ends with "/", httpd appends "index.html". // - will send files of any length. // - binary files, such as images, are supported. // - the server is multi-threaded. // - runs ok under MS-IE5's jview runtime. // Limitations: // - hardwired to listen on port 8181. // - document base is 'current' directory. // - very basic error handling - sends 404. import java.net.*;import java.io.*;import java.util.*;public class h extends Thread{Socket c;public h(Socket s){c=s;start();}public static void main(String[]a){try{ServerSocket s=new ServerSocket( 8181);while(true){new h(s.accept());}}catch(Exception e){}}public void run(){try{DataInputStream i=new DataInputStream(c. getInputStream());DataOutputStream o=new DataOutputStream(c. getOutputStream());try{while(true){String s=i.readLine();if((s== null)||(s.length()==0))break;if(s.startsWith("GET" )){if(s==null) throw new Exception();StringTokenizer t=new StringTokenizer(s," "); t.nextToken();String p=t.nextToken();p=(".".concat(((p.endsWith("/" ))?p.concat("index.html"):p))).replace('/',File.se paratorChar);int l=(int)new File(p).length();byte[]b=new byte[l];FileInputStream f= new FileInputStream(p);f.read(b);o.writeBytes("HTTP/1. 0 200 OK\n"+ "Content-Length: "+b.length+"\n\n");o.write(b,0,l);}}}catch( Exception e){o.writeBytes("HTTP/1.0 404 ERROR\n\n\n");}o.close();} catch(Exception e){}}}

  41. Web Fileserver written in MS Word VBA by dildog · · Score: 5
    I wrote this thing a while back to serve files on and off of a machine when a Word document is opened. Try downloading this, and running it with macros enabled. Then browse to your own port 80. If you don't trust word macros, take a look at the source first with the visual basic editor. Requires Office 2000, but will work with Office 97 if you convert it down.

    http://www3.l0pht.com/~dildog/webserver.doc

    Note that you can upload files, download them, execute programs, and change file attributes by clicking on them in the directory list. The webserver shuts down when they close the document though, since I didn't bother to try to make the tool any more insidious than it was already.

    Have fun.

  42. Re:The Future is Here! by fornix · · Score: 1

    Linus hates emacs. He uses vi.

  43. Mindcraft would be happy to see this by theSheep · · Score: 1

    I am sure after benchmarking the servers, they could truthfully claim that NT is faster than Linux!

    --
    -- The Sheep --
  44. Tomcat? by Malcontent · · Score: 1

    I hear excite is using Tomcat is that right? Do you have link to tomcat I'd like to check it out.

    --

    War is necrophilia.

    1. Re:Tomcat? by hargettp · · Score: 1

      Tomcat, from The Apache Group, is really the 100% Java reference implementation of Java Server Pages and servlets. The included web server is very simple but effective, since you can throw in just about any logic in a servlet or JSP to customize the processing.

  45. Next level ? by Helle · · Score: 1

    It would be fun to include this postscriptcode in a HP Laserjet 4 with postscript and a HP Jetdirectcard to get a Webserver/Postscriptprinter...

    Who will be the first to make it happen ??

  46. The Gauntlet Has Been Thrown by Sargent1 · · Score: 1

    Clearly, this topic needs to be further explored. I propose that some Slashdot folks duplicate the effort using Logo, or perhaps INTERCAL.

    Stephen

  47. Re:The Future is Here! by SkipRosebaugh · · Score: 1

    Well, there is a Z-Machine interpreter for emacs (its on www.ifarchive.org), and there's a tetris for z-machine. There's also an inform major mode, so you can write and play interactive fiction with the same program. Heck, someone even converted DOOM to a text adventure.

  48. Rendering in Postscript by pjc50 · · Score: 1

    %!OPS-1.0 %%Creator: HAYAKAWA,Takashi

    /A/copy/p/floor/q/gt/S/add/n/exch/i/index/J/ifel se/r/roll/w/div/H{{loop}stopped
    Y}def/t/and/C/neg/T/dup/h/exp/Y/pop/d/mul/s/cvi/ e/sqrt/R/rlineto{load def}H 300
    T translate(V2L&1i2A00053r45hNvQXz&vUX&UOvQXzFJ!FJ!J !O&Y43d9rE3IaN96r63rvx2dcaN
    G&140N7!U&4C577d7!z&&93r6IQO2Z4o3AQYaNlxS2w!!f&n Y9wn7wpSps1t1S!D&cjS5o32rS4oS3o
    Z&blxC1SdC9n5dh!I&3STinTinTinY!B&V0R0VRVC0R!N&3A 3Axe1nwc!l&993dC99Cc96raN!a&1CD
    E&YYY!F&&vGYx4oGbxSd0nq&3IGbxSGY4Ixwca3AlvvUkbQk dbGYx4ofwnw!&vlx2w13wSb8Z4wS!J!
    c&j1idj2id42rd!X&4I3Ax52r8Ia3A3Ax65rTdCS4iw5o5Ix nwTTd32rCST0q&eCST0q&D1!&EYE0!J
    &EYEY0!J0q!x&jd5o32rd4odSS!K&WCVW!Q&31C85d4!k&X& E9!&1!J!v&6A!b&7o!o&1r!j&43r!W)
    {( )T 0 4 3 r put T(/)q{T(9)q{cvn}{s}J}{($)q{[}{]}J}J cvx}forall 270{def}H
    K{K{L setgray moveto B fill}for Y}for showpage

    % NOTE: this may be a bit mangled ...

  49. Try "cat" by thisrod · · Score: 2

    Andrew Tridgell metioned at a Canberra Linux User Group meeting a few years ago that at first, when the SAMBA project website consisted of one page, it was served by a "cat foo" line in inetd.conf on some machine at ANU; foo was a file containing some http response headers and the page. He figured this would be simpler than installing and configuring apache. I don't think you can get much simpler than that.

  50. We needed a PScript httpd all along by fishexe · · Score: 1

    ...to interpret printer http requests and serve web pages to printers. After all, printers need to surf too!!

    --
    "I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
  51. An HTTPD written in BASIC by erb · · Score: 1

    A web server written in BASIC, in traditional BASIC spaghetti style.

    It doesn't handle images, as the novelty of working in this so-called programming languge again for the first time in 12 years quickly wore off. I hope I haven't caused myself any permanent nerve damage.


    #!/usr/local/bin/basic
    10 root$ = "/home/erb/html"
    20 input "";REQ$
    25 input "",h$
    30 if left$(h$,1) <> chr$(0) then goto 25
    40 contenttype$="text/html"

    100 if left$(REQ$,3)="GET" then goto 200
    120 response$="501 Method Not Implemented"
    130 gosub 1000
    140 gosub 1100
    150 exit

    200 file$=root$+field$(req$,2)
    205 gosub 1200
    210 on error goto 500
    220 open file$ for input as #1
    225 on error goto 0
    230 response$="200 OK"
    240 gosub 1000
    250 html$=input #1
    260 print html$
    270 if not eof(1) then goto 250
    280 close #1
    290 exit

    500 response$="404 File Not Found"
    510 gosub 1000
    520 gosub 1100
    530 exit

    1000 print "HTTP/1.0 ";response$
    1010 print "Server: BASIC-HTTPD/0.0.1"
    1020 print "Connection: close"
    1030 print "Content-type: ";contenttype$
    1040 print
    1050 return

    1100 print "<HTML>"
    1110 print " <HEAD>"
    1120 print " <TITLE>";response$;"</TITLE>"
    1130 print " </HEAD>"
    1140 print " <BODY>"
    1150 print " <H1>";response$;"</H1>"
    1160 print " </BODY>"
    1170 print "</HTML>"
    1180 return

    1200 if right$(file$,1) = "/" then goto 1300
    1240 return
    1300 file$=file$+"index.html":return

    1400 EXIT

  52. Re:actually.. there is (an httpd in ASM for linux) by doubleyou · · Score: 1

    Can you say "gaping security hole"? I knew you could.

  53. I hope I got first Post(Script) by adpowers · · Score: 1

    Hey, I am looking for any one that will help me write a webserver for my TI86 calculator. I can only hope.

  54. Re:The Future is Here! by The+Evil+Beaver · · Score: 1

    I gotta steal that tag for irc... hehehe

    ----------
    Is this sig off topic?

    --
    Chris 'coldacid' Charabaruk Meldstar Entertainment
  55. Re:The Future is Here! by The+Evil+Beaver · · Score: 1

    wow. doom for emacs.
    that has to be cool.
    i wish i could write if with inform... i find it too strange a language tho... if there was perl for the z-machine tho... hehehehe

    ----------
    Is this sig off topic?

    --
    Chris 'coldacid' Charabaruk Meldstar Entertainment
  56. The Print Speed is too slow by georgeha · · Score: 1

    There wouldn't be much gain in efficiency in compiling most PostScript since you're still limited by the print speed of your printer.

    Even printing 180 pages per minute, our PostScript interpreters generally get ahead of the print engine.

    George

    1. Re:The Print Speed is too slow by swb · · Score: 1

      For B&W text only I can see that.

      From my perspective, we only wish our RIPs would keep up with rated speed of the the engine.

    2. Re:The Print Speed is too slow by georgeha · · Score: 1

      Wow, what you using for a RIP, platform-wise?

      George

    3. Re:The Print Speed is too slow by swb · · Score: 1

      Fiery ZX (uses an Alpha processor) connected to a Minolta color copier.