Skip to content

Instantly share code, notes, and snippets.

View jjuarez's full-sized avatar
🛠️
Fixing almost everything

Javier Juarez jjuarez

🛠️
Fixing almost everything
View GitHub Profile
@ilobmirt
ilobmirt / refresh_vagrant.sh
Created March 5, 2023 22:19
Brings down and up the target vagrant environment, then re-establishes the ssh connection host_ids
#!/bin/bash
#==================================================================================================#
#refresh_vagrant.sh
#-----------------------
#by: ilobmirt 2023 MAR 05
#
#Brings down and up the target vagrant environment, then re-establishes the ssh connection host_ids
#==================================================================================================#
@jjuarez
jjuarez / Dockerfile
Created December 21, 2021 16:09
Dockerfile using python poetry
ARG IMAGE_TAG="3.8.12-alpine3.15@sha256:ae21a996ebe902ddc73cff020202d94cb539c8c4426f67636374b32a6f9c3d22"
FROM python:${IMAGE_TAG} AS builder
ARG POETRY_VERSION=1.1.12
# hadolint ignore=DL3013,DL3018
RUN apk add --no-cache \
gcc \
libffi-dev \
musl-dev && \
@thomaspoignant
thomaspoignant / Makefile
Last active April 30, 2024 10:55
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@karlkfi
karlkfi / bash2asciicast.sh
Created February 2, 2021 07:16
bash2asciicast.sh - Convert a bash script into an asciinema recording
#!/usr/bin/env bash
# Convert a bash script into an asciinema recording
set -o errexit -o nounset -o pipefail
INPUT_FILE=${1:-}
if [[ -z "${INPUT_FILE}" ]]; then
echo "Syntax: $0 <path/to/bash-scipt.sh> <path/to/out.cast>"
exit 1
@karlkfi
karlkfi / bash2asciicast.sh
Last active February 2, 2021 07:36
bash2asciicast.sh - Convert a bash script into an asciicast recording
#!/usr/bin/env bash
# Convert a bash script into an asciicast recording
set -o errexit -o nounset -o pipefail
USER=karl
WORKDIR="~/workspace"
PROMPT="\u001b]0;Cloud Shell\u0007${USER}@cloudshell:\u001b[1;34m${WORKDIR}\u001b[00m$ \u001bkcloudshell\u001b\\\\"
@angelbarrera92
angelbarrera92 / auth-dockerhub-kind.yaml
Created January 4, 2021 12:24
Avoid DockerHub rate limit on kind configuration
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
- role: worker
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry]
@hectorcanto
hectorcanto / Makefile
Created November 11, 2020 11:56
A curated Makefile for a Python repository, with commands for using several code quality and security tools like Pylint, Flake, Bandit, Trivy ... Assumes everything is installed, a full demo repo is pending (it is a promise)
# https://misc.flogisoft.com/bash/tip_colors_and_formatting
RED="\\e[91m"
GREEN="\\e[32m"
BLUE="\\e[94m"
YELLOW="\\e[33m"
REGULAR="\\e[39m"
REPORTS=".coverage-reports"
SRC="app"
VERSION=$(shell cat ${SRC}/__init__.py | head -n 1 | cut -d" " -f 3 | tr -d "'")
#!/bin/bash
# Create the cluster
kind create cluster --name lb
# Get the configuration
kind get kubeconfig --name lb > /tmp/lb-kubeconfig
# Deploy metallb
KUBECONFIG=/tmp/lb-kubeconfig kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.5/manifests/namespace.yaml
KUBECONFIG=/tmp/lb-kubeconfig kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.5/manifests/metallb.yaml
KUBECONFIG=/tmp/lb-kubeconfig kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
@hectorcanto
hectorcanto / adr-template.md
Last active August 1, 2022 07:36
A template for Arquitecture Decision Records

ADR Template

Short Title

Short title of solved problem and solution [Describe the general problem and the chosen solution in free from in a few sentences. Leave specific details for the following sections]