Skip to content

Instantly share code, notes, and snippets.

View joeyimbasciano's full-sized avatar

Joey Imbasciano joeyimbasciano

View GitHub Profile
@joeyimbasciano
joeyimbasciano / gist:5105113
Created March 7, 2013 02:26
WTF BASH (╯°□°)╯︵ ┻━┻
[user@ip-10-60-109-73]# cat MINDBLOWN
HELLO
WORLD
[user@ip-10-60-109-73]# grep -v HELLO MINDBLOWN
WORLD
[user@ip-10-60-109-73]# grep -v HELLO MINDBLOWN > MINDBLOWN
[user@ip-10-60-109-73]# cat MINDBLOWN
[user@ip-10-60-109-73]#
@joeyimbasciano
joeyimbasciano / kick-myapp
Created November 1, 2012 20:29
Recovery Script
#!/bin/bash
/usr/bin/monit start appsrv1
/usr/bin/monit stop aws-dns-healthcheck
@joeyimbasciano
joeyimbasciano / monit.myapp.conf
Created November 1, 2012 20:19
Monit configuration file to check HTTP service listening on port 9009 and recovery from DNS failures
check host appsrv1 with address 127.0.0.1
start program = "/sbin/start myapp"
stop program = "/sbin/stop myapp"
alert alerts@example.com on {timeout,connection}
if failed port 9009 protocol HTTP
request /
with timeout 3 seconds
then restart
if 10 restarts within 10 cycles then timeout
if 10 restarts within 10 cycles then exec "/usr/bin/monit start aws-dns-healthcheck"
@joeyimbasciano
joeyimbasciano / monit.myapp.conf
Created November 1, 2012 19:55
Basic Monit configuration file to check an HTTP service listening on port 9009
check host appsrv1 with address 127.0.0.1
start program = "/sbin/start myapp"
stop program = "/sbin/stop myapp"
alert alerts@example.com on {timeout,connection}
if failed port 9009 protocol HTTP
request /
with timeout 3 seconds
then restart
if 10 restarts within 10 cycles then timeout