get monit
sudo apt-get install monit
monit configuration is in ~/.monitrc
| set alert usera@example.com | |
| set mailserver smtp.gmail.com port 587 | |
| username "user@gmail.com" | |
| password "password" | |
| using TLSV1 | |
| with timeout 30 seconds | |
| set mail-format { | |
| from: monit@server.example.com |
| ############################################################################### | |
| ## Monit control file | |
| ############################################################################### | |
| ## | |
| ## Comments begin with a '#' and extend through the end of the line. Keywords | |
| ## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
| ## | |
| ## Below you will find examples of some frequently used statements. For | |
| ## information about the control file, a complete list of statements and | |
| ## options please have a look in the monit manual. |
| ; Domain: karigran.com | |
| ; Exported (y-m-d hh:mm:ss): 2015-05-30 15:15:58 | |
| ; | |
| ; This file is intended for use for informational and archival | |
| ; purposes ONLY and MUST be edited before use on a production | |
| ; DNS server. | |
| ; | |
| ; In particular, you must update the SOA record with the correct | |
| ; authoritative name server and contact e-mail address information, | |
| ; and add the correct NS records for the name servers which will |
| FROM php:7-fpm | |
| # Install modules | |
| RUN apt-get update && apt-get install -y \ | |
| libfreetype6-dev \ | |
| libjpeg62-turbo-dev \ | |
| libmcrypt-dev \ | |
| libpng12-dev \ | |
| libmemcached-dev \ | |
| libmysqlclient-dev \ | |
| libicu-dev \ |
| #!/usr/bin/env bash | |
| # Script prerequisite > install jq > https://stedolan.github.io | |
| # ******************************************************************************************** | |
| # UPDATE: Check out Robert's repo here https://github.com/robertpeteuil/terraform-installer | |
| # Robert's repo is more built out and has more options around the installation process. | |
| # Cheers! -Adron | |
| # ******************************************************************************************** | |
| cd ~ |
| #!/bin/bash | |
| function terraform-install() { | |
| [[ -f ${HOME}/bin/terraform ]] && echo "`${HOME}/bin/terraform version` already installed at ${HOME}/bin/terraform" && return 0 | |
| LATEST_URL=$(curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | egrep 'terraform_[0-9]\.[0-9]{1,2}\.[0-9]{1,2}_linux.*amd64' | sort -V | tail -1) | |
| curl ${LATEST_URL} > /tmp/terraform.zip | |
| mkdir -p ${HOME}/bin | |
| (cd ${HOME}/bin && unzip /tmp/terraform.zip) | |
| if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then | |
| echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.zshrc |
| #!/usr/bin/env bash | |
| # Documentation | |
| # https://docs.gitlab.com/ce/api/projects.html#list-projects | |
| if [[ `whoami` == "root" ]]; then | |
| echo "DO NOT run this program as root! Quitting." | |
| exit 1 | |
| fi |
| docker logs nginx 2>&1 | grep "127." | |
| # ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |