Skip to content

Instantly share code, notes, and snippets.

View akhan4u's full-sized avatar
☘️
Gratitude

Amaan Khan akhan4u

☘️
Gratitude
View GitHub Profile
@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 March 15, 2025 11:07
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)
@akhan4u
akhan4u / file.py
Last active May 25, 2021 08:15
s3 replication cross region within same AWS account
import boto3, os, botocore, traceback
from botocore.exceptions import ClientError
s3 = boto3.client('s3')
# READ VALUES FROM ENVIRONMENT VARIABLES
source_s3_bucket = os.environ['source_s3_bucket']
#kms_keyid = os.environ['Kms_Keyid']
@akhan4u
akhan4u / install_nvidia-docker2.sh
Last active April 3, 2019 18:55
Install nvidia-docker2 and docker-ce on Ubuntu 18.04
#!/bin/bash
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
echo -e "Installing nvidia-docker2 for $distribution"
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \