D
D
Dan Ivanov2014-11-28 10:37:05
System administration
Dan Ivanov, 2014-11-28 10:37:05

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

6 answer(s)
S
Sergey Petrikov, 2014-11-28
@ptchol

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.

B
brutal_lobster, 2014-11-28
@brutal_lobster

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.

A
alau, 2014-11-28
@alau

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.

O
O Di, 2014-12-09
@insiki

Maybe there is something interesting here?
Gift N. | Python in UNIX and Linux system administration

V
Vitaly Pukhov, 2014-11-28
@Neuroware

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.

O
Oleg Soroka, 2014-12-04
@oleg40a

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 question

Ask a Question

731 491 924 answers to any question