Author

Deepak Prasad

Deepak Prasad

R&D Engineer

at · 1296 articles published

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, networking, and security, delivering robust and efficient solutions for diverse projects.

Areas of expertise

Certifications & credentials

  • Red Hat Certified System Administrator in Red Hat OpenStackID: 180-246-001
  • Certified Kubernetes Application Developer (CKAD)
  • Red Hat Certified Specialist in Ansible Automation
  • Go: Data Structures, Algorithms and Design Patterns With Go
Author profile illustration for Deepak Prasad — technical writer at GoLinuxCloud

Articles by Deepak Prasad

programming

FAISS Python API Tutorial: IndexFlatL2, IndexIVFFlat, add, search, and remove_ids

Practical FAISS Python API guide: install faiss-cpu, NumPy float32 shapes, IndexFlatL2 and IndexFlatIP, add and search, IndexIVFFlat training and nprobe, IndexIDMap and remove_ids, save/load indexes, common dtype and …

Deepak Prasad8 min read
programming

Implement a Binary Search Tree in Python: insert, search, delete, traverse

Build a BST in Python with a Node class, iterative insert and search, inorder preorder postorder traversals, delete for leaf one-child and two-child nodes, duplicate policy, complexity, and common pitfalls.

Deepak Prasad11 min read
programming

Combine Two Arrays as Columns in NumPy: column_stack, hstack, and concatenate

Combine two lists or 1-D NumPy arrays into a two-column 2-D array using numpy.column_stack, with numpy.stack axis=1, numpy.hstack for column-shaped inputs, numpy.concatenate axis=1, row vs column stacking, shape rules …

Deepak Prasad5 min read
programming

Create Simple & Complex Python Package with Examples

This guide will lead you on how to create a Python package which includes setup, configuration, building and publishing. You will learn how to include more files, test locally and version control for successful …

Deepak Prasad18 min read
programming

Python Add to Dictionary: Add Key-Value Pairs, Update, and Append

Learn how to add to a dictionary in Python using key assignment, update(), setdefault(), |=, and dictionary unpacking, with examples for single keys, multiple keys, lists, nested dictionaries, and existing keys.

Deepak Prasad5 min read
programming

Merge Dictionaries in Python: |, update(), **, and More

Learn how to merge dictionaries in Python using the | operator, update(), ** unpacking, copy(), ChainMap, and more, with duplicate key behavior and Python version differences.

Deepak Prasad7 min read
programming

FileNotFoundError in Python: Causes, Fixes, and Path Examples

Learn what FileNotFoundError (No such file or directory, errno 2) means in Python, why it happens even when the file seems to exist, and how to fix it with correct paths, working directory, pathlib, symlinks, and …

Deepak Prasad10 min read
programming

Golang Kill Process by PID: Process.Kill, Signal, and CommandContext

Terminate processes from Go by PID or child PID: os.Process and os.FindProcess, Process.Kill vs Process.Signal (SIGTERM vs SIGKILL), stopping commands started with os/exec, timeouts with exec.CommandContext, graceful …

Deepak Prasad9 min read
programming

strconv in Go: parse, format, quote, and common errors

strconv in Go: parse and format integers, floats, and bools, Quote and Unquote, bases with FormatUint and ParseInt, NumError with errors.Is, and when to prefer strconv over fmt.Sscanf.

Deepak Prasad7 min read
programming

Check if a string contains a substring in Go (strings.Contains)

strings.Contains for literal UTF-8 substrings, case sensitivity and ToLower, match any or all needles, ContainsAny and ContainsRune, Index and HasPrefix or HasSuffix, empty substring behavior, and regexp only when you …

Deepak Prasad6 min read
programming

Golang Variable Scope: Local, Package-Level, Global, and Block Scope

Learn variable scope in Go, including local variables, package-level variables, global-style variables, block scope, short declarations, shadowing, and best practices.

Deepak Prasad7 min read
programming

Golang Web Server Tutorial: Build and Configure an HTTP Server in Go

Learn how to build a Go web server using net/http, configure routes, handlers, ports, timeouts, static files, JSON responses, and graceful shutdown.

Deepak Prasad13 min read
programming

Golang Closure Function: Closures, Captured Variables, and Performance

Learn closures in Go: function values that capture outer variables, how they differ from anonymous functions, returned functions and state, goroutine loop pitfalls, and golang closure performance and escape analysis.

Deepak Prasad6 min read
programming

Golang Buffered Channel: Capacity, Blocking, and Buffered vs Unbuffered

Learn buffered channels in Go: make(chan T,n) capacity, len and cap, when send and receive block, buffered vs unbuffered channels, backpressure, deadlocks, choosing buffer size, and practical patterns.

Deepak Prasad5 min read
programming

Golang Regexp Tutorial: Match, Find, Replace, and Extract Regex Groups

Learn how to use regex in Go with the regexp package, including MatchString, Compile, MustCompile, FindString, submatches, ReplaceAllString, Split, and common mistakes.

Deepak Prasad8 min read
programming

Goroutine vs Thread in Go: Are Goroutines the Same as Threads?

Understand the difference between goroutines and OS threads in Go, how the Go runtime scheduler maps goroutines onto threads, and why goroutines are lightweight.

Deepak Prasad9 min read
programming

Golang portping: TCP checks with Ping and PingN (sequential, parallel, ranges)

Golang portping with janosgyerik/portping: set up module, Ping and PingN API, sequential and parallel TCP checks, port ranges, PingN result handling, retries, per-dial timing, CLI install, common dial errors; links to …

Deepak Prasad8 min read
programming

Go ternary operator: idiomatic alternatives to `?:` (if, switch, min, cmp.Or)

Go has no ?: ternary; idiomatic equivalent is if/else or switch. Covers lazy branches, min/max builtins, cmp.Or defaults, generic pick helpers, pitfalls of eager helpers, optional julien040/go-ternary, links to if/else, …

Deepak Prasad5 min read
programming

Golang store values in a struct using a for loop

Store slice values into structs with for range, golang iterate over struct fields with reflect, and a short golang forloop refresher—correct Go, no broken examples.

Deepak Prasad2 min read
programming

Golang Time Package: time.Now, Duration, Format, and Parse Examples

Use Go time package for time.Now, time.Duration, formatting and parsing, Add and Sub, Since and Until, comparing times, Sleep, Timer, and Ticker basics, plus common mistakes.

Deepak Prasad8 min read
programming

Golang background process: start, monitor, and wait with os/exec

Golang start process and spawn with os/exec Start Wait and Run; CommandContext timeouts; goroutines channels WaitGroup for golang background jobs; go run in background vs shell; wait golang patterns.

Deepak Prasad4 min read
programming

Golang Switch Case Statement: Examples, Multiple Cases, and Type Switch

Use the switch statement in Go for switch case and default, comma-separated cases, expressionless switch, initial statements, type switch on any, fallthrough, and patterns that replace long if-else chains.

Deepak Prasad9 min read
programming

Install Go on Ubuntu: apt, snap, or official tarball (with checksum)

Installing golang on Ubuntu: apt golang-go, snap install go --classic, official go.dev/dl tarball with sha256 verify, optional build-from-source with bootstrap Go, amd64 and arm64, PATH and GOBIN, go version, go mod init …

Deepak Prasad6 min read
programming

Golang get IP address: local IPv4/IPv6, hostname, and Linux interfaces

Golang get ip address and golang get local ip: net.InterfaceAddrs and Interfaces for linux get local ip, golang get hostname with LookupHost, go get ip address heuristics, golang get local ip address without loopback, …

Deepak Prasad3 min read
programming

Golang read password from stdin: x/term ReadPassword and TTY checks

Golang read password from stdin with golang.org/x/term ReadPassword: pkg.go.dev ReadPassword IsTerminal, example os.Stdin.Fd and syscall.Stdin on Linux, ReadPassword Windows and platforms, no echo vs golang asterisk …

Deepak Prasad3 min read
programming

Golang user input: Scan, Scanf, and bufio for stdin

How to take input in golang and golang get user input from stdin: fmt.Scan Scanln Scanf for typed tokens, golang read input with bufio; go read user input and how to get user input in go with line-based reads; input …

Deepak Prasad3 min read
programming

Golang panic and recover: defer, stack unwinding, and catch-style recovery

Golang panic and go panic: how unwinding works with defer; golang recover from panic and go recover panic in a deferred function (go catch panic / golang catch panic pattern); panic vs errors and os.Exit; logging with …

Deepak Prasad4 min read
programming

Golang garbage collection: GC, heap, GOGC, runtime.GC, and tuning

Golang garbage collection and golang gc: go garbage collector basics, heap in golang and HeapAlloc, golang force garbage collection with runtime.GC, GOGC and GOMEMLIMIT, gctrace, pprof, and garbage collection in go for …

Deepak Prasad14 min read
programming

Create Nested Directories in Go (os.Mkdir, os.MkdirAll, mkdir -p)

Create nested directories in Go with os.Mkdir per level, os.MkdirAll for a full path in one call, filepath.Join for portable paths, optional os.Stat guards, or exec.Command mkdir -p when shell semantics are acceptable.

Deepak Prasad2 min read
programming

Copy Files in Go While Preserving Permissions

Copy a file in Go with os.Open, io.Copy to os.Create, then os.Chmod from os.FileInfo.Mode; or use os.ReadFile and os.WriteFile with the source mode; os.Rename moves within a filesystem rather than copying.

Deepak Prasad2 min read