Articles by Deepak Prasad
Linux: top memory and CPU consuming processes (ps, sar, scripts, metrics file)
Find top CPU and memory consuming processes on Linux with ps, top, sar, and pidstat; sample output after controlled stress; Bash scripts that append metrics to a file and ideas for email alerts.
Bash: check if a string contains text, digits, or a prefix ([[ ]], globs, regex)
Bash patterns to see if a string contains a substring or character, if it is only digits, if it starts with a prefix, and how [[ =~ ]] and globs differ— with quoting, empty-string gotchas, and a short locale note.
Bash until vs while loop: exit codes, same counter and when to pick each
Bash until vs while using exit status: bash until loop runs while a command fails, while loop bash runs while it succeeds. Examples for counters, wait until ready, and while read line-by-line.
Bash script multiple arguments: all args, functions, another script and typeset -f over SSH
Bash multiple arguments with positional parameters, bash pass all arguments via "$@", bash pass multiple arguments to a function, forwarding to another script, and bash pass function over SSH with typeset -f or declare …
Bash increment variable: add 1, counters, loops and (( )) vs $(( ))
Bash increment variable and bash add 1 to variable with $(( )), ((++)), bash increment variable in loop (for/while), bash increment counter patterns, let, and post vs pre-increment pitfalls.
Bash format number with commas on Linux: printf, numfmt and script examples
Bash format number with commas using printf thousands grouping, LC_NUMERIC and GNU numfmt, plus a pure Bash comma formatter for integers and decimals. Covers locale (en_US vs en_IN), C/POSIX limits, and readable output …
Nested loops in Java (for, while, do-while, and examples)
Nested loops in Java: nested for, while, and do-while (including mixed loops), Scanner menu example, labeled break, and complexity. Runnable examples with OpenJDK 17-tested output.
How to Reset Index in pandas (DataFrame, groupby, drop=True) [Examples]
Learn how to reset index in pandas on a DataFrame or Series. Covers pandas groupby reset_index, reset index to start at 0 with drop=True, dataframe reset_index after sort or filter, df reset_index, and resetting column …
How to Check Sudo Access for a User in Linux
Learn how to check sudo access in Linux. Check if you or another user has sudo privileges with sudo -l, test sudo access non-interactively in a bash script with sudo -n, and list all sudo users, with real tested output.
How to Check Disk Space in Linux: df, du, lsblk & What They Actually Show
Learn how to check disk space in Linux from the command line. Use df to check free space, du to check disk usage by folder, and find what is eating your storage, with real tested output and fixes for "No space left on …
Git Remote Set-URL: Change Remote Repository URL [Examples]
Learn how to use git remote set-url to change a remote repository URL. Change origin from HTTPS to SSH, add or delete push URLs, rename remotes, and fix the "this repository moved" error, with real tested examples and …
Git Push Force Explained: --force vs --force-with-lease [Examples]
Learn how to use git push force safely. Understand git push --force vs --force-with-lease, force push to a remote branch, origin master, and after rebase or amend with real examples.
CPU, Processors, Cores, Threads, Hyper-Threading and Cache Explained
Understand CPU, processor, socket, core, thread, hyper-threading, CPU cache, frequency scaling and Linux commands like lscpu, nproc, mpstat and cpupower with validated output.
How to Check Filesystem Type in Linux
Learn how to check filesystem type in Linux for mounted paths, disks, partitions, LVM volumes, USB drives, ISO media, and unmounted filesystem images with tested findmnt, lsblk, blkid, df, file, stat, udevadm, fstab, …
How to Refresh Network Settings in Ubuntu
Learn how to refresh network settings in Ubuntu after IP address, route, DNS, DHCP, Netplan, NetworkManager, or systemd-networkd changes. Includes safe remote-server workflow, tested verification commands, and practical …
How to Check Linux Kernel Version from Command Line
Learn how to check Linux kernel version with tested uname, hostnamectl, procfs, journalctl, dmesg, boot image, dpkg, and apt commands, and understand the difference between the running kernel and installed kernel …
How to check thread count per process in Linux
Tested Linux commands to check thread count per process using proc task directories, proc status, ps NLWP/LWP, ps -T, top -H and pstree, plus system thread limits.
Linux Show Hidden Files with ls, find, and du
Tested Linux commands to show hidden files with ls, list only hidden files, find hidden files recursively, and check hidden file or directory size with du.
Create cron job or schedule jobs using bash scripts in Linux or Unix
How to update crond using a shell script? Schedule cron job using command line bash shell script in Linux? Create cron job using crontab shell script Unix
Fix: cpio premature end of archive, List (lsinitrd) & Extract initramfs in RHEL Linux
How to extract/unpack/uncompress the contents of the initramfs image on RHEL7 and RHEL8? How do I list initramfs image file content? How do I modify the contents of an initrd or initramfs? How do I view an initrd or …
Perform cURL POST Request
In this article we learned how to properly perform a curl POST request with practical examples
[SOLVED] pip command not found in Ubuntu
There are two different versions of pip which you can install to solve the error i.e. pip command not found in Ubuntu 20.04 Linux. Step by Step instructions to fix pip command not found error.
9 easy steps to create custom ISO RHEL/CentOS 8
To create custom ISO in RHEL/CentOS 8, create a kickstart file and modify the isolinux.cfg for boot menu. You can also minimze the package list and update repodata
How to clone or backup Linux partition using fsarchiver
Steps to backup partition in LInux, clone your partition or hard drive, logical volume using fsarchiver Exclude files and directories encrypt backup
15 steps to setup Samba Active Directory DC CentOS 8
Step by Step tutorial to configure samba active directory domain controller in CentOS 8 Linux. Install Windows AD alternative in Linux. Free domain controller software in Linux
What is tar --strip-components & zip --junk-paths with examples in Linux
How to use tar --strip-components and zip --junk-paths with examples to strip absolute path in Linux and Unix. Force unzip / zip not to create a subdirectory
Kubernetes Operator with controller-runtime: Status, Finalizers, Webhooks, and Drift
Part 2 of 3: extend a DemoApp Operator SDK project with ConfigMap, Service, Deployment, status Conditions, finalizers, drift via Owns/Watches, mutating/validating webhooks, Events, and RBAC markers.
Go Kubernetes Operator SDK Tutorial: Build a Controller from Scratch
Part 1 of 3: scaffold a Go operator with Operator SDK (go/v4), CRDs from Kubebuilder markers, RBAC, idempotent Reconcile with CreateOrUpdate, owner references, and deploy to kind.
Server-Side Apply (SSA) in Kubernetes Operators
Server-Side Apply (SSA) is the modern way for operators to express ownership of fields in a Kubernetes object. Instead of doing a full Update with a stale copy of the object, the operator sends only the fields it cares …
Multi-Tenant Kubernetes Operator Patterns: Per-Namespace Leases and Listers
Multi-tenant operators come in three shapes: one operator serving all tenants (shared, simple, weakest isolation), one operator per tenant (isolated, expensive, strongest isolation), and the hybrid — one operator binary …

