Skip to content

Instantly share code, notes, and snippets.

View augustohp's full-sized avatar

Augusto Pascutti augustohp

View GitHub Profile
@augustohp
augustohp / docker-remote-image-tags.sh
Last active September 2, 2023 13:12
Lists tags for a Docker image
#!/usr/bin/env sh
#
# Helps listing remote tags for a given repository, going through all available
# pages using Docker Hub API.
#
# TODO Support official images
# TODO Output formating (date, humanize image size)
# TODO Allow different columns to be specified as output
# TODO Support other registries (with the same API, just different host)
#
@augustohp
augustohp / gcloud-k8s-init.sh
Created August 23, 2023 20:54
Logins into all clusters, for all projects in `gcloud`
#!/usr/bin/env sh
#
# Will add k8s (cluster) credentials for all existing projects for current
# gcloud account.
#
# Author: augusto.hp+oss@gmail.com
# shellcheck disable=SC3043
set -e
@augustohp
augustohp / kube-shell.sh
Last active September 25, 2024 18:18
Execute a shell inside a running pod in kubernetes. Uses fzf (fuzzy search menu) as interface for options when they are not given.
#!/usr/bin/env sh
#
# Allows you to execute a shell into a running pod inside k8s. You can
# execute this script/command without any argument and it will display
# all available namespaces, then all available pods in the chosen namespace
# and then enter the pod you chose.
#
# Choices are given using fzf, allowing you to fuzzy search among occurrences.
#
# Author: Augusto Pascutti <augusto.hp+oss@gmail>
@augustohp
augustohp / kube-secrets.sh
Last active August 15, 2023 13:34
Lists secrets for all your namespaces in kubernetes, allows some filtering using "grep" patterns.
#!/usr/bin/env sh
#
# Aids listing/filtering secrets from kubernetes using kubectl. Aims to be minimal
# and portable. The only thing you need is this file and kubectl.
#
# Author: Augusto Pascutti <augusto.hp+oss@gmail>
# License: MIT
# URL: https://gist.github.com/augustohp/b8483ca619f99682cc4c4d6b6e313818
#
# "The only way to make sense out of change
@augustohp
augustohp / healthy-links.sh
Last active August 15, 2023 03:48
Given a broken URL, one that doesn't work anymore, finds the lasting working URL (you can choose how far back to go) using Wayback Machine.
#!/bin/bash
# vim: noet ft=sh sw=4 ts=2:
#
# Unattended GPG key generation script.
# Author: Augusto Pascutti <augusto.hp+oss@gmail.com>
set -e
set -o pipefail
APP_NAME=$(basename $0)
@augustohp
augustohp / Move-Reharsals.ps1
Last active April 6, 2023 02:46
Renames `.WAV` files on removable media with the date they were created and move them to a local disk.
<#
.SYNOPSIS
Will rename and move reharsals from removable drives to another place.
.DESCRIPTION
This script will rename and move `.WAV` files from removable drives to another place.
It will rename files that are not named with a date to a date and an incremental suffix.
It will move files that are named with a date to a different path containing the year and the quarter they were recorded.
The destination path is hardcoded in the script.
#>
@augustohp
augustohp / README.md
Created January 23, 2023 15:20
Coleção de AppScripts para serem usados com Google Sheets

Minha coleção de AppScripts

Funções para serem utilizadas dentro de um GoogleSheets.

@augustohp
augustohp / gh-clone-org.sh
Last active April 11, 2023 17:29
Script (bash) to clone all repositories from a user or organization in GitHub.
#!/usr/bin/env bash
#
# Clones all repositories in an organization using `gh` CLI.
#
# Author: Augusto Pascutti <augusto.hp+oss@gmail.com>
# License: MIT
# vim: ft=sh noet ts=2 sw=2:
APP_NAME="$(basename $0)"
APP_VERSION="1.0.0"
@augustohp
augustohp / terraform-releases.sh
Created March 29, 2021 01:41
List terraform versions available (from GitHub releases).
#!/bin/bash -e
#
# Lists terraform releasesusing GitHub API.
APP_NAME=$(basename $0)
APP_VERSION="1.0.0"
OPTION_NUMBER_ONLY=""
OPTION_STABLE_ONLY=""
OPTION_ORDER=""