Skip to content

Instantly share code, notes, and snippets.

View odolbeau's full-sized avatar

Olivier Dolbeau odolbeau

View GitHub Profile
@odolbeau
odolbeau / hc-monitor
Last active October 29, 2023 14:34
Healtchecks.io bash decorator
#!/bin/bash
# Hosted on gist : https://gist.github.com/odolbeau/bd6d8eb7910d1289e2687682c8db9275
if [ $# -lt 1 ] || [ -z "$1" ] || [ -z "${UUID}" ]; then
echo "Usage: UUID=your-uuid $0 [command to run]"
echo "Decorates a command to notify healtchecks.io"
exit 1
fi
@odolbeau
odolbeau / GNUmakefile
Last active September 28, 2023 07:30
GNUmakefile - The file I use to define my own tasks without modifying the existing Makefile
include Makefile
# @See: https://stackoverflow.com/a/14061796
# If you want to pass some arguments directly to your target, add it to the SUPPORTED_COMMANDS right here
SUPPORTED_COMMANDS :=
SUPPORTS_MAKE_ARGS := $(findstring $(firstword $(MAKECMDGOALS)), $(SUPPORTED_COMMANDS))
ifneq "$(SUPPORTS_MAKE_ARGS)" ""
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
RUN_ARGS := $(subst :,\:,$(RUN_ARGS))
$(eval $(RUN_ARGS):;@:)
@odolbeau
odolbeau / domain-checker
Last active May 4, 2023 14:11
Check that given DOMAIN(s) are present in /etc/hosts and resolve to localhost
#!/bin/bash
# See: https://gist.github.com/odolbeau/d961aad7dc026cb2e851e59cdcd3eec6
if [ $# -eq 0 ] || [ -z "$1" ]; then
echo -e "Usage: $0 DOMAIN..."
echo -e "Check that given DOMAIN(s) are present in /etc/hosts and resolve to localhost"
exit 1
fi