Skip to content

Instantly share code, notes, and snippets.

View augustohp's full-sized avatar

Augusto Pascutti augustohp

View GitHub Profile
@augustohp
augustohp / vim-para-usuarios-git.md
Last active March 20, 2024 20:09
Post: VIM para usuários Git

VIM para usuários Git

A intenção desse post é melhorar, se possível, seu workflow com o [Git][] se ele atualmente ele consiste de:

  1. Usar o [Git][] através de uma shell de sua escolha.
  2. Usar o [VIM][] como [editor padrão][2] [no Git][1].

Se você usa alguma ferramenta gráfica (tig também conta), eu não quero saber. Se você usa o [Git][] numa shell em conjunto com outro editor, procuro ansiosamente seu comentário me convencendo a trocar. :)

Preparando o VIm

@augustohp
augustohp / homeshick-install.sh
Last active October 22, 2023 01:00
Homeshick bootstrap script
#!/usr/bin/env bash
# Author: Devin Waever <https://github.com/sukima>
# Author: Augusto Pascutti <augusto.hp+oss@gmail.com>
# Original source: https://github.com/sukima/dotfiles/blob/gh-pages/homeshick.sh
# For Windows : https://gist.github.com/augustohp/15183d64bcba18a9a773b7402ea63801
# Fork source : https://gist.github.com/augustohp/0b0f96249e399d4ec731830280fbe776
#
# Installs homeshick and clones castles of interest
# Usage: bash <(curl -Ls https://git.io/fNMTH)
@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 August 23, 2023 02:03
Execute a shell inside a running pod in kubernetes, uses fuzze search to traverse among available namespaces and pods.
#!/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.
@augustohp
augustohp / to-apple.md
Last active June 5, 2023 18:49
To: Apple

Apple,

You are a company I learned to love and hate. In that same order.

  • I love the way you try to reach excellence in everything you do
  • I hate the way you try to fuck everyone else who tries to do same

Things I (still) love

  • The MacBook (track pad) is a great piece of hardware, sadly it is not one-of-a-kind anymore. Even more sad is that all other (great) options do not try to hold you on all kind of accessories and stuff, although it still bearable for an old time customer.
@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 / 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.
#>