Skip to content

Instantly share code, notes, and snippets.

View MahdadGhasemian's full-sized avatar

Mahdad Ghasemian MahdadGhasemian

View GitHub Profile
@MahdadGhasemian
MahdadGhasemian / screen_keep_process_alive.md
Created March 9, 2026 11:08
Screen: Never Lose a Process Again

Screen: Never Lose a Process Again

If you’ve ever started a long-running task—like a database migration— only to have your terminal or SSH connection drop, screen is your lifesaver. It keeps processes running in the background so you don’t have to babysit your terminal.


1. Create a Session

Start a named session so you can easily reattach later:

@MahdadGhasemian
MahdadGhasemian / dns-debugging-cheatsheet.md
Last active March 5, 2026 13:28
A handwritten reference on Iranian DNS hosts, alongside practical DNS notes for Ubuntu, Kubernetes, and Kubespray, including troubleshooting tips.

Iranian DNS servers list (domestic)

DNS Server Status
217.218.155.155 OK
217.218.127.127 OK
46.209.209.209 FAILED
185.161.112.33 OK
@MahdadGhasemian
MahdadGhasemian / installing-postman.md
Created February 7, 2026 05:44
Installing Postman on Ubuntu/Gnome
  1. Download Postman from: Postman x86_64

  2. Extract it:

tar -xzf ./postman-linux-x64.tar.gz
  1. Move to /opt
@MahdadGhasemian
MahdadGhasemian / secure_external_ssd.md
Last active January 8, 2026 06:54
A concise guide to securely partitioning, encrypting, and formatting an external SSD for Linux use.

Secure External SSD

Make your external SSD partitions with ext4 filesystem for Linux

To prepare your external SSD for use in Linux, you can use the following tools:

  • Use lsblk or fdisk -l to identify your external SSD device.
  • Use fdisk or parted to create and manage partitions on the SSD.
  • Use mkfs.ext4 to format the created partitions with the ext4 filesystem.
  • For a graphical interface, consider using gparted.
@MahdadGhasemian
MahdadGhasemian / vmware.md
Last active January 29, 2026 09:57
A practical guide for installing VMware Workstation and creating/managing virtual machines.

VMware

✅ You can run VMs on your PC/Mac for free

  • VMware Workstation & VMware Fusion (Desktop Hypervisors)
  • Workstation for Windows/Linux and Fusion for macOS
  • These desktop virtualization products are now free for all users — personal, educational, and even commercial.
  • The older Pro branded versions are no longer sold as paid products; instead these full-featured tools are available at no cost.
  • No subscription or license purchase required
  • Official support is not included — only community forums and docs.
@MahdadGhasemian
MahdadGhasemian / metallb-loadbalancer-layer2-vs-bgp-mode.md
Created July 24, 2025 03:05
This document provides a comparison of MetalLB's Layer 2 and BGP modes.

MetalLB: Layer 2 vs BGP Mode Comparison

🎯 Introduction

MetalLB is a load-balancer implementation for bare metal Kubernetes clusters. This document compares its two main operational modes: Layer 2 and BGP, helping you choose the right one for your environment.

🔁 Layer 2 Mode

🏗️ Example Cluster Setup

📦 Cluster Setup

@MahdadGhasemian
MahdadGhasemian / docker-compose.yml
Last active July 8, 2025 04:37
How to config a Redis Cluster in local with docker-compose
version: "3.7"
services:
# Node 0
redis-node-0:
image: docker.io/bitnami/redis-cluster:7.4
volumes:
- redis_cluster_data_0:/bitnami/redis/data
environment:
- "REDIS_PASSWORD=bitnami"
@MahdadGhasemian
MahdadGhasemian / mongodb_replica_set_docker_compose.md
Last active December 4, 2024 06:36
Setting Up a MongoDB Replica Set With Docker Compass (Local Test)

How to Set Up a stable MongoDB Replica Set Localy for Developing

version: "3.9"

services:
  mongodb-primary:
    image: docker.io/bitnami/mongodb:5.0
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-primary
@MahdadGhasemian
MahdadGhasemian / behind_proxy.md
Last active September 29, 2024 13:59
Bash, APT, Docker, K3S, Gitlab Runner Behind Proxy ?

1. bash behind proxy:

Edit .profile file (with vi or nano)

nano .profile

And add following lines:

export http_proxy=http://127.0.0.1:8888/
export https_proxy=http://127.0.0.1:8888/
@MahdadGhasemian
MahdadGhasemian / minio_backup_restore_guide.md
Last active January 8, 2026 21:43
Steps to backup and restore Minio Buckets

Restore Backup with Minio (Minio <----> Local)

Instructions for restoring buckets using Minio mirror features.

Install Minio Client

Install Link install link