Would you like to know when you'd get rich? Here's a little bash script (thanks NetworkChuck Academy) that might help. Create an executable file, call it getrichquick.sh and paste the following content inside: #!/bin/bash # echo "What is your name?" read name sleep 1 echo "How old are you?" read age sleep 1 echo "Hello,$name, your are $age years old." rich_age=$((($RANDOM%11) + $age)) echo "I'm looking into your future..." echo "Calculating..." echo "......." sleep 1 echo "**....." sleep 1 echo "****..." sleep 1 echo "******." echo "Hello,$name, you will be $rich_age when you become rich!" Save getrichquick.sh and run it. It's a fun little exercise. I tried it on my wife and expression was priceless. The exercise was a nice introduction into the $RANDOM variable in bash. $RANDOM variable helps to generate random numbers from 0 - 32767. This is useful in many DEVOPS tasks combined with the modulo operator (%). $(($RANDOM % 10)) simply means divide a random number from 0 - 32767 and give the remainder. The aim of the operation is to generate numbers from 0 - 9. If you are interested in integers from 1-10, then the operation becomes... $(($RANDOM + 1)) Devops use cases Random server selection for Load Balancing purpose Here's an example randomly choosing a server among three choices: servers=("server1" "server2" "server3") index=$(($RANDOM % 3)) echo "Deploying to ${servers[$index]}" Result... Deploying to server2 This is used for - Load balancing - Blue-green deployments - Canary deployments #DevOps #Linux #Bash #ShellScripting #Automation #CloudEngineering #DevOpsLearning #TechLearning #InfrastructureAsCode #PlatformEngineering #DeveloperTips #CodingTips
Bash Script to Predict Rich Age
More Relevant Posts
-
⚠️ 🧲 I broke Kubernetes cluster 35 times. - On purpose. Then I fixed it. Every single time. And I turned it into a free, open-source project so YOU can do the same. Introducing: "Troubleshoot Kubernetes Like a Pro" Here's the truth nobody tells you about Kubernetes: You don't really understand it until something breaks. Reading docs is great. Watching tutorials helps. But nothing teaches you faster than seeing a pod crash, figuring out WHY, and fixing it yourself. That's exactly what this repo does. How it works: Step 1: Pick a scenario (there are 35 real-world failures) Step 2: Run one command - it breaks your cluster on purpose Step 3: Investigate using kubectl (just like you would in production) Step 4: Apply the fix and watch it come back to life No custom Docker images needed. No complex setup. Just a Kubernetes cluster and kubectl. What you'll learn to troubleshoot: - Pod stuck in Pending? You'll know why in 2 minutes. - CrashLoopBackOff? You'll fix it with your eyes closed. - OOMKilled? You'll understand cgroups and memory limits for real. - DNS not resolving? You'll debug it like a senior SRE. - Image pull errors, probe failures, volume mount issues, RBAC problems, and 25+ more. Every scenario follows the same pattern: issue.yaml -> creates the problem fix.yaml -> solves the problem description.md -> explains WHY it happened The whole thing runs with a single interactive script: ./manage-scenarios.sh Pick a number. Break it. Fix it. Learn it. Next. This is how I wish I had learned Kubernetes. No slides. No theory. Just real failures and real fixes. Try it today: https://lnkd.in/dsERVjyD If this helped you, share it with someone who's learning Kubernetes. They'll thank you later. #Kubernetes #DevOps #CloudNative #K8s #SRE #Docker #OpenSource #Learning #PlatformEngineering #Troubleshooting #KubernetesTroubleshooting #InfrastructureAsCode #ContainerOrchestration
To view or add a comment, sign in
-
#Day_16 – Advanced Docker (DevOps Containerization) Today, I moved ahead with Advanced Docker concepts, and now I can see how real-world applications are managed using containers. 👉 Docker is not just running containers… it’s about managing, scaling, and optimizing them. 🔹 Docker Volumes (Data Management) Used to store persistent data Data is not lost when container stops Share data between containers 👉 Important for databases and real apps. 🔹 Docker Networks Connect multiple containers Containers can communicate using names Types: bridge, host, custom network 👉 Helps in multi-container applications. 🔹 Docker Compose Manage multiple containers using one file Define services in docker-compose.yml Run full app using one command 👉 Example: frontend + backend + database 🔹 Building Custom Images (Advanced Dockerfile) Multi-stage builds Optimize image size Use best practices 👉 Faster and efficient images. 🔹 Docker Registry Store Docker images Example: Docker Hub Push & pull images 👉 Used in CI/CD pipelines. 🔹 Container Scaling Run multiple containers Handle high traffic Improve performance 👉 Base concept for Kubernetes. 🔹 Docker Logs & Monitoring docker logs – check logs docker stats – resource usage Debug container issues 👉 Important for production. 🔹 Security Basics Use official images Avoid running as root Scan images 👉 Security is critical in DevOps. 🔹 Why Advanced Docker is Important? Manage real-world applications Handle microservices Work with CI/CD Prepare for Kubernetes 👉 This is how companies run production systems. What I realized today: ✔ Docker is much bigger than basic commands ✔ Multi-container apps are real-world standard ✔ Optimization and security are very important ✔ This is the bridge to Kubernetes Let’s keep learning and growing 💪 #Linux #DevOps #Docker #AdvancedDocker #Containerization #Day16 #LearningInPublic #ITSkills #CareerGrowth
To view or add a comment, sign in
-
🚀 DevOps Hands-on Project Series Excited to share two practical projects I recently built to strengthen my hands-on understanding of application deployment, CI/CD, containerization, and Kubernetes. Project 1: Job Application Tracker Web App 🔹 Built using Python Flask and SQLite 🔹 Containerized using Docker 🔹 Implemented CI/CD using GitHub Actions 🔹 Pushed images to Docker Hub 🔹 Configured GitHub repository secrets for secure Docker Hub authentication Project 2: Server Health Monitoring Dashboard 🔹 Built a monitoring dashboard for CPU, memory, disk, uptime, and system health 🔹 Containerized using Docker 🔹 Automated Docker image build and push using GitHub Actions 🔹 Deployed on Kubernetes using Deployment and Service manifests 🔹 Implemented High Availability using multiple pod replicas Key Learnings ✅ CI/CD automation using GitHub Actions ✅ Secure secrets management ✅ Containerized deployments using Docker ✅ Kubernetes Deployment, Service and High Availability concepts ✅ Troubleshooting real workflow failures and improving hands-on DevOps skills Tech Stack Python | Flask | SQLite | Docker | GitHub | Docker Hub | GitHub Actions | Kubernetes | AWS EC2 | Linux 🔗 GitHub Repositories: https://lnkd.in/dhgaUXqc 🐳 Docker Hub Images: https://lnkd.in/di3E39n3 Always learning by building and improving through hands-on practice. Shubham Londhe 😎 #DevOps #Docker #Kubernetes #HighAvailability #GitHubActions #CICD #Python #AWS #Linux #Automation #CloudComputing
To view or add a comment, sign in
-
-
Ever felt like your shell scripts are working… but still not smart enough? They run commands. They finish fast. But they don’t wait, don’t retry, and don’t handle user choices cleanly. That’s where this chapter comes in. 👉 This is Part 3 of the Shell Scripting series. If you haven’t seen the earlier parts, start here: 🔗 Part 1 (Basics): [ https://lnkd.in/g2ZBhqar ] 🔗 Part 2 (Conditionals & Loops): [ https://lnkd.in/gfUUjMzH ] In this blog, I’ve focused on three powerful concepts that make your scripts more practical: 👉 while loops – keep running until a condition changes 👉 break & continue – control how loops behave 👉 case statements – clean and readable decision-making Here’s what you’ll learn: 1) How to make your script wait until something is ready (instead of checking just once) 2) Why sleep is important when retrying or polling 3) How to stop loops (break) or skip steps (continue) 4) How to build interactive menus using loops 5) Why case is much cleaner than long if/elif blocks Simple idea: If you don’t know how many times something should run → use while If you have too many conditions → use case That’s when scripting starts to feel like building real systems. Read the full blog/Attached doc here: [ https://lnkd.in/gWS86uqk ] What should I write about next? Feel free to comment below & I’ll try to create a post on your suggestion within a day. I can cover topics like: Git, Ansible, Jenkins, Groovy, Terraform, AWS, Networking, Linux, DevOps practices, Cloud architecture, CI/CD pipelines, Infrastructure as Code, or anything related. If you find the content useful, please share it with your network and drop a like 👍 it really helps these posts reach more Linux, DevOps, and Cloud folks. Your likes and shares are what keep me motivated to keep writing consistently. Thanks in advance for your ideas and support! #Linux #ShellScripting #Bash #DevOps #Automation #Scripting #LinuxBasics
To view or add a comment, sign in
-
🚀 DevOps Journey – Day 35 / 100 👉 Today I learned Dockerfile (How we build our own images) 🐳🔥 🔹 🧠 Real-Time Scenario 👉 Developer pushes code to GitHub 👉 As DevOps Engineer: ✔ Clone code ✔ Write Dockerfile ✔ Build image ✔ Run container 💡 This is how applications are containerized in real projects 🚀 🔹 🔁 Flow 👉 Code → Dockerfile → Image → Container ✔ Dockerfile → Instructions ✔ Image → Application package ✔ Container → Running app 🔹 📘 What is Dockerfile? 👉 Dockerfile is a script with instructions to build an image 💡 It defines how application should run 🔹 🧩 Dockerfile Components ✔ FROM → Base image 👉 Example: nginx / openjdk ✔ MAINTAINER (⚠️ deprecated) 👉 Use LABEL instead ✔ LABEL → Metadata ✔ WORKDIR → Working directory inside container ✔ COPY → Copy files from local to container ✔ ADD → Copy + supports URL & extraction ✔ RUN → Execute commands while building image ✔ ENV → Environment variables ✔ ARG → Build-time variables ✔ EXPOSE → Define port ✔ CMD → Default command when container starts 🔹 📜 Sample Dockerfile (Java App) FROM openjdk:11 WORKDIR /app COPY target/myapp.war /app/myapp.war EXPOSE 8080 CMD ["java", "-jar", "myapp.war"] 🔹 ⚙️ Build Image docker build -t myapp:v1 . 🔹 🚀 Run Container docker run -d -p 8080:8080 myapp:v1 👉 Access: http://:8080 🔹 🔄 Important Concept 👉 If Dockerfile changes: ✔ Need to rebuild image ✔ Old image won’t update automatically 💡 Image is immutable 🔥 🔥 🔹 Real-Time Understanding 👉 Dockerfile = Recipe 🍲 👉 Image = Prepared food 👉 Container = Serving plate 🎯 Pro Insight 👉 Dockerfile optimization (layers, caching) is very important in real projects 🔥 Now building our own containers 😎 #DevOps #Docker #Dockerfile #Containers #AWS #Linux #100DaysOfDevOps #MultiCloud #DevSecOps
To view or add a comment, sign in
-
-
⚡Something clicked for me while working with Ansible. I kept thinking it was going to be complicated. 🫡 But then I realized — it's just the same stuff we already know from programming. - Variables. Conditions. Loops. The logic is identical. Only the syntax looks different. - Once that hit me, everything became much easier. Skip the confusion. Here's the real breakdown: 🌐 1. 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 — Make playbooks reusable name: "Sunil" # String fruits: [apple, banana, mango] # List user: {name: Sunil, age: 25} # Dictionary Access them with: {{ name }} · {{ fruits[0] }} · {{ user.name }} ⚙️ 2. 𝗖𝗼𝗻𝗱𝗶𝘁𝗶𝗼𝗻𝘀 (when) — Run tasks selectively 𝘄𝗵𝗲𝗻: ansible_os_family == "Debian" 🔁 3. 𝗟𝗼𝗼𝗽𝘀 — Repeat tasks cleanly 𝗹𝗼𝗼𝗽: [nginx, git, curl] 📦 4. 𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 — Capture task output 𝗿𝗲𝗴𝗶𝘀𝘁𝗲𝗿: output Then use output.stdout wherever you need it. 🧠 5. 𝘀𝗲𝘁_𝗳𝗮𝗰𝘁 — Create runtime variables 𝘀𝗲𝘁_𝗳𝗮𝗰𝘁: message: "Hello DevOps" 📊 6. 𝗔𝗻𝘀𝗶𝗯𝗹𝗲 𝗙𝗮𝗰𝘁𝘀 — Free system data, automatically ansible_hostname · ansible_ip_addresses · ansible_os_family No extra setup needed — Ansible collects this for you. 🔧 7. 𝗙𝗶𝗹𝘁𝗲𝗿𝘀 (Functions) — Transform data inline {{ name | upper }} · {{ fruits | length }} · {{ "hello" | capitalize }} 🧠 𝗦𝘂𝗺𝗺𝗮𝗿𝘆 These aren't just features — they're what separate a static script from truly smart automation. ✅ Dynamic configs that adapt to any environment ✅ Conditions that make decisions for you ✅ Loops that scale across dozens of servers ✅ System facts that eliminate hardcoding #Ansible #DevOps #Automation #YAML #Linux #Cloud #Server
To view or add a comment, sign in
-
-
Hello Everyone 👋 🐳 Docker changed the way I ship code. Here's everything you need to know to get started 👇 Before Docker, the classic nightmare was: "It works on my machine." After Docker? That excuse is gone forever. What is Docker? Docker packages your application and all its dependencies into a lightweight unit called a container. Containers run the same way — on any machine, any OS, any cloud. Think of it like a shipping container for your code. Standardized. Portable. Reliable. Why does it matter? ✅ Consistent environments across dev, staging & production ✅ Faster onboarding — clone, build, run ✅ Isolated services that don't conflict ✅ Easy to scale with Kubernetes or Docker Compose 🛠 Essential Docker commands every developer should know: ── Images ── docker pull → Download image from Docker Hub docker build -t . → Build image from Dockerfile docker images → List all local images docker rmi → Remove an image ── Containers ── docker run -p 80:80 → Run container & map ports docker ps → List running containers docker stop → Stop a running container docker exec -it sh → Open shell inside container docker logs → View container output logs docker rm → Remove a stopped container ── Compose & Cleanup ── docker compose up → Start multi-container app docker compose down → Stop and remove services docker system prune → Remove all unused resources docker push → Push image to a registry Start with a simple Dockerfile, containerize one project, and the rest clicks into place. Drop a 🐳 if you use Docker daily — or let me know in the comments what tripped you up when learning it! #contact:navinkpr2000@gmail.com #Odoo #OdooERP #Docker #DevOps #SoftwareDevelopment #Programming #Linux #CloudComputing #100DaysOfCode #WebDevelopment #crewxdev
To view or add a comment, sign in
-
🐳 Docker Swarm in Action — From Zero to a Running Cluster on My Local Machine Container orchestration is one of those topics that is much easier to understand when you actually build it yourself rather than just reading about it. So I did exactly that — I set up a full Docker Swarm cluster locally on my MacBook and documented every step with real terminal outputs. 📌 What I built and tested: ✅ A 3-node cluster (1 Manager + 2 Workers) simulated using Docker-in-Docker ✅ Custom bridge network so containers communicate by name — not by IP ✅ Deployed a replicated nginx service distributed across all 3 nodes ✅ Scaled from 3 → 6 replicas with a single command ✅ Killed a worker node and watched Swarm self-heal automatically ✅ Force-rebalanced the cluster after the node recovered ✅ Cleaned up all services, containers and networks completely 📌 Key things I learned: → Docker Swarm is built into Docker — zero extra installation → Custom networks give you DNS-based discovery between containers → Self-healing is fully automatic; rebalancing after recovery needs a manual trigger → Always clean up your environment after practice — remove services before stopping nodes → You can practice a production-grade cluster setup entirely on a single laptop I have compiled everything — concepts, architecture diagrams, all commands, and real terminal output screenshots — into a structured PDF guide attached to this post. Swipe through it if you find it useful. 👆 I hope this helps anyone learning Docker, DevOps, or getting started with container orchestration. Feel free to save this post for reference and share it with someone who might find it useful. 🙌 #Docker #DockerSwarm #DevOps #Containers #CloudNative #KnowledgeSharing #LearningInPublic #SoftwareEngineering #SRE #Linux
To view or add a comment, sign in
-
From GitHub → Jenkins → Docker → Kubernetes - complete DevOps workflow. Many people learn DevOps tools individually. But the real value comes from understanding how these tools work together in a real pipeline. Here’s a simplified breakdown of the 𝐞𝐧𝐝-𝐭𝐨-𝐞𝐧𝐝 𝐂𝐈/𝐂𝐃 𝐟𝐥𝐨𝐰 shown in the diagram 𝐂𝐈 𝐏𝐢𝐩𝐞𝐥𝐢𝐧𝐞 (𝐁𝐮𝐢𝐥𝐝 & 𝐒𝐜𝐚𝐧) ‣ Developer pushes code to GitHub ‣ Jenkins CI pulls the code and triggers the pipeline ‣ OWASP Dependency Check scans for vulnerable libraries ‣ SonarQube performs code quality & security analysis ‣ Docker builds the image ‣ Trivy scans the image for vulnerabilities ‣ Image is pushed to the registry 𝐂𝐃 𝐏𝐢𝐩𝐞𝐥𝐢𝐧𝐞 (𝐃𝐞𝐩𝐥𝐨𝐲) ‣ Jenkins CD updates the image version ‣ Changes pushed back to GitHub ‣ ArgoCD pulls the latest changes ‣ Deploys application to Kubernetes 𝐌𝐨𝐧𝐢𝐭𝐨𝐫𝐢𝐧𝐠 & 𝐀𝐥𝐞𝐫𝐭𝐬 ‣ Prometheus collects metrics ‣ Grafana visualizes dashboards ‣ Email notifications for pipeline status 𝐓𝐡𝐢𝐬 𝐢𝐬 𝐰𝐡𝐚𝐭 𝐜𝐨𝐦𝐩𝐚𝐧𝐢𝐞𝐬 𝐞𝐱𝐩𝐞𝐜𝐭 𝐲𝐨𝐮 𝐭𝐨 𝐮𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝: ‣ CI (build + scan) ‣ CD (deploy + automate) ‣ Security (shift-left approach) ‣ Monitoring (production visibility) #Kubernetes #Helm #DevOps #CloudNative #Containers #Pod #YAML #Kubernetes #ZeroToOne #Git #GitHub #Linux #VersionControl #Linux #CICD #Docker #Terraform #Script #AWS #GCP #Azure #SDLC #DevOpsLife #SRE #DevOpsEngineer #jenkins #devops #cicd #automation
To view or add a comment, sign in
-
-
From GitHub → Jenkins → Docker → Kubernetes - complete DevOps workflow. Many people learn DevOps tools individually. But the real value comes from understanding how these tools work together in a real pipeline. Here’s a simplified breakdown of the 𝐞𝐧𝐝-𝐭𝐨-𝐞𝐧𝐝 𝐂𝐈/𝐂𝐃 𝐟𝐥𝐨𝐰 shown in the diagram 𝐂𝐈 𝐏𝐢𝐩𝐞𝐥𝐢𝐧𝐞 (𝐁𝐮𝐢𝐥𝐝 & 𝐒𝐜𝐚𝐧) ‣ Developer pushes code to GitHub ‣ Jenkins CI pulls the code and triggers the pipeline ‣ OWASP Dependency Check scans for vulnerable libraries ‣ SonarQube performs code quality & security analysis ‣ Docker builds the image ‣ Trivy scans the image for vulnerabilities ‣ Image is pushed to the registry 𝐂𝐃 𝐏𝐢𝐩𝐞𝐥𝐢𝐧𝐞 (𝐃𝐞𝐩𝐥𝐨𝐲) ‣ Jenkins CD updates the image version ‣ Changes pushed back to GitHub ‣ ArgoCD pulls the latest changes ‣ Deploys application to Kubernetes 𝐌𝐨𝐧𝐢𝐭𝐨𝐫𝐢𝐧𝐠 & 𝐀𝐥𝐞𝐫𝐭𝐬 ‣ Prometheus collects metrics ‣ Grafana visualizes dashboards ‣ Email notifications for pipeline status 𝐓𝐡𝐢𝐬 𝐢𝐬 𝐰𝐡𝐚𝐭 𝐜𝐨𝐦𝐩𝐚𝐧𝐢𝐞𝐬 𝐞𝐱𝐩𝐞𝐜𝐭 𝐲𝐨𝐮 𝐭𝐨 𝐮𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝: ‣ CI (build + scan) ‣ CD (deploy + automate) ‣ Security (shift-left approach) ‣ Monitoring (production visibility) #Kubernetes #Helm #DevOps #CloudNative #Containers #Pod #YAML #Kubernetes #ZeroToOne #Git #GitHub #Linux #VersionControl #Linux #CICD #Docker #Terraform #Script #AWS #GCP #Azure #SDLC #DevOpsLife #SRE #DevOpsEngineer #jenkins #devops #cicd #automation
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development