Skip to content

Instantly share code, notes, and snippets.

@vesh95
vesh95 / qna.conf
Created March 19, 2020 04:45
monit + unicorn + sphinx + sidekiq
## Nginx ###
check process nginx with pidfile /run/nginx.pid
start program = "/usr/sbin/service nginx start"
stop program = "/usr/sbin/service nginx stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if memory usage > 80% for 5 cycles then restart
if failed host 194.61.1.61 port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout
#!/bin/sh
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
done