Skip to content

Instantly share code, notes, and snippets.

Augusto Pascutti augustohp

View GitHub Profile
@augustohp
augustohp / dns-ns-is-not.sh
Created Jul 26, 2019
Checks if the name servers of a domain are changed.
View dns-ns-is-not.sh
#!/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 Jul 23, 2019
Sends a message to a room using webhook on Hangouts Chat
View send-to-room.sh
#!/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 Jun 11, 2019
Remove duplicated files inside a folder
View deduplicate.sh
#!/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 Jun 27, 2019
Bootstraps a new environment on WSL (Windows Subsystem for Linux) with my configuration
View wsl-bootstrap.sh
#!/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 Apr 4, 2019
Command line script to clone all repositories from a group in GitLab.
View gitlab-group-clone
#!/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 Dec 27, 2018
List docker-compose.yml ports being used in all repositories inside the current directory
View report-docker-compose-port-usage.sh
#!/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 Oct 9, 2018
Report Git repositories that do not have commits for a given time
View git-report-inactive.sh
#!/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 Aug 3, 2019
Homeshick bootstrap script
View homeshick-install.sh
#!/bin/bash
# Author: Devin Waever <https://github.com/sukima>
# Author: Augusto Pascutti <augusto.hp@gmail.com>
# Origina source: https://github.com/sukima/dotfiles/blob/gh-pages/homeshick.sh
# Fork source : https://gist.github.com/augustohp/0b0f96249e399d4ec731830280fbe776
#
# Installs homeshick and clones castles of interest
# Usage: bash <(curl -L https://git.io/fNMTH)
GIT=$(which git)
@augustohp
augustohp / brazilian-names-and-gender.csv
Last active May 27, 2020
Brazilian names and gender (Male and Female) list for training data sets
View brazilian-names-and-gender.csv
Name Gender
Abel M
Abelardo M
Abner M
Abraão M
Absalom M
Absirto M
Abstêmio M
Abud M
Abundâncio M
@augustohp
augustohp / git-bacon_ratio.sh
Last active Apr 24, 2019
How good is a commit? The bigger the commit message, more thought was put into that commit
View git-bacon_ratio.sh
#!/bin/sh
CSV_OUTPUT=0
_main()
{
header_printed=""
for commit in $(repository_commits)
do
changed_lines=$(diff_stat_of $commit)
You can’t perform that action at this time.