Skip to content

Instantly share code, notes, and snippets.

View alexolinux's full-sized avatar
🤠
Working from home

Alex Mendes alexolinux

🤠
Working from home
View GitHub Profile
@alexolinux
alexolinux / k82-namespace-stuck-terminating.md
Last active May 21, 2024 10:06
Removing a Namespace stuck in terminating state.

k82-namespace-stuck-terminating


  1. Defining Namespace Variable (namespace name)
NS="my-namespace"
  1. Retrieve the namespace api state specification
@alexolinux
alexolinux / k3d.md
Last active May 24, 2025 12:05
K3d CKAD Cluster Lab

K3d CKAD Cluster Lab


K3d Installation

Based on k3d.io

Requirements

@alexolinux
alexolinux / docker-ce-install.sh
Last active July 3, 2025 23:07
Docker community edition installation on Linux
#!/bin/bash
# Check if script is run as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Please use sudo."
exit 1
fi
# Update package index
if command -v apt-get &> /dev/null; then
@alexolinux
alexolinux / docker-vscode.sh
Last active May 19, 2024 13:23
code-server Docker container
#https://hub.docker.com/r/linuxserver/code-server
docker run -d \
--name=code-server \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e PASSWORD="${PASSWORD}" \
-e SUDO_PASSWORD="${SUDO_PASSWORD}" \
-e DEFAULT_WORKSPACE=/config/workspace \
@alexolinux
alexolinux / ccat-install.sh
Last active June 27, 2025 15:06
ccat package installation.
#!/bin/bash
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# https://github.com/owenthereal/ccat/releases
CCAT_VER="1.1.0"
BIN_DIR="${HOME}/.local/bin"
@alexolinux
alexolinux / k3d-controller.sh
Last active November 22, 2024 00:02
K3d Cluster control as a service
#!/bin/bash
#-- ---------------------------
#-- Author: alexolinux -------
#-- ---------------------------
k3dCheck(){
command -v k3d > /dev/null
if [ $? -eq 0 ]; then
@alexolinux
alexolinux / helm-install.sh
Last active August 27, 2025 21:55
Helm Installation for Linux distros.
#!/bin/bash
set -e
echo "Starting Helm Installation..."
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod +x get_helm.sh
./get_helm.sh
@alexolinux
alexolinux / k8s-cleanUp.sh
Last active February 1, 2024 16:26
Clean Up kubeadm confs (Useful for reinstallation or adjustments)
#!/bin/bash
# Remove/clean UP
clear && echo "Seek and Remove!"
sleep 3
kubeadm reset -f
sudo rm -rf /etc/cni /etc/kubernetes /var/lib/dockershim /var/lib/etcd /var/lib/kubelet /var/run/kubernetes ~/.kube/*
iptables -F && iptables -X
iptables -t nat -F && iptables -t nat -X
@alexolinux
alexolinux / vimrc
Last active April 14, 2024 10:23
My custom vimrc
syntax on
set showcmd
set hlsearch
set wildmenu
set ai
set si
set et
set sw=2
set ts=2
@alexolinux
alexolinux / dns-scraper.sh
Last active November 24, 2024 22:07
Shell script to look up DNS registers and catch up IPs being populated in /etc/hosts
#!/bin/bash
labserver_list=(
host1.mylabserver.com
host2.mylabserver.com
host3.mylabserver.com
)
echo "Backing Up Hosts..."
sudo cp -p /etc/hosts /etc/hosts.save