Answer the question
In order to leave comments, you need to log in
How to practice programming as a sysadmin?
Hello.
The question is next. In the current realities, the admin is more and more forced to write scripts in something other than bash / awk, and implement slightly more complex automation than before.
Someone is using perl, someone has python, someone else has something else.
Since not so much is written, but more and more often, I began to notice that I spend too much time writing these scripts / demons. Writing 200 lines of code in python for a primitive task (parsing, aggregation, delivery in several hundred) can take 4 hours, and then another couple of hours to fix jambs.
And if you do 1-2 such tasks per month, then there is almost no progress in the speed of writing and conciseness of the code.
It is clear that you need to practice more, but you can’t just devote a couple of hours a day to writing scripts.
How do you train yourself and your skills in such conditions?
The question is primarily for system administrators, and all sorts of devops there :)
Answer the question
In order to leave comments, you need to log in
If possible, use orchestration systems, if you still feel like writing your own crutch, then only for very frequent tasks, for the sake of one-time work there is no point (if it is not a one-liner). I put pieces of frequently used pieces and blanks from my different scripts into notes and I don’t write each new one entirely from scratch, but pull it from older 90% of the code, for the admin there is no task to write fast scripts, it’s better to study ready-made systems that solve problems, because scripts will have to be maintained, updated and added to, often there is already a ready-made tool, you just need to study it and all development and updating tasks go to the tool manufacturer, or to cut open source with the whole world, but not hundreds of scripts in one snout - this is not an admin profile.
Look towards CM systems a la ansible.
So if the task is 1-2 times a month, there is no point in bothering. Just like doing tasks for the sake of tasks.
If you really want experience - rewrite old scripts, write new ones using the technology of interest.
Add extra. functionality in the current infrastructure systems, all sorts of monitoring, beautiful analytics, etc.
Stop at one scripting language (which is used in the team / you want to learn, etc., any criterion will do; I would say python3 is the best choice), study its standard library, google the solution for your tasks, find ready-made modules / patterns; for many languages there are already many ready-made batteries. And then it's just a matter of practice.
Maybe there is something interesting here?
Gift N. | Python in UNIX and Linux system administration
If you sysadminist not linux but Windows, then the issue is easily solved, you need to write in more controlled languages with strong typing, for example, writing any of the above in C # can be easily done in half an hour and debugging will take from 0 to 10 minutes, with my experience more often the first happening.
In the current realities, the admin has to write scripts less and less .
The admin who writes more and more is a bad admin with a bad outlook.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question