brew install git-flow
sudo apt-get install git-flow
# 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 |
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: |
#!/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}')" |
#!/bin/bash | |
# Pre-commit hook that prevents debugging code and merge artifacts from being committed. | |
FILES_PATTERN='\.(php|ctp|ctpm|css|rb|erb|haml|js|coffee)(\..+)?$' | |
FORBIDDEN=( "binding\.pry" "save_and_open_page" "debugger" "it\.only" "describe\.only" ">>>>>>" "<<<<<<" "======" ) | |
# the exit code from `grep -E $FILES_PATTERN` gets swallowed unless the pipefail option is set | |
set -o pipefail |
#!/bin/sh | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... | |
# 1. git config --global init.templatedir '~/.git-templates' | |
# 2. mkdir -p ~/.git-templates/hooks |
#!/bin/bash | |
cat $1 | sed -r -e 's/<\/tr>/<\/tr>\n/g' -e 's/<table /\n<table/g' -e 's/<\/table>/\n<\/table>/g' -e 's/[<][^>]+[>]/ /g' -e 's/ //g' |
a. Execute: fdisk /dev/xvd?
according to the name you gave in (5);
#!/bin/bash |