New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
figlet tool / display ascii art to html/webpage
I'd like to use the figlet command line tool to input text into figlet, then process the output to html.
** note ** figlet processes text into ascii art **
Is there an easiest method to do this? Should I just try php exec? Or what it be easier/better/cleaner/safer etc with python or ruby/camping or node.js or whatever else?
Thanks for any suggetions.
Comments
Use PHP's Text_Figlet package?
http://pear.php.net/package/Text_Figlet
Thanks @awson, however I just went ahead and did it with shell_exec..
Show client IP address in ascii art (eg what is my ip in ascii hehe):
The * in the pre in the code is so it does not conflict with the LET comment pre
Not sure about the security but it works.
@twain, I'd be able to bypass your filters and potentially cause harm with a HTTP_X_FORWARDED_FOR header of
asdf|rm -rf /
. To remedy this, useescapeshellarg($client_addr)
to properly escape input for command line usage.@Adduc, thanks very much for that tip; added and very good to know.
Demo on koding if anyone wants to see... (appears to be showing the koding proxy ip only perhaps.. hmmm)
http://indigodaddy.kd.io/asciip/
Just have to say just logged in to koding for the first time in like 4-6 months and it's gotten a hell of a lot better since then.. instead of a shared environment you spin up your own vm now... really great for playing around with code/stuff/testbeds etc. Beats the heck out of http://1.ai now.