Skip to content

Instantly share code, notes, and snippets.

View guilhermelinhares's full-sized avatar
🍷
building

Guilherme Linhares guilhermelinhares

🍷
building
View GitHub Profile
@guilhermelinhares
guilhermelinhares / ppk_to_key.md
Created January 31, 2024 22:18
convert ppk to key (Linux)

Install Putty-Tools

  • Ubuntu: sudo apt-get install putty-tools
  • Debian-like: apt-get install putty-tools
  • RPM based: dnf install putty or yum install putty

Convert ppk to private key

  • puttygen id_dsa.ppk -O private-openssh -o id_dsa

Convert ppk to public key

  • puttygen id_dsa.ppk -O public-openssh -o id_dsa.pub
@guilhermelinhares
guilhermelinhares / frozen_namespace_k8s
Created January 19, 2024 15:57
Frozen namespace terminating..
kubectl get namespace "$NAMESPACE_NAME" -o json \
| tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \
| kubectl replace --raw /api/v1/namespaces/$NAMESPACE_NAME/finalize -f -
@guilhermelinhares
guilhermelinhares / SSH_AUTH_SOCK
Created December 27, 2023 14:42
Failed SSH_AUTH_SOCK
https://github.com/wwalker/ssh-find-agent
@guilhermelinhares
guilhermelinhares / coredns.md
Created July 31, 2023 12:19
CoredDNS pod stuck - ContainerCreating

Remove All Drivers CNI

sudo rm -rf /etc/cni/net.d/*

Rollout deploy Coredns

kubectl rollout restart deploy coredns -n kube-system
@guilhermelinhares
guilhermelinhares / install_zsh.sh
Last active July 23, 2024 12:05
Install ZSH+Ohmyzsh
# Install ZSH
sudo apt install zsh -y
chsh -s /bin/zsh
zsh
# Install Oh-my-zsh! -> https://ohmyz.sh/
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install Spaceship Prompt
# https://github.com/spaceship-prompt/spaceship-prompt
@guilhermelinhares
guilhermelinhares / install_kubectl.md
Last active February 27, 2023 20:59
Install Kubectl Ubuntu

Install Kubectl + Kubeadm + Kubelet

  • Update the apt package index and install packages needed to use the Kubernetes apt repository:
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
  • Add the Kubernetes apt repository:
@guilhermelinhares
guilhermelinhares / sed_url.txt
Created January 30, 2023 20:50
sed: -e expression #1, unknown option to `s'
#
sed 's#https://www.url.com/url_page#http://www.url_change.com/page_url_change#g' filetochange.txt

Commands Docker

Remove and stop all containers

docker ps -aq | xargs docker stop | xargs docker rm

Remove all images

docker rmi $(docker images -a -q)
@guilhermelinhares
guilhermelinhares / xdebug.md
Last active February 8, 2023 23:42
Install Xdebug Localhot | Phpstorm | Vscode

Install + Configure Xdebug 3

Method to install xdebug 3. Homolog in Ubuntu 22.04 , AlmaLinux 8.7

Php Versions:

  • 7.4
  • 8.0
  • 8.1