Articles by Deepak Prasad
Check if String Contains Substring in Python
Learn how to check if a string contains a substring in Python using the in operator, find(), index(), count(), and regex. See case-sensitive, case-insensitive, multiple substring, whole-word, and pattern matching …
Python String Format
Learn Python string formatting using f-strings, str.format(), and percent formatting. See examples for variables, numbers, decimal precision, padding, alignment, percentages, dates, and %d meaning in Python.
Replace String in File Using Python
Learn how to replace text in a file using Python. See examples for replacing a string in the same file, writing to a new file, handling large files, using fileinput with backup, and regex replacement with re.sub().
Python Tuple
Learn what a tuple is in Python with simple examples. See how to create tuples, access items, use indexing and slicing, unpack tuples, compare tuples with lists, and use tuple methods.
Check Type in Python
Learn how to check the type of a variable in Python using type() and isinstance(). See when to use each method, how to check multiple types, and how type hints differ from runtime type checking.
Python yield Keyword
Learn what yield means in Python and how it creates generator functions. Understand yield vs return, next(), for loops, generator expressions, yield from, and common mistakes with simple examples.
Build RPM Package with rpmbuild
Learn how to build an RPM package in Linux using rpmbuild. Create the rpmbuild directory structure, write a SPEC file, build RPM from source, create RPM from scratch, and verify the package.
Python Write to File
Learn how to write to a file in Python using with open(). Create a new file, overwrite an existing file, append data, write multiple lines, and avoid common file mode mistakes.
Python While Loop with Multiple Conditions
Learn how to use multiple conditions in a Python while loop using and, or, not, parentheses, and two-condition examples. Understand when the loop stops and how to avoid infinite loops.
Chrony Force Sync in Linux
Learn how to force Chrony time sync in Linux using chronyc makestep and chronyd -q. Also configure Chrony as an NTP client or server, check sync status, and understand server options like iburst, minpoll, and maxpoll.
Set ulimit in Kubernetes Pods: open files, nproc, and process limits
Fix Too many open files (EMFILE) and set ulimit-style nofile, nproc, and file size limits in Kubernetes pods using a prlimit or ulimit entrypoint—separate from CPU and memory resources.limits, with Pod examples you can …
How to limit Kubernetes resources (CPU & Memory)
We can add a limit (quota) to different Kubernetes resources such as CPU, memory, hugepages for containers. We can restrict a soft and hard limit to these resources
Tutorial: Beginners guide on Linux Memory Management
Understand various terminologies with linux memory management, dirty page, swapping, inactive, active memory, Translation Lookaside Buffers (TLB), page cache
3 easy steps to configure hugepages in RHEL/CentOS 7/8
Step-by-Step Tutorial to configure hugepages in red hat and centos 7/8 linux using vm nr_hugepages in /etc/sysctl.conf. Also configure hugepages pool using hugeadm
How to check Transparent HugePages in Linux
Learn how to check Transparent HugePages in Linux, verify if THP is enabled or disabled, understand AnonHugePages vs static hugepages, and find per-process THP usage.
Check if CPU supports HugePages & change default hugepage size in RHEL
Learn how to check if CPU supports HugePages with 2MB and 1GB Size in CentOS/RHEl 7 Linux and change default hugepage size permanently using GRUB2 with examples
HugePages vs Transparent HugePages in Linux: Differences, Use Cases, and Troubleshooting
Compare HugePages (static HugeTLB) and Transparent HugePages in Linux: what each is, when to use or disable them, how to check and configure them, how Kubernetes exposes hugepages-2Mi and hugepages-1Gi, and how to …
Python continue Statement
Learn how the Python continue statement works in for loops, while loops, if conditions, and nested loops, with examples, flowchart, break vs continue, and common mistakes.
Python pass Statement
Learn what the pass statement does in Python, when to use it in functions, classes, if blocks, loops, and exception handling, and how pass differs from continue, break, and return.
Python Numbers
Learn Python numeric types including integers, floating-point numbers, and complex numbers. Understand int vs float, type conversion, numeric literals, precision, and when to use each number type.
Python next() Function
Learn how Python next() works with iterators, default values, StopIteration, generators, first-item lookup, and first matching item patterns.
Python Create Directory Recursively
Learn how to create directories recursively in Python using pathlib Path.mkdir(parents=True, exist_ok=True) and os.makedirs(), including create-if-not-exists examples and common errors.
Python Matplotlib pyplot
Learn Python Matplotlib pyplot with simple plot examples. Create line plots, scatter plots, bar charts, and make beautiful plots using labels, colors, markers, legends, grids, styles, and savefig().
Python Custom Exceptions
Learn how to create custom exceptions in Python by subclassing Exception, raise custom exceptions with messages, catch them, add attributes, chain exceptions, and follow best practices.
Python List vs Tuple vs Set vs Dictionary
Compare Python list, tuple, set, and dictionary with examples. Learn the differences in order, mutability, duplicates, indexing, syntax, use cases, and when to use each data type.
Python List extend() Method
Learn Python list extend() method with examples. Add items from another list, tuple, set, string, or dictionary, and understand extend() vs append(), +, and +=.
Python While Loop Examples
Learn Python while loop with simple examples, including syntax, counter loops, user input, break, continue, while else, nested while loops, and multiple conditions.
Python len() Function
Learn Python len() function with simple examples. Get the length of strings, lists, tuples, dictionaries, sets, ranges, and custom objects, and fix common TypeError mistakes.
Python One Line If Else
Learn how to write Python if else in one line using the conditional expression syntax. Includes one-line if, if else, if elif else, nested conditions, and common mistakes.
Python Function Examples
Learn Python functions with simple examples, including def syntax, calling a function, parameters, return values, default arguments, keyword arguments, *args, **kwargs, and common mistakes.

