Skip to content

Instantly share code, notes, and snippets.

View vitebo's full-sized avatar
🦖

André Alves Vitebo vitebo

🦖
View GitHub Profile
@vhoyer
vhoyer / carousel.vue
Last active March 23, 2021 21:21
A functional/stateless vue component for carousel using render function with vue-awesome-swiper
@viniciusjssouza
viniciusjssouza / kubectl_context.sh
Last active January 2, 2020 22:14
show kubectl context on bash
# kube-prompt.sh
#!/bin/bash
__kube_ps1()
{
# Get current context
CONTEXT=$(cat ~/.kube/config | grep "current-context:" | sed "s/current-context: //")
if [ -n "$CONTEXT" ]; then
echo "(k8s: ${CONTEXT})"
@viniciusjssouza
viniciusjssouza / kexec
Created June 28, 2019 15:19
run a command inside a running POD
#/bin/bash
# run a shell inside a running POD
# Paramenter 1: the name of the "app". The deployment should match <app_name>-deployment and the container must have the
# app name.
POD_NAME=$(kubectl get pods -n stock --no-headers -o custom-columns=":metadata.name" | grep -m1 "$1-deployment")
echo "Acessing pod $POD_NAME"
kubectl exec -it "$POD_NAME" -n stock -c "$1" -- sh
@viniciusjssouza
viniciusjssouza / klogs
Created June 28, 2019 15:19
access the logs of a running container inside a POD
#/bin/bash
# Access the current logs of the provided POD
#
# Parameter 1: the app name, which should match the deployment name (<app name>-deployment) and the container name.
POD_NAME=$(kubectl get pods -n stock --no-headers -o custom-columns=":metadata.name" | grep -m1 "$1-deployment")
echo "Acessing pod $POD_NAME"
kubectl logs "$POD_NAME" -n stock -c "$1" --follow
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active April 14, 2024 14:27
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"