Skip to content

Instantly share code, notes, and snippets.

View MahdadGhasemian's full-sized avatar

Mahdad Ghasemian MahdadGhasemian

View GitHub Profile
@MahdadGhasemian
MahdadGhasemian / chinese_on_ubuntu.md
Last active August 25, 2026 02:20
Chinese On Ubuntu

Install Chinese keyboard layout and activate it

On Ubuntu, install the IBus Chinese engine:

sudo apt update
sudo apt install ibus-libpinyin
@MahdadGhasemian
MahdadGhasemian / how_to_prepare_for_blindness.md
Last active August 19, 2026 04:07
How to prepare for blindness ?

How to prepare for blindness ?

VMware

  • Disable all keyboard's shortcut on host os

Voice Assistant and Screen Readers (Ubuntu 24 26)

@MahdadGhasemian
MahdadGhasemian / open-in-vs-code-via-right-click.md
Last active July 13, 2026 04:25
Open Selected Folder in VS Code via Right Click (Ubuntu)

Open Selected Folder in VS Code from Nautilus (Ubuntu)

A simple Nautilus script to add an "🔷 Open in VS Code" option to the right-click menu.

This works without installing any extra extensions or Python packages.

Features

  • ✅ Open a selected folder directly in VS Code
  • ✅ Right-click a file → open its parent folder in VS Code
@MahdadGhasemian
MahdadGhasemian / backup_mysql.sh
Created May 4, 2026 17:59
Mysql Backup Script
#!/bin/bash
DATE=$(date +"%Y%m%d")
BACKUP_DIR="/backup/mysql"
BACKUP_ARCHIVE_DIR="/backup/mysql_archive"
LOG_DIR="/backup/backup_logs"
MYSQL_USER="backup_user"
MYSQL_PASSWORD="tr -cd 'a-zA-Z0-9' </dev/urandom | head -c '65' ; echo '@'"
MYSQL=/usr/bin/mysql
MYSQLDUMP=/usr/bin/mysqldump
@MahdadGhasemian
MahdadGhasemian / proxy_and_offline_setup.md
Last active March 30, 2026 13:38
Working in Restricted Networks: Proxies, APT, Docker & Offline Installs

Working in Restricted Networks: Proxies, APT, Docker & Offline Installs


🌐 APT Proxy

⚠️ TODO: Add configuration for HTTP/HTTPS proxy in APT (/etc/apt/apt.conf.d/)


@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 April 22, 2026 01:21
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.