Skip to content

Instantly share code, notes, and snippets.

View akhan4u's full-sized avatar
☘️
Gratitude

Amaan Khan akhan4u

☘️
Gratitude
View GitHub Profile
apiVersion: kyverno.io/v2
kind: PolicyException
metadata:
name: toleration-exceptions
namespace: kube-system
spec:
background: true
match:
any:
- kinds:
@akhan4u
akhan4u / kubernetes_logging.md
Last active August 12, 2025 04:19
kubernetes logging
flowchart TD
    A[Kubernetes Cluster] --> B[Metrics Collection]
    A --> C[Log Collection]

    %% Metrics Branch
    B --> D[Prometheus]
    B --> Z[VictoriaMetrics Stack]
    D --> E[Grafana]
    D --> F[Alertmanager]
@akhan4u
akhan4u / exercise.yaml
Created May 1, 2025 12:48
EKS & Terraform Exercises
# Exercise 1: EKS + ECR - Containerized Application Deployment
# Goal
Deploy a containerized application using Amazon EKS and manage container images with ECR.
# Steps
1. Containerize your application using Docker.
2. Push the Docker image to Amazon ECR.
3. Set up an Amazon EKS cluster.
4. Configure access from EKS to ECR.
@akhan4u
akhan4u / expr_syntax.md
Created February 9, 2023 14:57
Expr Syntax and bash equivalent
EXPR Syntax Bash Equiv Meaning
SEE NOTE 1 "${ARG1:-$ARG2}" ARG1 if it is neither null nor 0, otherwise ARG2
ARG1 & ARG2
@akhan4u
akhan4u / kubectl_export.sh
Last active December 10, 2022 05:31
Export Kubernetes namespace to Disk 💾
# Prerequisites:
# [GNU Parallel](https://www.gnu.org/software/parallel/)
# [kubectl-neat](https://github.com/itaysk/kubectl-neat)
# [mikefarah/yq](https://github.com/mikefarah/yq)
#
# Usage:
# - Copy and paste the below into your active shell session. Alternatively, add to your shell initialization scripts.
# - kubectl_export <namespace>
# The folder structure will be created: <namespace>/<kind>/<resource_name>.yaml
#
@akhan4u
akhan4u / LearnGoIn5mins.md
Created August 11, 2022 08:33 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
@akhan4u
akhan4u / myscript.sh
Created June 28, 2022 10:08
Shell scripting for beginners
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@akhan4u
akhan4u / cloudformation pre-commit
Created October 20, 2020 13:29
Git pre-commit hook for linting and validating Cloudformation templates.
#!/bin/sh
# Only Run If Any Cloudformation Template Is Modified And Checks Linting Of The Template
#------------------
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
#------------------
FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.yml" "*.yaml" | sed 's| |\\ |g')
@akhan4u
akhan4u / learning_linux.md
Last active September 4, 2025 03:41
Useful websites for Learning Linux
  1. Guided Self learning (https://linuxjourney.com)
  2. Best one liners for linux command line (https://www.commandlinefu.com/commands/browse)
  3. Find files in linux from command line (https://linuxize.com/post/how-to-find-files-in-linux-using-the-command-line)
  4. Improve your typing speed on the command line with this awesome tool! (https://github.com/balzss/cli-typer)
  5. An interactive cheatsheet tool for the command-line (https://github.com/denisidoro/navi)
  6. Customize your shell environment to next level (https://github.com/alebcay/awesome-shell)
  7. I find it useful to learn new things with the self learning courses offered by github (https://lab.github.com)
  8. A static analysis tool for shell scripts (https://github.com/koalaman/shellcheck)
  9. A good collection of bash snippets if you are starting to learn about shell scripts in linux (https://github.com/alexanderepstein/Bash-Snippets)
  10. Linux workshop 10 days (https://linuxessentials.netlify.app)