I’ve written Node code, I just try to limit the number of libraries I use
I’ve written Node code, I just try to limit the number of libraries I use
I can’t relate to this feeling at all, writing code using a library I’ve found is almost always the source of bugs. Miscommunication between the library developer and their documentation, or my ability to read the documentation. And that’s on top of how many big libraries I’ve seen with extremely simple exploits. Sadly I have to use a few, but I wince every time I install a package.
I absolutely cannot relate to using a ton of libraries in production code.
No, you’re still misunderstanding what’s being done. ${server_service}
is an injected string, the string is the whole contents of the file. That file is not stored locally on the server, except through being injected here(by a terraform file template). And no, printf
won’t be any better than echo
because its not format string, and I don’t want any formatting from printf applied to it.
I’m reading this and interpreting that line 27 of that script is
And your interpretation is wrong. Line 27 is actuallly
sudo echo "${server_service}" > /lib/systemd/system/server.service
${server_service}
is read from the file I posted in the 2nd image. Since it was a test script I hadn’t bothered implementing any escaping tools, I wanted to make sure terraform allowed this first.
there is no purpose other than legacy of having replaced other commands
terraform(really is just a injection of a file() into a shell script)
I don’t think I did(though sometimes I do accidentally because of the Jeroba app UX)
No, because neither of those are the inputs. The input was the systemd file in the image. The whole command was not printed in the error, only surrounding context. The single-quote was indicating the ending of that context(because it was the end of the line) printed by the error.
The same thing was done with `)'
on the first line of error
I don’t disagree, but this time its my fault
Sadly no, its injected with terraform templatefile
, I already looked for a normal way to autoescape it, but from a brief look I couldn’t find one. I know there is a replace function that can take regex(RE2, which from my understanding prohibits *
in lookbehinds)- but the simplest regex I could think of at nearly 6am for capturing only non-escaped quotes is /(?:^|[^\\])(?:(?:\\\\)+|[^\\]|^)(?'quote'")/gm
. Though, I just realized if the quotes are escaped I would want to double escape them, so actually replacing all quotes with escaped quotes should be fine, also another limitation of this method is lines can’t have trailing \
To avoid having it hosted separately its injected into a shell script as a string
dsygraphia, I meant to say escape the quotes(you can see that because the comment wasn’t about comments but was instead about quotes)
The same is true for JVM bytecode, and C operations really are just aliases for ASM operations, and ASM (sometimes) is just aliases for microcode operations
Thanks for informing me, but I still kinda wonder why someone would use it today?
That’s fair, I know they’re actively rejecting inheritance, but I wish you could make like a prototype. Like say, a function can take a struct with these fields. Which yeah an interface can do but is much more clunky
I was able to pick it up extremely quickly. Just basically looking at existing projects. Tbh, I don’t even know how I learned it.
I looked and couldn’t find it, that’s why I said what I said
I guess I can’t so can you just quote it?
Yeah I absolutely agree, my issue is with libraries that do trivial or not particularly useful things.