cgi scripts in bash…w00t
Imagine my delight when I realized that anything executable by the OS can be a cgi script (well not sure about Windows, don’t care either). One of my favorite scripting languages to use for prototyping on a daily basis is Bash. This combination makes it insanely easy to construct RESTful resources.
Some of you, and quite a few at my work are like oh noes!@#!$ y0u g0tz noez sekurity when y0u use teh BASH. Excuse me Mr. (php|ruby|c|perl|python|dotNet) code monkey?!? That issue exists for anything that can be executed as a cgi script, so go away.
The bad thing about using cgi scripts is that it reloads the whole thing in memory for every request. It’s not the reloading that really sucks, it’s the incurring the cost of disk access. )-; This is easily mitigated by moving them to a ram disk (including the she-bang) upon every reboot. Just make sure you preserve the same ownership and file modes, otherwise you will get 0wned.

Leave a Reply
You must be logged in to post a comment.