Skip to main content

Posts

My Kubernetes crash course

Kubernetes orchestrates containers at scale. Install kubectl and configure it for your cluster. To check cluster info: kubectl cluster-info To see nodes: kubectl get nodes To create a deployment: kubectl create deployment myapp --image=nginx To view pods: kubectl get pods To expose deployment: kubectl expose deployment myapp --type=NodePort --port=80 To scale: kubectl scale deployment myapp --replicas=3 To delete deployment: kubectl delete deployment myapp Kubernetes may look complex at first but the core idea is simple. Define desired state. Kubernetes maintains it. Happy K8ing Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk . My views and opinions are my own and not necessarily represent the views of my employer. © Raheel Hameed and www.raheelhameed.com...

My Bash scripting crash course

Bash scripting automates repetitive tasks. Create a file called script.sh: #!/bin/bash echo "Hello World" Make it executable: chmod +x script.sh Run it: ./script.sh Variables: name="Raheel" echo $name Conditionals: if [ -f file.txt ]; then echo "File exists" fi Loops: for i in 1 2 3 do echo $i done Bash scripting saves time and reduces manual errors. Automate once. Run forever. Happy Bash scripting! Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk . My views and opinions are my own and not necessarily represent the views of my employer. © Raheel Hameed and www.raheelhameed.com, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly proh...

My SSH crash course

SSH allows secure remote login to another machine. To connect: ssh user@server-ip If this is your first time connecting, you will be prompted to accept the host key. To generate an SSH key pair: ssh-keygen Press Enter to accept defaults. Copy your public key to remote server: ssh-copy-id user@server-ip Now you can login without password. To specify a private key: ssh -i mykey.pem user@server-ip SSH is secure, fast, and essential for server management. Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk . My views and opinions are my own and not necessarily represent the views of my employer. © Raheel Hameed and www.raheelhameed.com, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/o...

My Systemd crash course

Systemd manages services on modern Linux systems. To check status of a service: systemctl status nginx To start a service: systemctl start nginx To stop: systemctl stop nginx To restart: systemctl restart nginx To enable a service at boot: systemctl enable nginx To disable: systemctl disable nginx To view all services: systemctl list-units --type=service Systemd also handles logs through journalctl. To view logs for a service: journalctl -u nginx Understanding systemd gives you control over how services behave on your system. Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk . My views and opinions are my own and not necessarily represent the views of my employer. © Raheel Hameed and www.raheelhameed.com, 2017. Unauthorized use and/or duplication of this...

My Nginx crash course

Nginx is a lightweight and powerful web server. It is commonly used as a reverse proxy and load balancer. Install Nginx using your package manager. On Ubuntu: sudo apt install nginx To start the service: sudo systemctl start nginx To check status: sudo systemctl status nginx Open your browser and navigate to your server IP. If you see the Nginx welcome page, it is working. Main configuration file is typically located at: /etc/nginx/nginx.conf Server blocks are usually inside: /etc/nginx/sites-available/ A simple server block example: server { listen 80; server_name example.com; root /var/www/html; index index.html; } After editing configuration: sudo nginx -t sudo systemctl reload nginx Nginx is fast, efficient, and production ready. It is a great addition to your toolbox. Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the...

My Git crash course

Git is a distributed version control system. In simple words, it tracks changes in your code and lets you collaborate safely. Install Git from the official website. Once installed, verify: git --version To initialize a new repository: git init To add files to staging: git add . To commit changes: git commit -m "Initial commit" To check status: git status To view commit history: git log To create a new branch: git branch feature-branch To switch to it: git checkout feature-branch To merge back into main: git checkout main git merge feature-branch To connect to a remote repository: git remote add origin To push changes: git push -u origin main Git may seem confusing at first but once you understand staging, committing, and branching, everything becomes logical. Remember, version control is not optional. It is essential. Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets ...

My Docker crash course

Docker has taken the container world by storm. If you understood LXC from the previous post, Docker will feel like a polished toolkit built on similar ideas. This post gives you a quick start so you can begin running containers in minutes. First, install Docker on your system. On Linux you can install it via your distribution’s package manager. On Windows and macOS you can download Docker Desktop from the official Docker website. Once installed, verify it works: docker --version If you see version information, you are ready. Run your first container: docker run hello-world Docker will pull the image if it does not exist locally and then execute it. Congratulations. You just ran your first container. To see running containers: docker ps To see all containers including stopped ones: docker ps -a To run an interactive Ubuntu container: docker run -it ubuntu /bin/bash You are now inside the container shell. To exit: exit To stop a running container: docker stop...