Is anyone else bothered by how they were handling ssh keys in the example? The whole point of public keys is that the private key never has to leave the box it’s generated on. Once you go sharing them you might as well just use a random passphrase.
Do-nothing scripting: the key to gradual automation
51–60 of 126 posts
Re: Do-nothing scripting: the key to gradual automation
#52Earlier quoted context omitted.
maybe he was a Java programmer? all joking aside, the reason he's doing classes seems to be an intention towards making a FooStep (and/or a BarStep) which could then maybe handle generic Foo stuff (authentication comes to mind) in the future?
"maybe"..."in the future" is the root of much object oriented evil
Re: Do-nothing scripting: the key to gradual automation
#53Seems basically to be a checklist. However, I don't think it's a good idea. Checklists are not bad, but they are to be executed by humans. I think trying to automate an existing human process directly is a mistake. Human processes often have features that only humans can do, such as pattern recognition or adapting to small difference. It's often easier to create a computerized (automated) process from scratch than to…
Well, the specific problem it addresses is: 1. We have a tedious manual checklist 2. We’d like it to be fully automated 3. How do we get there from here?? You’re correct to say that if the process had been fully automated from the start it may well have been implemented very differently. But those scripts are hard to write, and basically useless until they’re complete. Often the only practical way to do this stuff is…
If you try to emulate a person with a checklist, then you will often find it is actually harder to automate, because the steps often rely on human adaptability and common sense.
Re: Do-nothing scripting: the key to gradual automation
#54I get it, but this script looks a lot like a checklist to me. Seems like a checklist is a good place to start, no? If you want more "interest" during the process, make it a point to refine the documentation for your process (clarify a step here, split one command into two steps). Then you have a very clear spec by the time the process needs to be automated.
Re: Do-nothing scripting: the key to gradual automation
#55I know this isn’t the point of the article but the code shown there is the archetypal case where writing classes is an anti-pattern, as argued in “Stop Writing Classes” [1]. All the classes in that code can — should! — be functions. There’s no downside, and it’s less code (and otherwise identical). [1] https://news.ycombinator.com/item?id=3717715
Re: Do-nothing scripting: the key to gradual automation
#56I know this isn’t the point of the article but the code shown there is the archetypal case where writing classes is an anti-pattern, as argued in “Stop Writing Classes” [1]. All the classes in that code can — should! — be functions. There’s no downside, and it’s less code (and otherwise identical). [1] https://news.ycombinator.com/item?id=3717715
I dunno. it could be argued that in the "do nothing" form of the script it's silly. HOWEVER some of those steps could eventually require the encapsulation of lots of behavior and information. So, `CreateSSHKeypairStep` Could become a full-on class with lots of small methods in it that eventually get wrapped up in a `.call` method. It seems better to start with code that's prepped for the eventuality you know is comin…
Re: Do-nothing scripting: the key to gradual automation
#57I get it, but this script looks a lot like a checklist to me. Seems like a checklist is a good place to start, no? If you want more "interest" during the process, make it a point to refine the documentation for your process (clarify a step here, split one command into two steps). Then you have a very clear spec by the time the process needs to be automated.
I think the value of using a script as your checklist is that the script can handle some of the book-keeping for you, including making it harder to lose track of where you are.
Re: Do-nothing scripting: the key to gradual automation
#58I'm very much against documenting concrete steps in a wiki if it is something that can be scripted. Such documentation becomes something that you must maintain, and faulty documentation is worse than no documentation.
I think that wiki documentation should be used to summarize workflows and provide context, but if you're writing step-by-step instructions, often you can just write a script with exactly the same amount of effort.
Re: Do-nothing scripting: the key to gradual automation
#59Is anyone else bothered by how they were handling ssh keys in the example? The whole point of public keys is that the private key never has to leave the box it’s generated on. Once you go sharing them you might as well just use a random passphrase.
Yes, very much so. In addition stop using RSA[0] and use ed25519 with `ssh-keygen -t ed25519` [0]: https://blog.trailofbits.com/2019/07/08/fuck-rsa/
Re: Do-nothing scripting: the key to gradual automation
#60I'd go farther... you can have steps that literally "do nothing". They can be comments, or simple echo statements. They're placeholders to remember to write the code for that step later. This is particularly important when you need to deal with integration that isn't necessarily easy - handling auth credential safely, making sure it works in your pipeline, etc. But all this gets back to something I used to say a lot,…