[TriLUG] web framework for unix admins?

Jym Williams Zavada via TriLUG trilug at trilug.org
Sun Feb 21 15:56:26 EST 2016


If you do a cgi-bin script wrapper around stdout, don't forget to output a 
"Content-Type: text/html" or "Content-Type: text/plain" header, if the 
framework doesn't do so for you.  Also, if the output is in a text/html 
context, be sure you convert any less-than (i.e. '<') and greater-than (i.e. 
'>') symbols to the corresponding HTML symbol codes if they are not meant to 
be part of an HTML tag: Use '<' for less-than and '>' for 
greater-than.  Another thing to be aware of is that the normal context for 
command-line program output is a monospaced terminal.  Therefore, you'll 
probably want to wrap yours in HTML PRE tags, as in '<pre>cmdline output 
here</pre>', or set up the surrounding HTML/CSS to use a monospace font for 
its display.

When I first started using CGI wrappers for command-line output, I used the 
HTML XMP tag, which would cause all the text between the opening '<xmp>' and 
the closing '</xmp>' to be output as plain text, even the less-than and 
greater-than symbols.  This was a perfect fit for that use.  Unfortunately, 
this tag was deprecated and completed removed out of the HTML standards 
early on, in order to make HTML a compliant subset of XML.  I understand why 
it was done, and agree with the intent, but it sure makes it harder for 
those of us creating command-line output wrappers.

-Jym Williams Zavada


On Fri, 19 Feb 2016 at 08:37, Tim Jowers via TriLUG wrote:

> Hi Dewey,
>
>  Maybe I am being too simple but why not put script into cgi-bin and just
> run stdout to the web page?  It'll stream. Its super simple, but could be
> setup in a day with a standard Linux box with Apache server. Then you can
> simply add buttons/links to your favorite web platform which do nothing
> more than link to each cgi-bin script. Welp, you could secure with some
> htaccess or such. So, might be some security concern/setup needed if that
> is another requirement.
>
> Tim
>
>
> On Thu, Feb 18, 2016 at 7:15 PM, Lance A. Brown via TriLUG <
> trilug at trilug.org> wrote:
>
>> There are several frameworks available for python, since you already
>> know it.  Here's a nice comparison article:
>>
>> https://www.airpair.com/python/posts/django-flask-pyramid
>>
>> --[Lance]
>>
>> --
>> This message was sent to: timjowers <timjowers at gmail.com>
>> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
>> address.
>> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
>> Unsubscribe or edit options on the web  :
>> http://www.trilug.org/mailman/options/trilug/timjowers%40gmail.com
>> Welcome to TriLUG: http://trilug.org/welcome
>>
> -- 
> This message was sent to: Jym Williams Zavada <trilugj at jrwz.net>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web	: http://www.trilug.org/mailman/options/trilug/trilugj%40jrwz.net
> Welcome to TriLUG: http://trilug.org/welcome


More information about the TriLUG mailing list