2 ms·
>>I use PHP. There, I admitted it. Very happy to see stuff like this in blog posts. I use it all the time to stand up scripts like this. It makes me REALLY hap
by icelancer 9y ago
>>I use PHP. There, I admitted it.
Very happy to see stuff like this in blog posts. I use it all the time to stand up scripts like this. It makes me REALLY happy to see hacky code like:
>>exec("/scripts/gocode/bin/rtlamr -msgtype={$type} --format=json --filterid={$unitid} --single=true",$output);
I also do this all the time, even to control Windows processes on client/slave machines (generally killing and relaunching stalled programs).
- ahoka 9y agoThe problem that it takes a $type="; rm -rf /" to ruin your day.
- icelancer 9y agoNo doubt, that's why stuff like this should be limited to internal tooling and private use only, not exposed to the Internet. When done that way, it's just infinitely more efficient to write trash code in PHP for one-off things, and there's literally nothing wrong with it when it has an audience of 1 - yourself. Beyond that, yeah, you shouldn't do things like that. But there is no reason to stand up an entire test suite and development environment just to write some stuff to check power usage or internal sensors in your house. (also that command would fail on the machines I run my crap code on, Win10 discardable VMs)