Blog 11 DevOps & Backend Starter Guide From Linux Commands to CI/CD Automation
🚀 Ultimate DevOps & Backend Starter Guide
Linux, HTTP, Databases, and Shell Scripting Essentials
1️⃣ Database Connectivity & Debugging Tips
Sometimes, your backend can’t connect to the database, even if the DB is running perfectly. Here’s how to check:
ping <db-IP>
telnet <db-IP> 3306
- If
telnetworks but your app can’t connect → likely a DB security group or firewall issue. - For local testing, always try
localhostor127.0.0.1.
Tip: Network-level access issues are more common than code issues.
2️⃣ HTTP Methods & Status Codes Made Simple
HTTP methods define how your frontend talks to backend:
| Method | Purpose | Example Payload |
|---|---|---|
| GET | Read / fetch data | - |
| POST | Create new data | { "amount": "200", "desc": "travel" } |
| PUT | Update existing data | - |
| DELETE | Remove data | - |
HTTP Status Codes Explained
| Code | Meaning | Common Usage |
|---|---|---|
| 1XX | Informational | Rarely used |
| 2XX | Success | 200 OK, 201 Created |
| 3XX | Redirection | 301 Moved Permanently |
| 4XX | Client Error | 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 405 Method Not Allowed |
| 5XX | Server Error | 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable |
- 404 → Endpoint doesn’t exist (client-side error)
- 403 → Forbidden → You don’t have access
- 401 → Unauthorized → Login required
- 405 → Wrong HTTP method → e.g., sending GET instead of POST
- 502 → Backend unreachable → frontend issue
- 503 → Service temporarily unavailable → server down
3️⃣ Linux Server Memory & Disk Usage
Monitoring RAM, swap, and disk usage is crucial for DevOps and backend monitoring.
Check Memory Usage
free -h # Human-readable memory usage
htop # Interactive memory monitoring
cat /proc/meminfo # Detailed memory info
Top 10 Memory-Consuming Processes
ps aux --sort=-%mem | head -n 10
Disk Usage
df -hT # Disk usage by filesystem
du -sh /* # Disk usage for each folder in root
Memory vs Disk Basics:
- RAM: Fast, temporary memory for running programs.
- ROM / HDD: Permanent storage for files and OS.
- Swap: Reserved space on disk to act as backup RAM.
4️⃣ Linux Booting Process (Simplified)
- BIOS / UEFI → Hardware initialization
- Bootloader (GRUB) → Loads the Linux kernel
- Kernel → Mounts root filesystem & starts init process
- Init / Systemd → Starts services, daemons, and user processes
5️⃣ Shell Scripting: Automate Everything
Shell scripting = running multiple Linux commands in a single file.
#!/bin/bash
DATE=$(date +%F)
tar -czf /backup/home_backup_$DATE.tar.gz /home/user/
echo "Backup completed!"
- Reduces human error
- Saves time on repetitive tasks
- Automates server management, backups, or cloud tasks
6️⃣ Networking & Links
Forward vs Reverse Proxy
| Type | Direction | Purpose |
|---|---|---|
| Forward Proxy | Client → Proxy → Internet | Privacy, content filtering |
| Reverse Proxy | Internet → Proxy → Server | Load balancing, SSL termination |
Inode, Symlink & Hardlink
- Inode: Unique identifier for files in Linux
- Symlink: Shortcut pointing to another file
- Hardlink: Another name pointing to the same inode
7️⃣ Quick Daily Commands for DevOps
uptime # Server uptime
top # Top CPU-consuming processes
netstat -tulpn # Open ports and listening services
df -h # Disk usage
free -h # Memory usage
Tip: Script repetitive commands to reduce human error and save time.
Conclusion
Mastering Linux troubleshooting, HTTP methods, database connectivity, and shell scripting forms the foundation of a strong DevOps and backend career. Pair your learning with a small project like:
- Dockerized API
- CI/CD pipeline
- Postman tests
Host your work on GitHub to **stand out to recruiters** with practical skills!
Comments
Post a Comment