Skip to content

Instantly share code, notes, and snippets.

View krasnobaev's full-sized avatar
👨‍🔬

Aleksey Krasnobaev krasnobaev

👨‍🔬
View GitHub Profile
@krasnobaev
krasnobaev / Makefile
Last active August 29, 2015 14:07
Docker makefile
IMAGE = IMAGENAME
CONTAINER = CONTAINERNAME
build:
docker build -t $(IMAGE) .
rebuild:
docker build -t --no-cache=true $(IMAGE) .
run:
@krasnobaev
krasnobaev / check for program existing
Last active August 29, 2015 13:56
bash use cases
command -v foo >/dev/null 2>&1 || { echo >&2 "I require foo but it's not installed. Aborting."; exit 1; }
type foo >/dev/null 2>&1 || { echo >&2 "I require foo but it's not installed. Aborting."; exit 1; }
hash foo 2>/dev/null || { echo >&2 "I require foo but it's not installed. Aborting."; exit 1; }
# http://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script