Skip to content

Instantly share code, notes, and snippets.

View augustohp's full-sized avatar

Augusto Pascutti augustohp

View GitHub Profile
@augustohp
augustohp / wsl-for-unixers.md
Last active January 26, 2023 19:45
Using Windows after 15 years of BSD (OSX, MacOS) and Unix (Debian Linux) is full of hits and misses, hopefully this will help me remembering how to set everything up.

WSL for people who do Unix

Virtualization makes obvious how many abstractions exists composing our workflow because something will break. Coming from a decade using Unix and Vim as my IDE this is what I've learned while using WSL2 and Windows.

Vocabulary

  • Windows Home: Your private user folder on Windows ($USERPROFILE% env var)
  • WSL Home: Your home inside the Linux Distro ($HOME env var)
@augustohp
augustohp / dns-ns-is-not.sh
Created July 26, 2019 15:50
Checks if the name servers of a domain are changed.
#!/usr/bin/env sh
#
# Checks if the nameservers of a domain changed.
#
# Example:
# $ dns-ns-is-not example.org auto.dns.br \
# && send-to-room.sh "DNS change applied! \o/"
DIG=$(command -v dig)
DNS="8.8.8.8"
@augustohp
augustohp / send-to-room.sh
Last active July 23, 2019 20:33
Sends a message to a room using webhook on Hangouts Chat
#!/usr/bin/env sh
#
# Envia uma mensagem pro canal de Tecnologia no Hangouts Chat.
set -e
if [ ! -z "$DEBUG" ]
then
set -x
fi
@augustohp
augustohp / deduplicate.sh
Created June 11, 2019 20:04
Remove duplicated files inside a folder
#!/usr/bin/env bash
APP_NAME=$(basename $0)
APP_VERSION="1.0.0"
APP_REQUIREMENTS="awk mktemp md5sum grep"
TMP_HASHES="$(mktemp tmp-hashes-XXX)"
TMP_HASHES_DUPLICATED="$(mktemp tmp-duplicated-hashes-XXX)"
TMP_FILES_DUPLICATED="$(mktemp tmp-duplicated-files-XXX)"
@augustohp
augustohp / wsl-bootstrap.sh
Last active April 3, 2023 22:20
Bootstraps a new environment on WSL (Windows Subsystem for Linux) with my configuration
#!/usr/bin/env bash
# vim: noet ft=sh sw=4 ts=4:
#
# Author: Augusto Pascutti <augusto.hp+oss@gmail.com>
#
# This will help you bootstrap a Windows machine with WSL with Docker
# and some other utilities. This is heavily customized for my own use.
#
# Requirements (or things that should already be installed):
# - WSL (with Debian or Ubuntu): `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`
@augustohp
augustohp / gitlab-group-clone
Last active April 4, 2019 18:27
Command line script to clone all repositories from a group in GitLab.
#!/usr/bin/env sh
#
# This script will help you clone all repositories
# from an organization in GitLab.
APP_NAME=$(basename $0)
APP_VERSION="1.0.0"
APP_AUTHOR="augusto.hp+oss@gmail.com"
OPTION_ORG_NAME=""
OPTION_REPOSITORIES_PATH="${HOME}/src"
@augustohp
augustohp / report-docker-compose-port-usage.sh
Created December 27, 2018 18:03
List docker-compose.yml ports being used in all repositories inside the current directory
#!/usr/bin/env sh
# vim: ft=sh:
# Usage: list_docker_compose_files [pattern]
list_docker_compose_files()
{
pattern=${1:-"docker-compose.yml"}
find . -name "${pattern}" -type f
}
@augustohp
augustohp / git-report-inactive.sh
Created October 9, 2018 20:29
Report Git repositories that do not have commits for a given time
#!/usr/bin/env bash
# vim: ft=sh:
APP_NAME=$(basename $0)
APP_VERSION="1.0.0"
OPTION_ACTIVE_IS="6 month ago"
command_help()
{
cat <<-EOT
@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 / brazilian-names-and-gender.csv
Last active November 10, 2021 14:13
Brazilian names and gender (Male and Female) list for training data sets
Name Gender
Abel M
Abelardo M
Abner M
Abraão M
Absalom M
Absirto M
Abstêmio M
Abud M
Abundâncio M