Skip to content

Instantly share code, notes, and snippets.

View HelioCampos's full-sized avatar

Helio Campos Mello de Andrade HelioCampos

View GitHub Profile
@HelioCampos
HelioCampos / remove_user.sh
Last active December 17, 2015 16:17
Remove user from several machines in parallel
#!/bin/bash
user=$1
regions="us sa"
sshOptions="-o BatchMode=yes -o ConnectTimeout=1 -o ConnectionAttempts=1 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet"
ips=""
for region in $regions; do
ips="$ips $(tws instance list --region ${region}-east-1 | grep running | egrep -o '10\.[0-9]\.[0-9]{1,3}\.[0-9]{1,3}')"
@HelioCampos
HelioCampos / gist:e789edbf2d7a79a17889
Last active April 5, 2016 13:57 — forked from jcmartins/Docker utils
Cleanup Docker Images
Delete all containers
docker rm $(docker ps -a -q)
Delete all images
docker rmi $(docker images -q)
Removes all containers running under Docker, so use with caution.
docker ps -a | awk '{print $1}' | xargs docker kill
Removing all Containers that are not running:
@HelioCampos
HelioCampos / gitflow.md
Last active November 10, 2022 22:41
Manual de git flow

GIT FLOW

Instalando

MAC OS X:

brew install git-flow

UBUNTU/LINUX:

sudo apt-get install git-flow

Inicializando

@HelioCampos
HelioCampos / vim_commands.vim
Last active May 4, 2020 07:06
vim_commands
# VIM COMMANDS
## SUBSTITUTIONS
### Substitute [:<WORD>] by ['<WORD>'] on chef recipes
:1,$ s/[[]:\([^]]\+\)[]]/['\1']/gc
### Substitute pattern in mutiple lines to another thing
:1,$ s/local_action:\n module: \([^\n]\+\)/\1:/gc
### Substitute WORD => , to :WORD => node[\'fm_redis\'][\'confs\'][\'general\'][\'WORD\'], on lines 18 to 42