♦️ #Linux System Administration Essentials:
🔹 Command to check Disk usage?
📌 df -h - Check disk usage in human-readable format.
📌 du -sh <directory> - Check the size of a specific directory.
🔹 Difference between ps -aux & top command?
✅ ps -aux - Provides a snapshot of active processes.
✅ top - Real-time system performance monitoring.
🔹 What are the Ways to check CPU usage?
💻 top | htop | mpstat | vmstat | sar
🔹 How to check CPU details?
📌 lscpu or cat /proc/cpuinfo
🔹 Steps to create a partition & format with a file system?
1️⃣ fdisk /dev/sdX - Create a partition.
2️⃣ mkfs.ext4 /dev/sdX1 - Format the partition.
3️⃣ mount /dev/sdX1 /mnt - Mount the partition.
🔹 Steps to create LV?
1️⃣ pvcreate /dev/sdX
2️⃣ vgcreate vg_name /dev/sdX
3️⃣ lvcreate -L 10G -n lv_name vg_name
4️⃣ mkfs.ext4 /dev/vg_name/lv_name
🔹 Steps to reduce XFS & EXT file systems?
⚠️ XFS: Cannot be reduced directly.
✅ EXT: umount, resize2fs, lvreduce, mount
🔹 Significance of .bashrc file?
📝 User-specific shell configurations & aliases.
🔹 How to check the kernel version?
📌 uname -r
🔹 How to check the Red Hat release version?
📌 cat /etc/redhat-release or cat /etc/os-release
🔹 Significance of resolv.conf file?
🌍 Configures DNS name resolution.
🔹 What is DNS? How to resolve DNS? Types of DNS records?
🔍 DNS translates domain names to IP addresses.
✅ Resolve: nslookup or dig
📌 Types: A, AAAA, CNAME, MX, TXT, PTR
🔹 Difference between Nginx & HTTP Server?
🚀 Nginx: Event-driven | Apache: Process-based
🔹 Port numbers:
🌐 HTTP: 80 | 📂 FTP: 21 | 🔐 SSH: 22 | 🔒 HTTPS: 443
🔹 What is SSH? How to generate SSH-keys?
🔐 Secure Shell protocol for remote access.
📌 Generate keys: ssh-keygen
🔹 What are Private & Public keys? How do they authenticate?
🔑 Private key (kept secret) & Public key (shared).
✅ Authentication via asymmetric encryption.
🔹 Configuration file of SSH?
📌 /etc/ssh/sshd_config
🔹 Configuration file of HTTP?
📌 /etc/httpd/conf/httpd.conf (Apache)
🔹 What is Virtual Hosting? How to configure it?
🌐 Hosting multiple sites on a single server.
📌 Configure using <VirtualHost> in Apache.
🔹 Explain ifconfig command?
🌍 Displays/configures network interfaces.
🔹 Difference between IPv4 & IPv6?
✅ IPv4: 32-bit | ✅ IPv6: 128-bit
🔹 What is a MAC address? Can we change it?
📌 Unique network identifier.
⚠️ Change: ifconfig eth0 hw ether <MAC>
🔹 How to check system uptime?
📌 uptime
🔹 How to check memory information?
📌 free -m | cat /proc/meminfo
🔹 What is SWAP?
🛠️ Virtual memory when RAM is full.
| WWW.IT-MANAGER.IR |
🔹 Command to check Disk usage?
📌 df -h - Check disk usage in human-readable format.
📌 du -sh <directory> - Check the size of a specific directory.
🔹 Difference between ps -aux & top command?
✅ ps -aux - Provides a snapshot of active processes.
✅ top - Real-time system performance monitoring.
🔹 What are the Ways to check CPU usage?
💻 top | htop | mpstat | vmstat | sar
🔹 How to check CPU details?
📌 lscpu or cat /proc/cpuinfo
🔹 Steps to create a partition & format with a file system?
1️⃣ fdisk /dev/sdX - Create a partition.
2️⃣ mkfs.ext4 /dev/sdX1 - Format the partition.
3️⃣ mount /dev/sdX1 /mnt - Mount the partition.
🔹 Steps to create LV?
1️⃣ pvcreate /dev/sdX
2️⃣ vgcreate vg_name /dev/sdX
3️⃣ lvcreate -L 10G -n lv_name vg_name
4️⃣ mkfs.ext4 /dev/vg_name/lv_name
🔹 Steps to reduce XFS & EXT file systems?
⚠️ XFS: Cannot be reduced directly.
✅ EXT: umount, resize2fs, lvreduce, mount
🔹 Significance of .bashrc file?
📝 User-specific shell configurations & aliases.
🔹 How to check the kernel version?
📌 uname -r
🔹 How to check the Red Hat release version?
📌 cat /etc/redhat-release or cat /etc/os-release
🔹 Significance of resolv.conf file?
🌍 Configures DNS name resolution.
🔹 What is DNS? How to resolve DNS? Types of DNS records?
🔍 DNS translates domain names to IP addresses.
✅ Resolve: nslookup or dig
📌 Types: A, AAAA, CNAME, MX, TXT, PTR
🔹 Difference between Nginx & HTTP Server?
🚀 Nginx: Event-driven | Apache: Process-based
🔹 Port numbers:
🌐 HTTP: 80 | 📂 FTP: 21 | 🔐 SSH: 22 | 🔒 HTTPS: 443
🔹 What is SSH? How to generate SSH-keys?
🔐 Secure Shell protocol for remote access.
📌 Generate keys: ssh-keygen
🔹 What are Private & Public keys? How do they authenticate?
🔑 Private key (kept secret) & Public key (shared).
✅ Authentication via asymmetric encryption.
🔹 Configuration file of SSH?
📌 /etc/ssh/sshd_config
🔹 Configuration file of HTTP?
📌 /etc/httpd/conf/httpd.conf (Apache)
🔹 What is Virtual Hosting? How to configure it?
🌐 Hosting multiple sites on a single server.
📌 Configure using <VirtualHost> in Apache.
🔹 Explain ifconfig command?
🌍 Displays/configures network interfaces.
🔹 Difference between IPv4 & IPv6?
✅ IPv4: 32-bit | ✅ IPv6: 128-bit
🔹 What is a MAC address? Can we change it?
📌 Unique network identifier.
⚠️ Change: ifconfig eth0 hw ether <MAC>
🔹 How to check system uptime?
📌 uptime
🔹 How to check memory information?
📌 free -m | cat /proc/meminfo
🔹 What is SWAP?
🛠️ Virtual memory when RAM is full.
❤2
♦️#Kubernetes Common Errors
#k8s
1.
ImageBackPullOff
We face this issue when the image is not present in registry or the given image tag is wrong.
Make sure you provide correct registry url, image name and image tag.
We might face authentication failures, when image is being stored in a private registry, make sure to create secret with private registry credentials and add created secret in Kubernetes Deployment File to pull docker image.
2.
CrashLoopBackOff
We face this issue when the process deployed inside container not running then the POD will be moved to CrashLoopBackOff.
POD might be running out of CPU or memory, POD should get enough resources allocated that’s cpu and memory for an application to be up and running, to fix that check in Resources Requests and Resources Limits.
3.
OOM Killed - Out Of Memory
We face this issue when PODs tries to utilise more memory than the limits we have set.
We can resolve it by setting appropriate resource request and resource limit.
4.
POD Status - Pending
When nodes might not be ready and required resources like CPU and Memory may not be available in nodes for the PODs to be up and running.
5.
POD Status - Waiting
POD will be scheduled to a node but POD won’t be running in scheduled node.
We can fix this by providing correct image name, image tag and authentication to registry.
6.
POD will be up and running and application is not accessible.
We can fix this by creating appropriate service.
If service is already created and application is still not accessible, make sure application and service are deployed in same namespace.
7.
POD Status - Evicted
We can resolve this by setting appropriate resource requests and resource limits for the PODs and having enough resources in worker nodes.
#k8s
1.
ImageBackPullOff
We face this issue when the image is not present in registry or the given image tag is wrong.
Make sure you provide correct registry url, image name and image tag.
We might face authentication failures, when image is being stored in a private registry, make sure to create secret with private registry credentials and add created secret in Kubernetes Deployment File to pull docker image.
2.
CrashLoopBackOff
We face this issue when the process deployed inside container not running then the POD will be moved to CrashLoopBackOff.
POD might be running out of CPU or memory, POD should get enough resources allocated that’s cpu and memory for an application to be up and running, to fix that check in Resources Requests and Resources Limits.
3.
OOM Killed - Out Of Memory
We face this issue when PODs tries to utilise more memory than the limits we have set.
We can resolve it by setting appropriate resource request and resource limit.
4.
POD Status - Pending
When nodes might not be ready and required resources like CPU and Memory may not be available in nodes for the PODs to be up and running.
5.
POD Status - Waiting
POD will be scheduled to a node but POD won’t be running in scheduled node.
We can fix this by providing correct image name, image tag and authentication to registry.
6.
POD will be up and running and application is not accessible.
We can fix this by creating appropriate service.
If service is already created and application is still not accessible, make sure application and service are deployed in same namespace.
7.
POD Status - Evicted
We can resolve this by setting appropriate resource requests and resource limits for the PODs and having enough resources in worker nodes.
♦️اگه احیانا دیتابیسی چیز مهمی روی سرور آوردین بالا پورتش رو با فایروال ببندین برای اتصال بهش از سیستم شخصی نیازی نیست حتما پورتش باز باشه کافیه با ssh تونل کنید مثلا phpmyadmin روی پورت 8888 داشتین،
کافیه این دستورو بزنید
ssh -L 8888:localhost:8888 root@1.2.3.4
بعد توی سیستم خودتون میتونید تونل شده بهش از ادرس زیر دسترسی داشته باشین
localhost:8888
#Linux
کافیه این دستورو بزنید
ssh -L 8888:localhost:8888 root@1.2.3.4
بعد توی سیستم خودتون میتونید تونل شده بهش از ادرس زیر دسترسی داشته باشین
localhost:8888
#Linux