Main
Main
Artwork
Artwork
Books
Books
Donate
Donate
Licenses
Licenses
Shorts
Shorts
Software
Software
Source
Source


NAME

cat.php

SYNOPSIS

http://insanelywittystupidity.com/pub/php/cat.php? [options] [path]
http://insanelywittystupidity.com/pub/php/cat.php?%20[options]%20[path]

DESCRIPTION

cat.php literally runs a GNU/Linux cat command on Insanely Witty Stupidity's server. And, it can be used to write the contents of a file to a web page-- redirecting stdout to a user's web browser. This allows a user to study the contents of a file before Insanely Witty Stupidity's Apache server has a chance to filter it with a PHP binary (most likely changing the code and censoring PHP scripting code). cat.php can be invoked like a normal GNU/Linux cat binary. But, there are some restrictions. Also, cat.php has its own options.

RESTRICTIONS

Some special characters that are normally used programatically on a GNU system (and other Unix-like systems) are not allowed. These include curly braces (forcing a user to use spaces to cat more than one file), spaces (making it (then) impossible for a user to cat more than one file, set variables, use cat's options (which needs to be improved), etc), and semi-colons (making it impossible for a user to run additional commands on the server). Spaces surrounded by quotes *are* allowed.

cat.php is also sandboxed-- meaning it is not allowed to run commands on folders above the root of insanelywittystupidity.com (which is "/iws"). This is accomplished by using Insanely Witty Stupidity's GNU/Linux cd command to travel to a path preceding a file name and storing the result of pwd. The result can be compared to Insanely Witty Stupidity's root to determine if a user is requesting data from a folder above the root of the website (and, also folders that are protected by Apache .htpasswd files).

Insanely Witty Stupidity also has an ls.php script. It can be used to study the contents of Insanely Witty Stupidity's root and choose files to print with cat.php. See Insanely Witty Stupidity's ls.php manpage for more details.

--font_size [int]

The "--font_size" option can be used to change the font size cat.php requests from a user's browser. This can be useful if a user is printing ASCII art from Insanely Witty Stupidity's /pub/txt folder (for example), and cat.php's default font size is too big (or too small).

EXAMPLE

Use cat.php to print the contents of Insanely Witty Stupidity's index page (using "/iws" as preceding path):
http://insanelywittystupidity.com/pub/php/cat.php? /iws/index.html

Use cat.php to print the contents of bikini.txt (an ASCII art file stored in /iws/pub/txt) with size 8 font (using ".." as preceding path and html codes for URL spaces):
http://insanelywittystupidity.com/pub/php/cat.php?%20--font_size%208%20../txt/bikini.txt

AUTHOR

Written by Michael Atkins.

REPORTING BUGS

Maintainer Michael Atkins' email: thedictator2@gmail.com

COPYRIGHT

Copyright (c) 2019 and 2020 Michael Atkins. Licensed under conditions of the Honest Scripting License, Version 1 <http://insanelywittystupidity.com/html/Licenses.html>.
cat.php is an honest scripting project. It was crafted by its author(s). But-- it belongs to NO ONE!! Users can copy the project, modify it, and redistribute it. There is NO WARRANTY (to the extent permitted by law).

SEE ALSO

GNU/Linux cat command manpage (using a man command on a GNU/Linux system)
Insanely Witty Stupidity's ls.php manpage

Back

______________________________________________

Random Fact: The name "Insanely Witty Stupidity" is a sarcastic homage to William Shakespeare's pretentious (and completely confusing) application of poetic literature in character dialog. After all-- the lack of realism portrayed by Shakespeare character interactions makes it difficult for people to take the work seriously.

html revised 2024-12-20 by Michael Atkins.

The maintainer of insanelywittystupidity.com does not care if people duplicate this page or any part of it-- as long as this notice remains intact.