Ravindra BagaleCourses & study guides मराठी

Ravi Sir's Cards › DevOps

Chapter 5: Bash Scripting for Automation: मराठी Cards

English cards · Chapter उघडा

उजळणी (Revision) cards

Script का: सकाळच्या दहा commands. हाताने commands परत परत करणं हळू आणि चुका होणारं.
उजळणी (Revision) card 1 of 11: Script का: सकाळच्या दहा commands · PNG download करा · Card page उघडा

Lesson: 5.1 Why script — the morning ten commands

Shebang, permissions, पहिली script. हे नसेल तर script चुकीच्या shell ने चालते किंवा errors नंतरही पुढे जाते.
उजळणी (Revision) card 2 of 11: Shebang, permissions, पहिली script · PNG download करा · Card page उघडा

Lesson: 5.2 Shebang, permissions, first script

Variables, quotes आणि exit codes. Quotes नसलेले variables spaces वर तुटतात; exit codes दुर्लक्षित केले तर failures लपतात.
उजळणी (Revision) card 3 of 11: Variables, quotes आणि exit codes · PNG download करा · Card page उघडा

Lesson: 5.3 Variables, quotes and exit codes

Health checks साठी if आणि loops. हाताने अनेक servers check करताना काही सुटतात.
उजळणी (Revision) card 4 of 11: Health checks साठी if आणि loops · PNG download करा · Card page उघडा

Lesson: 5.4 if and loops for health checks

Idempotent सवयी: install आधी check. दुसऱ्यांदा चालवल्यावर तुटणाऱ्या scripts धोकादायक.
उजळणी (Revision) card 5 of 11: Idempotent सवयी: install आधी check · PNG download करा · Card page उघडा

Lesson: 5.5 Idempotent-ish habits — check before install

cron basics: script schedule करा. कोणी न चालवलेल्या scripts निरुपयोगी.
उजळणी (Revision) card 6 of 11: cron basics: script schedule करा · PNG download करा · Card page उघडा

Lesson: 5.6 Cron basics — schedule the script

Secrets: कधीच hardcode नाही. Hardcode केलेले secrets Git आणि logs मध्ये जातात आणि leak होतात.
उजळणी (Revision) card 7 of 11: Secrets: कधीच hardcode नाही · PNG download करा · Card page उघडा

Lesson: 5.7 Secrets — never hardcode

Arguments वाचणं आणि पूर्ण sample script. Hard-code केलेल्या values ने प्रत्येक environment साठी वेगळी script.
उजळणी (Revision) card 8 of 11: Arguments वाचणं आणि पूर्ण sample script · PNG download करा · Card page उघडा

Lesson: 5.8 Reading arguments and a full sample script

Functions ने scripts वाचायला सोप्या. Structure नसलेल्या लांब scripts fix करायला कठीण.
उजळणी (Revision) card 9 of 11: Functions ने scripts वाचायला सोप्या · PNG download करा · Card page उघडा

Lesson: 5.9 Functions — keep scripts readable

Guess न करता scripts debug करा. अंदाजाने साधे bugs शोधायला तास जातात.
उजळणी (Revision) card 10 of 11: Guess न करता scripts debug करा · PNG download करा · Card page उघडा

Lesson: 5.10 Debugging scripts without guessing

Lab: dry run सह health-check script. Dry run ने काहीही बदलण्याआधी script safe test करता येते.
उजळणी (Revision) card 11 of 11: Lab: dry run सह health-check script · PNG download करा · Card page उघडा

Lesson: 5.11 Lab — health check script with dry-run

मुलाखत (Interview) cards

Script ने automate कधी करायचं? काम वारंवार, अनेक steps चं, किंवा कोणीही तसंच करायला हवं असेल तेव्हा.
मुलाखत (Interview) card 1 of 11: Script ने automate कधी करायचं? · PNG download करा · Card page उघडा

Lesson: 5.1 Why script — the morning ten commands

set -euo pipefail काय करतो? -e error ला थांबा, -u set न केलेल्या variable ला error, pipefail pipe मधली कोणतीही command fail झाली तर fail.
मुलाखत (Interview) card 2 of 11: set -euo pipefail काय करतो? · PNG download करा · Card page उघडा

Lesson: 5.2 Shebang, permissions, first script

Exit code म्हणजे काय? प्रत्येक command परत देणारा number: 0 = success, बाकी काहीही = failure. Scripts आणि CI त्यावरून पुढे काय ते ठरवतात.
मुलाखत (Interview) card 3 of 11: Exit code म्हणजे काय? · PNG download करा · Card page उघडा

Lesson: 5.3 Variables, quotes and exit codes

Health URLs check करणारा loop लिहा. प्रत्येक host साठी for, if curl -sf यशस्वी तर OK, नाहीतर DOWN print करा आणि failure लक्षात ठेवा.
मुलाखत (Interview) card 4 of 11: Health URLs check करणारा loop लिहा. · PNG download करा · Card page उघडा

Lesson: 5.4 if and loops for health checks

Automation मध्ये idempotent म्हणजे काय? अनेक वेळा चालवलं तरी एकदा चालवल्यासारखाच तोच result.
मुलाखत (Interview) card 5 of 11: Automation मध्ये idempotent म्हणजे काय? · PNG download करा · Card page उघडा

Lesson: 5.5 Idempotent-ish habits — check before install

Script हाताने चालते पण cron मध्ये fail का? cron चा छोटा PATH आणि environment, वेगळी working directory, terminal नाही; full paths वापरा आणि output log करा.
मुलाखत (Interview) card 6 of 11: Script हाताने चालते पण cron मध्ये fail का? · PNG download करा · Card page उघडा

Lesson: 5.6 Cron basics — schedule the script

Scripts ना secrets safe कसे मिळतात? CI secrets किंवा secret manager ने set केलेल्या environment variables मधून, file मध्ये लिहून किंवा print करून कधीच नाही.
मुलाखत (Interview) card 7 of 11: Scripts ना secrets safe कसे मिळतात? · PNG download करा · Card page उघडा

Lesson: 5.7 Secrets — never hardcode

Script arguments कसे हाताळता? $1, $2 वाचा, $# check करा, चुकीचं असेल तर usage message दाखवून non-zero exit.
मुलाखत (Interview) card 8 of 11: Script arguments कसे हाताळता? · PNG download करा · Card page उघडा

Lesson: 5.8 Reading arguments and a full sample script

Bash मध्ये functions का वापरायची? Code परत वापरायला, steps ना नावं द्यायला, आणि main flow छोटा व वाचनीय ठेवायला.
मुलाखत (Interview) card 9 of 11: Bash मध्ये functions का वापरायची? · PNG download करा · Card page उघडा

Lesson: 5.9 Functions — keep scripts readable

Fail होणारी Bash script कशी debug करता? Trace साठी bash -x, shellcheck ने check, आणि नेमकी fail होणारी line आणि exit code वाचा.
मुलाखत (Interview) card 10 of 11: Fail होणारी Bash script कशी debug करता? · PNG download करा · Card page उघडा

Lesson: 5.10 Debugging scripts without guessing

Dry-run mode का टाकायचा? काहीही न बदलता script काय करेल ते बघायला; safe testing आणि reviews.
मुलाखत (Interview) card 11 of 11: Dry-run mode का टाकायचा? · PNG download करा · Card page उघडा

Lesson: 5.11 Lab — health check script with dry-run

तुलना (Comparison) cards

Bash मध्ये single vs double quotes. Quotes text एकत्र ठेवतात म्हणजे spaces ने तुटत नाही.'single': जसं टाइप केलं तसं."double": $APP सारखे variables भरले जातात.
तुलना (Comparison) card 1 of 3: Bash मध्ये single vs double quotes · PNG download करा · Card page उघडा

Lesson: 5.3 Variables, quotes and exit codes

cron vs sleep loop. cron: schedule वर command चालवणारी system service.sleep loop: runs मध्ये sleep करत कायम चालणारी script.
तुलना (Comparison) card 2 of 3: cron vs sleep loop · PNG download करा · Card page उघडा

Lesson: 5.6 Cron basics — schedule the script

Environment variable vs hardcoded value. Hardcoded: script मध्ये लिहिलेली value.Environment variable: चालताना बाहेरून दिलेली value.
तुलना (Comparison) card 3 of 3: Environment variable vs hardcoded value · PNG download करा · Card page उघडा

Lesson: 5.7 Secrets — never hardcode