
Learn Python for Linux administration and DevOps, automate routine tasks, and integrate Python with Ansible, Docker, and Kubernetes. Build hands-on skills and a capstone project for your portfolio.
Master Python programming to automate Linux system tasks, integrate with DevOps tools like Ansible, Docker, and Kubernetes, and build real-world automation and orchestration while implementing security and testing best practices.
Python enables automation in Linux administration and DevOps with its simple, readable syntax. It offers extensive standard libraries, third party modules, cross-platform compatibility, and community support for troubleshooting and learning.
Learn how to name variables and use meaningful identifiers in Python. Follow snake_case conventions and avoid reserved keywords to write readable, maintainable code.
Learn how Python uses expressions to produce values and statements to control flow. Improve readability by placing each statement on its own line rather than a line packed with semicolons.
Explore practical Python basics for Linux admins, including writing a hello world program with the print function and the crucial role of indentation in if statements and code blocks.
Master Python conditional statements using if, else, and elseif to control program flow, with boolean expressions and comparison operators shown through disk usage and status code examples.
Master for and while loops in Python to automate repetitive tasks with practical examples, range usage, and basic control statements like break and continue.
Apply loops in Python for Linux admins by using for loops with range to sum numbers from 1 to 5 and compute a factorial, demonstrating practical, automated solutions.
Master loop control in Python by using break to exit early, continue to skip an iteration, and pass as a no-op placeholder, with practical code examples.
Explore Python loop control with break, continue, and pass. See how break exits a loop when a value is found, how continue skips iterations, and pass acts as a placeholder.
Develop proficiency in Python's core data structures: lists, tuples, sets, and dictionaries, including access by index, immutable tuples, and set operations such as union and intersection.
Learn practical Python data structures by building and manipulating lists, tuples, sets, and dictionaries with real-world examples like server naming, host port config, unique users, and role management.
Master list comprehensions and generator expressions in Python to write concise, efficient code for processing data and large files, with memory-friendly on-the-fly data handling.
Apply list comprehensions to generate squared even numbers from 1 to 20 and use a generator expression to filter log file lines containing error.
Master techniques for handling iterable objects and using functional programming tools in Python, including iterators, map, filter, reduce, lambda, and itertools utilities like chain, cycle, islice, and groupby.
Apply functional programming techniques in Python to manipulate collections and iterables by using map to uppercase words and itertools.groupby to group logs by date.
Define Python functions with def, pass parameters, and return values to create blocks of reusable, modular code; use f-strings for personalized greetings and simple arithmetic with add.
Define a Python function to convert Celsius to Fahrenheit using the formula (C * 9/5) + 32, returning the result. Test with 0, 100, and -40 to verify conversions.
Explore default arguments, *args, and **kwargs to make Python functions more flexible by handling optional parameters, varying numbers of arguments, and multiple keyword parameters.
Define a function that accepts a variable number of arguments with *args and computes their average using sum(args) divided by len(args), returning None if no arguments are provided.
Explore how lambda functions provide concise, anonymous helpers for quick tasks, enabling sorting by a key, mapping values, and filtering data in devops and automation.
Learn to use a lambda function with filter to extract even numbers from a list of integers 1 to 10, convert the result to a list, and print it.
Learn how modules and packages organize Python code, then practice importing built-in modules like OS and SSIS to access system functions and arguments with dot notation.
Import the time module, define a function that sleeps for two seconds, and measure its execution time with time.time(), then print the result in seconds.
Create custom modules and packages in Python to reuse code and organize projects, defining modules with reusable functions and packaging related modules with __init__.py, then import and use them.
Develop a custom Python module file_utils with write_to_file and read_from_file, using open in write and read modes, test via lab_5.py to create example.txt and print 'Hello Python'.
Master Python scope and namespaces, including local, global, and non-local access rules. Learn how nested functions use global and nonlocal to modify variables and avoid conflicts.
Explore how nested functions manage variables with nonlocal and global keywords, demonstrating scope behavior in Python for Linux admins.
Master Python file operations by reading, writing, and appending data, using with open for safe resource management, line-by-line processing, and chunked reads for large files.
Learn Python file operations by reading from files, writing to output.txt, and appending content. Use with open for safe handling and read in chunks or line by line.
Explore how to manage directories with Python using the os and shutil modules to create, list, copy, move, and delete files and folders safely.
Perform a hands-on lab on managing directories in Python using the OS and shutil modules: create logs, check existence, list files, copy, move, and delete directories to automate file management.
Learn to parse configuration files in Python by reading and writing ini, json, and yaml formats using configparser, json, and yaml modules.
Explore parsing configuration files in Python for Linux admins by reading and writing ini, json, and yaml formats with configparser, json, and yaml modules.
Learn to use try-except-else-finally blocks, raise exceptions, create custom exception classes, and chain errors with raise from for robust, error-tolerant programs.
Practice handling errors in Python with try, except, else, and finally blocks, raise exceptions, and create custom exception classes, including a zero division example and an age validation function.
Access, modify, and delete environment variables in Python using the OS module and os.environ, including setting and retrieving values like home and path at runtime.
Access, set, modify, and delete environment variables in Python using the os module and os.environ, including home and a custom lab_var, to make scripts dynamic.
Learn to manage files and directories in Python for Linux admins using os.getcwd to check the current directory, os.chdir to switch folders, and os.mkdir, os.makedirs, os.remove, and os.rmdir.
Learn to manage files and directories with Python using the os module, including navigating the current directory, creating and deleting files and directories, and listing directory contents.
Learn to handle command line arguments with Sys.argv, exit programs with Sys.exit, and retrieve interpreter details via cis version and CIS platform for dynamic, across environments Python scripts.
Explore system specific parameters and functions in Python by using the sys module to read command line arguments, exit scripts, and report interpreter details and the Linux platform.
Practice executing shell commands with Python's subprocess module using run with a list for safe arguments, and explore shell=True for single-string commands, while sanitizing inputs to avoid security risks.
Learn to run external commands with Python's subprocess module, capture stdout and errors, and handle results using capture_output and check_output in Linux administration.
Learn how to run external commands in Python using subprocess, capture stdout and stderr, handle errors, and use check_output for streamlined output in Linux admin tasks.
Handle subprocess errors and timeouts in python by using subprocess.run with check=True to raise CalledProcessError on failures and a timeout to prevent hangs, logging errors for graceful recovery and robustness.
Master error handling in subprocesses with Python's subprocess module by using try/except, check=True, and capturing failures, then manage timeouts with TimeoutExpired to keep scripts responsive.
Automate disk usage reporting with a Python script that runs df -h via the os module, writes to disk_report.txt, and prints a confirmation for regular storage health monitoring.
Automate user account creation by building a Python script using the subprocess module to run the useradd command with sudo, taking input for the username, and printing a confirmation.
Learn to use the Python re module for text processing, including rematch, re.search, find all, and re.sub to search, extract, and mask data in logs.
Explore using the Python re module to search, match, and replace text, including patterns, raw strings, and match groups. Learn practical examples like parsing logs, masking emails, and extracting timestamps.
Explore sockets as endpoints for network communication, comparing TCP stream sockets and UDP datagram sockets, and learn to use Python's socket module to create, bind, connect, send, and close.
Import the socket module in Python, define a hostname like awesome service dotnet, resolve it to an IP using gethostbyname, and print the IP.
Learn to build TCP and UDP networking in Python for Linux admins. Create a TCP server with socket, bind, listen, and accept, then compare UDP using sendto and recvfrom.
build a simple tcp echo server in Python using the socket module, binding to localhost:8080, listening for connections, accepting, echoing received data, and cleaning up.
Build a UDP chat app with a Python server and client using sockets. Bind the server to localhost on port 1990 and exchange messages with receive from and send to.
Master http basics and web requests in Python for Linux admins, covering get, post, put, and delete methods, status codes like 200 and 404, and urllib plus http client usage.
Learn to consume APIs with Python's requests library, using get, post, put, and delete, passing query parameters and headers and authentication tokens and handling errors with try/except and status codes.
Explore json data in python with the json module, using json.loads and json.dumps. Parse xml data with the xml .3.3 module and extract details via string and find.
Build a Python script that fetches current weather for a city via the Open Weather Map API, handling JSON with requests and an API key stored in an environment variable.
Hello Everyone
Welcome to the Python course designed for Linux Admins. This course introduces you to the practical application of Python in system administration workflows.
We begin with setting up Python, understanding its significance in Linux and DevOps, and exploring the essential tools and technologies used throughout the course. You'll learn the basics of Python, including syntax, data types, and essential programming constructs such as loops, conditional statements, and commonly used data structures like lists, tuples, sets, and dictionaries.
The course emphasizes the importance of functions and modules, teaching you how to create reusable code, organize projects, and leverage Python's extensive standard library. We'll also cover file handling and exception management to help you build robust scripts.
As system interaction is a crucial skill, you'll gain hands-on experience working with Python's OS-related modules, enabling you to automate system tasks effectively. The course provides real-world examples, ensuring that every concept is tied to practical applications in Linux and DevOps environments.
By the end of the course, you'll be equipped with the foundational skills required to write efficient Python scripts and automate repetitive tasks, enhancing your productivity as a Linux administrator or DevOps engineer. This comprehensive course ensures you’re ready for real-world challenges.