Skip to content

Instantly share code, notes, and snippets.

View pancudaniel7's full-sized avatar

Daniel pancudaniel7

View GitHub Profile
@pancudaniel7
pancudaniel7 / --show-libmachine-logs -v5 logs
Last active January 5, 2020 20:20
"Could not set oc CLI context for 'minishift' profile: Error during setting 'minishift' as active profile: The specified path to the kube config '/Users/[user]/.minishift/machines/minishift_kubeconfig' does not exist"
Making call to close driver server
(minishift) Calling .Close
Successfully made call to close driver server
Making call to close connection to plugin binary
(minishift) DBG | Closing plugin on server side
Could not set oc CLI context for 'minishift' profile: Error during setting 'minishift' as active profile:
The specified path to the kube config '/Users/pancudaniel/.minishift/machines/minishift_kubeconfig' does not exist
@pancudaniel7
pancudaniel7 / devops_best_practices.md
Last active April 3, 2023 07:02 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud

@pancudaniel7
pancudaniel7 / git_resign_all_commits.sh
Last active April 3, 2023 17:00 — forked from qdequele/gpg_resign.sh
Resign all my old commits with GPG key
#!/bin/sh
cd $1
export GIT_COMMITTERT_EMAIL=pancudaniel7@gmail.com
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "pancudaniel7@gmail.com" ]
then
git commit-tree -S "$@";
fi
' -- --all
@pancudaniel7
pancudaniel7 / aliases.sh
Last active April 20, 2024 18:38
Aliases
# aliases
alias bashs="source ~/.zshrc"
alias bashp="vim ~/.zshrc"
alias install="sudo apt install -y"
alias ws="cd ~/workspace"
alias ll="ls -alh"
alias rm="rm -rf"
alias poweroff="sudo shutdown -h +0"
alias maclogout="osascript -e 'tell application \"System Events\" to log out'"
#!/bin/bash
gpg --output public.pgp --armor --export username@email
gpg --output private.pgp --armor --export-secret-key username@email
gpg --import private.key
gpg --list-keys --keyid-format LONG
gpg --list-signatures
#!/bin/bash
# first param is gpg key id (gpg --list-secret-keys --keyid-format LONG (sec field from / to right) - to get this)
echo 'export GPG_TTY=$(tty)' >> ~/.zshrc
brew uninstall gpg
brew install gpg2
brew install pinentry-mac
gpg --list-keys
git config --global user.signingkey $1
@pancudaniel7
pancudaniel7 / sealed-secret-file.sh
Last active July 19, 2021 13:30
Script for creating kubeseal sealedSecret from file
#!/bin/bash
# Params
# 1 - secret name
# 2 - file name
# 3 - secret yaml file name
# 4 - sealedSecret yaml file name
oc delete secret ${1:-ca-crt};
oc create secret generic ${1:-ca-crt} --from-file ${2:-ca.crt} && \
@pancudaniel7
pancudaniel7 / py_remote_debugger.sh
Created December 21, 2021 20:51
Python3 remote debugging using debugpy
#!/bin/bash
# Debug
python3 -m debugpy --listen 1.2.3.4:5678 --wait-for-client -m myproject
@pancudaniel7
pancudaniel7 / kube_gcp_connect.sh
Last active October 8, 2022 09:15
GCP Kubernetes cluster connect
export DEP_PROJECT_ID=my_project
export DEP_ZONE=my_project_zone
export DEP_REGION=my_project_region
gcloud config set project ${DEP_PROJECT_ID}
gcloud config set compute/zone ${DEP_ZONE}
gcloud config set compute/region ${DEP_REGION}
gcloud container clusters get-credentials naas --region ${DEP_REGION} --project ${DEP_PROJECT_ID}

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios: