Skip to content

Instantly share code, notes, and snippets.

View Amarlanda's full-sized avatar
💭
busy at the moment, please email [email protected].

Amar Landa Amarlanda

💭
busy at the moment, please email [email protected].
View GitHub Profile
@Amarlanda
Amarlanda / kubernetes_commands.md
Created April 27, 2022 00:15 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@Amarlanda
Amarlanda / kubernetes_add_service_account_kubeconfig.sh
Created April 27, 2022 00:14 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@Amarlanda
Amarlanda / markdown-details-collapsible.md
Created April 21, 2022 10:51 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@Amarlanda
Amarlanda / add-p.md
Created April 6, 2022 20:38 — forked from mattlewissf/add-p.md
Lightning Talk: Git add -p

git add -p is your friend

git add -p is basically "git add partial (or patch)"

Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history. This feature can improve the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It allows you to see the changes (delta) to the code that you are trying to add, and lets you add them (or not) separately from each other using an interactive prompt. Here's how to use it:

from the command line, either use

  • git add -p
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
@Amarlanda
Amarlanda / kubectl.md
Created April 4, 2022 12:29 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@Amarlanda
Amarlanda / fl
Created April 4, 2022 11:31 — forked from elentok/fl
Open forklift from terminal
#!/bin/bash
# Open current directory in forklift
echo -n $PWD | pbcopy
(cat<<EOF
tell application "Forklift"
activate
tell application "System Events"

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example