Skip to content

Instantly share code, notes, and snippets.

View theprantadutta's full-sized avatar

Pranta Dutta theprantadutta

View GitHub Profile
#!/bin/sh
# Kube Admin Reset
kubeadm reset -f
# Remove all packages related to Kubernetes
apt remove -y kubeadm kubectl kubelet kubernetes-cni
apt purge -y kube*
# Remove docker containers/ images ( optional if using docker)
docker image prune -a
@theprantadutta
theprantadutta / generate-vip.sh
Last active September 17, 2024 09:25
Installs Kube VIP in system, run ``` curl -O https://gist.githubusercontent.com/theprantadutta/1d6728788a7670050767a720ad053f68/raw/generate-vip.sh && chmod +x generate-vip.sh && ./generate-vip.sh```
#!/bin/bash
# Ask for VIP and Interface
read -p "Enter the Virtual IP (VIP): " VIP
read -p "Enter the network interface: " INTERFACE
# Fetch Kube-vip version
KVVERSION=$(curl -sL https://api.github.com/repos/kube-vip/kube-vip/releases | jq -r ".[0].name")
if [ -z "$KVVERSION" ]; then
echo "Failed to fetch Kube-vip version"
@theprantadutta
theprantadutta / install-go.sh
Last active September 17, 2024 08:15
A bash script that will install Go on Ubuntu machine, asking for the Go version and ensuring it has sudo privileges. Run this with ```curl -O https://gist.githubusercontent.com/theprantadutta/698d1fdc8bb5e38207a886cf102b34d4/raw/install-go.sh && chmod +x install-go.sh && ./install-go.sh```
#!/bin/bash
# Colors for echo statements
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Check for sudo privileges
if [ "$(id -u)" -ne 0 ]; then
@theprantadutta
theprantadutta / install-zsh.sh
Last active August 29, 2026 10:27
A bash script that installs Zsh, Oh My Zsh, Powerlevel10k theme, and Zsh Autosuggestions with comments and colorful echo statements for Ubuntu. To directly install this, first run ```curl -O https://gist.githubusercontent.com/theprantadutta/68aed92bbdbc9e312c853885910e5196/raw/install-zsh.sh && chmod +x install-zsh.sh && ./install-zsh.sh```.
#!/usr/bin/env bash
#
# Zsh + Oh My Zsh + Powerlevel10k + autosuggestions + syntax-highlighting
# Works as root, via sudo, or as an unprivileged user.
#
# Usage:
# ./setup-zsh.sh -> installs for the current user
# sudo ./setup-zsh.sh -> installs for the invoking user, NOT root
# sudo ./setup-zsh.sh --root -> force install for root itself
#
@theprantadutta
theprantadutta / node-tsconfig.json
Created November 22, 2021 04:43
Typescript Config File for Node.js and React
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"skipLibCheck": true,
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"removeComments": true,
@theprantadutta
theprantadutta / 2019-https-localhost.md
Created January 27, 2021 12:45 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).