Skip to content

Instantly share code, notes, and snippets.

View inderpartap's full-sized avatar
🏠
Working from home

Inderpartap Singh Cheema inderpartap

🏠
Working from home
View GitHub Profile
@inderpartap
inderpartap / node_migration.py
Created March 4, 2025 20:33
This Python script automates the zero-downtime migration of workloads between Amazon EKS node groups. It taints and cordons old nodes to prevent new pod scheduling, drains workloads while respecting eviction policies, and moves those workloads to the new node groups. This ensures a smooth transition without disrupting running services.
# Standard Library
import argparse
import json
import logging
import subprocess
import time
from typing import List
# Configure logging
logging.basicConfig(
@inderpartap
inderpartap / NeuralNetVisualize.py
Created February 1, 2020 07:20
This code visualizes how a Multi-layer Perceptron (MLP) Neural Network recognizes hand-written digits from the MNIST data set.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation
from sklearn.model_selection import train_test_split
plt.rcParams["animation.html"] = "jshtml"
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.utils import to_categorical, plot_model