Skip to content

Instantly share code, notes, and snippets.

View madflojo's full-sized avatar
:octocat:
Writing code that might be useful

Benjamin Cane madflojo

:octocat:
Writing code that might be useful
View GitHub Profile
@madflojo
madflojo / rb-nginx-check.sh
Created November 26, 2014 11:24
Runbook: nginx health checker
#!/bin/bash
## nginx health check
## -------------------------------------------------
## This script will check if nginx is up or down. It will exit with a 0 status if nginx is up,
## and exit with a 1 status if nginx is down.
## This script also integrates cr-webhook.sh which is a notification script that sends a webhook
## request to a specified monitor at runbook.io. To use this script without the runbook webhook
## simply leave RUNBOOK_NOTIFY set to False.
## Runbook.io settings
@madflojo
madflojo / install_docker_1.console
Created June 18, 2020 07:40
Medium - Compose for DBs
$ sudo su -
# apt-get install -y apt-transport-https ca-certificates curl gnupg-agent python-pip
@madflojo
madflojo / install_docker_2.console
Created June 18, 2020 07:43
Medium: Compose for DBs
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# apt-get update
# apt-get install -y docker-ce docker-ce-cli containerd.io
language: go
go:
- 1.14.1
os:
- linux
env:
- "PATH=/home/travis/gopath/bin:$PATH"
before_script:
- go mod tidy
script:
version: "3"
services:
tests:
build: .
working_dir: /go/src/github.com/madflojo/hord
command: go test -v ./...
cassandra-primary:
image: madflojo/cassandra:latest
command: /bin/bash -c "sleep 1 && /docker-entrypoint.sh cassandra -f"
environment:
- CASSANDRA_KEYSPACE=hord
expose:
- 7000
- 7001
- 7199
- 9042
tests:
build: .
depends_on:
- cassandra
- cassandra-primary
working_dir: /go/src/github.com/madflojo/hord
entrypoint: go test -v ./...
$ vi dev-compose.yml
# pip install docker-compose