Skip to content

Instantly share code, notes, and snippets.

@cinco
cinco / monit.md
Created May 19, 2019 06:03 — forked from bpostlethwaite/monit.md
monit

monitoring shit with monit

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
@cinco
cinco / monitrc
Created May 19, 2019 06:21 — forked from franck/monitrc
monit config file (nginx, mysql, redis, tomcat)
###############################################################################
## 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.
@cinco
cinco / linux-dns.md
Created June 14, 2019 01:35 — forked from roulette6/linux-dns.md
Linux managing DNS servers (LPIC-2)

Linux managing DNS servers (LPIC-2)

Quick command reference

lsb_release -d          # get Linux distro and version
cat /etc/centos-release

# ubuntu
sudo /etc/init.d/bind9 {start | stop | restart}

sudo -u bind rndc status

@cinco
cinco / karigran.com.zone
Created June 14, 2019 01:52 — forked from maazghani/karigran.com.zone
karigran.com.zone
; 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
@cinco
cinco / Dockerfile
Created July 11, 2019 03:58 — forked from ktquez/Dockerfile
Dockerfile for PHP7 memcache and Redis ext
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 \
@cinco
cinco / install-terraform-packer-os-x.sh
Created January 9, 2020 13:40 — forked from Adron/install-terraform-packer-os-x.sh
Install Terraform & Packer on Linux
#!/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 ~
@cinco
cinco / terraform-install.sh
Last active January 26, 2020 18:57 — forked from danisla/terraform-install.sh
Terraform latest version install script (modified to zsh and exclude alpha versions)
#!/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
@cinco
cinco / sync-projects
Created February 4, 2020 21:14 — forked from nathanbrauer/sync-projects
Gitlab: Clone / Pull all projects in a group
#!/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
@cinco
cinco / dockergrep.sh
Created March 12, 2020 15:32 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container