Skip to content

Instantly share code, notes, and snippets.

View sharepointoscar's full-sized avatar
💭
Winter is coming...

Oscar Medina sharepointoscar

💭
Winter is coming...
  • Using tech to support my lifestyle.
  • California
  • X @DevOpsOscar
View GitHub Profile
@sharepointoscar
sharepointoscar / minikubedelete
Last active November 25, 2023 18:47
Minikube - Delete all pods from default namespace
# delete all pods
kubectl delete --all pods --namespace=default
# deete all deployments
kubectl delete --all deployments --namespace=default
# delete all services
kubectl delete --all services --namespace=default
@sharepointoscar
sharepointoscar / 1_kubernetes_on_macOS.md
Created August 17, 2017 16:11 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@sharepointoscar
sharepointoscar / KillProcessess
Created March 24, 2017 01:34
Kill all processes running on port 80
sudo lsof -t -i tcp:80 -s tcp:listen | sudo xargs kill
# Find process running on port 8080
lsof -i:8080
# Just kill it
kill -9 $(lsof -t -i:8080)
# find process listening on port 9200
lsof -nP -i4TCP:$PORT | grep LISTEN
@sharepointoscar
sharepointoscar / RMIDockerImages
Last active January 28, 2020 01:34
Removes all dangling Docker images
# delete docker images that are dangling
docker rmi $(docker images -f "dangling=true" -q ) --force
# delete images with the status 'exited'
docker rmi $(docker ps --all -f "status=exited" -q)
# A nice holistic cleanup approach named: Scorched Earth Cleanup.
# Kindly provided by James Todd (https://twitter.com/jwtodd)
# Copy the secret.
kubectl get secret jx-basic-auth --namespace=jx --export -o yaml |
kubectl apply --namespace=jx-stagin -f -
#Download the kubeconfig
curl -o get-kubeconfig.sh \
https://raw.githubusercontent.com/gravitational/teleport/master/examples/gke-auth/get-kubeconfig.sh
#make executable
chmod +x get-kubeconfig.sh
# Pull all remote branches
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
@sharepointoscar
sharepointoscar / Stop remove all docker containers
Last active July 30, 2018 07:35
Docker - Stop and remove all containers
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
#Generate pem file from key
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
# this generates an ssh keypair
ssh-keygen -C "mykeypairname" -f id_rsa -P ""
# Create Root Certificate