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
# 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 / 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
@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 / 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 / kubernetes_commands.md
Created April 27, 2022 00:15 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@Amarlanda
Amarlanda / kubectl-cka-exams.sh
Created April 27, 2022 00:25 — forked from MartinLuksik/certs
[Kubectl] Kubectl #kubectl #k8s
## 1:
# Count the Number of Nodes That Are Ready to Run Normal Workloads
k get nodes -o=custom-columns='NAME:.metadata.name, TAINTS:.spec.taints[*]'
# Retrieve Error Messages from a Container Log
k logs data-handler -n backend | grep ERROR > /k8s/0002/errors.txt
# Find the pod with a label of app=auth in the web namespace that Is utilizing the most CPU.
k top pods -n web --selector=app=auth --sort-by=cpu
## 2:
# Edit the Web Frontend Deployment to Expose the HTTP Port

Vim Script for Python Developers

A guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, key-mapping,

@Amarlanda
Amarlanda / make_audiobook.py
Created May 16, 2022 20:25 — forked from madebyollin/make_audiobook.py
Converts an epub or text file to audiobook via Google Cloud TTS
#!/usr/bin/env python3
"""
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""
import re
import sys