Skip to content

Instantly share code, notes, and snippets.

View aeciopires's full-sized avatar

Aécio Pires aeciopires

View GitHub Profile
@andredeo
andredeo / sos
Last active January 13, 2022 21:21
406234789
885052789
887641399

Authorize gcloud to access the Cloud Platform with Google user credentials

$ gcloud auth login

Configure kubectl tool

$ gcloud container clusters get-credentials kubeernetes --zone us-central1-a --project camel-knative
@rxhanson
rxhanson / gist:df0f2b49f402ea181f5ed61b20f9cd8d
Last active March 28, 2024 13:17 — forked from bhumphrey/gist:3764983
Cherry-picking from another fork
git remote add <other-fork-alias> <other-fork-URL>
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
git remote remove <other-fork-alias>
git remote -v
minikube stop; minikube delete &&
docker stop $(docker ps -aq) &&
rm -rf ~/.kube ~/.minikube &&
sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube &&
launchctl stop '*kubelet*.mount' &&
launchctl stop localkube.service &&
launchctl disable localkube.service &&
sudo rm -rf /etc/kubernetes/ &&
docker system prune -af --volumes
@jason-kane
jason-kane / .bash_prompt
Created April 3, 2018 18:31
Bash prompt with git branch and k8s context/namespace
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
#
# USAGE:
@andytumelty
andytumelty / aws query example: show VPC ID, Name and CIDR
Last active March 13, 2024 17:56
AWS CLI List VPC ID, Name and CIDR Block
# display VPC ID, CIDR Block and Name
aws ec2 --output text --query 'Vpcs[*].{VpcId:VpcId,Name:Tags[?Key==`Name`].Value|[0],CidrBlock:CidrBlock}' describe-vpcs
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@Faheetah
Faheetah / Dockerfile
Last active October 19, 2022 15:22
Docker patterns/anti-patterns
### Generic Dockerfile demonstrating good practices
### Imports
# Bad-ish, we do not need Ubuntu for this, nor do we want latest if we are using in a build system, predictable is better
FROM ubuntu:latest
# Better, using a small image since our app has no dependency on Ubuntu
FROM alpine:3.3
@Faheetah
Faheetah / module.sh
Last active March 18, 2022 01:01
Ansible bash module boilerplate
#!/bin/bash
# Source arguments from Ansible
# These are passed into the module as $1 with a key=value format
# Sourcing this file sets the variables defined in the Ansible module
# Note that variables that are unused in the module are silently ignored
source $1
# Helper function to fail the module with the specified error
# This can accept $@ in printf for the full error
@lukas-h
lukas-h / license-badges.md
Last active July 3, 2024 12:58
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)