Skip to content

Instantly share code, notes, and snippets.

View druchoo's full-sized avatar

Andrew Choo druchoo

  • Vonage
  • NC
  • 10:18 (UTC -04:00)
View GitHub Profile
@anderiv
anderiv / pre-receive
Created February 20, 2012 23:04
nagios git pre-receive hook
#!/bin/bash
while read OLD_SHA1 NEW_SHA1 REFNAME; do
export GIT_WORK_TREE=/tmp/nagiosworkdir
/usr/bin/git checkout -f $NEW_SHA1
# sed -i "s|cfg_dir=CHANGEWITHGIT|cfg_dir=${GIT_WORK_TREE}\/config|g" $GIT_WORK_TREE/etc/nagios.cfg
sed -i "s|cfg_file=\/usr\/local\/nagios\/etc\/objects\/commands.cfg|cfg_file=${GIT_WORK_TREE}\/objects\/commands.cfg|g" $GIT_WORK_TREE/nagios.cfg
sed -i "s|cfg_file=\/usr\/local\/nagios\/etc\/objects\/contacts.cfg|cfg_file=${GIT_WORK_TREE}\/objects\/contacts.cfg|g" $GIT_WORK_TREE/nagios.cfg
sed -i "s|cfg_file=\/usr\/local\/nagios\/etc\/objects\/timeperiods.cfg|cfg_file=${GIT_WORK_TREE}\/objects\/timeperiods.cfg|g" $GIT_WORK_TREE/nagios.cfg
sed -i "s|cfg_file=\/usr\/local\/nagios\/etc\/objects\/templates.cfg|cfg_file=${GIT_WORK_TREE}\/objects\/templates.cfg|g" $GIT_WORK_TREE/nagios.cfg
sed -i "s|cfg_file=\/usr\/local\/nagios\/etc\/objects\/hosts.cfg|cfg_file=${GIT_WORK_TREE}\/objects\/hosts.cfg|g" $GIT_WORK_TREE/nagios.cfg
@dkhenry
dkhenry / deferred_data.php
Created June 27, 2012 15:06
SevOne deferred data example
<?php
/**
Program to upload data to SevOne using the Deferred Data API
@author DK (dkozlowski@sevone.com)
@version 0.1
@since 27-June-2012
*/
//! The Appliance IP
@jirutka
jirutka / install_osx.md
Last active March 6, 2022 09:07
How to install Cabot on OS X for development

How to install Cabot on OS X

This manual describes a complete procedure how to install and run Cabot on OS X for development. It was tested on OS X 10.9.1 and Cabot version 2014-01-23.

Important notes

We’re using Homebrew to install the required dependencies on OS X. If you don’t have Homebrew yet (how is that possible? ;), see http://brew.sh/ for an installation script. Note: MacPorts can be probably used too, but we didn’t test it.

Although you can use Python and Ruby that comes with OS X, it’s better to use Python installed via Homebrew and use rbenv to manage Rubies. Then you don’t need to use sudo and mess up your system. If you’re already using rvm instead of rbenv, then stay with it and skip the rbenv installation steps.

@Gromph
Gromph / gist:5f4db73b0f38775bc2f0
Last active September 9, 2019 19:55
Install Cabot on CentOS7 using uwsgi, nginx, and mysql
The Cabot quick start instructions are for auto installing on ubuntu using fabric, gunicorn, postgres.
I wanted to install manually on CentOS 7 running with uwsgi, nginx, mysql, and use our own mail server for
alerts instead of Amazon SES
These are my notes on how I did that.
These notes aren't a complete walkthrough, and a few steps may be missing or wrong, but I thought they might
be helpful anyways.
Setup
1. adduser www
passwd www
@aj-jester
aj-jester / sorted_json.rb
Last active January 18, 2018 12:39
Puppet parser function that takes unsorted hash and outputs sorted JSON object.
#
# LICENSE: https://gist.github.com/aj-jester/e0078c38db9eb7c1ef45
#
require 'json'
module JSON
class << self
@@loop = 0
def sorted_generate(obj)
@colinvh
colinvh / aws.md
Last active April 23, 2024 09:15
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@Cinderhaze
Cinderhaze / output
Created October 15, 2016 15:43
How to pretty-print hashes and arrays for puppet debugging
ubuntu@ubuntu:~$ puppet apply pretty.pp [12/46]
Notice: Scope(Class[main]): {one => 1, two => [dos, 2]}
Notice: Scope(Class[main]):
{
"one": "1",
"two": [
"dos",
"2"
]
}
@Dreyer
Dreyer / perlbrew_libgcc_s.txt
Created January 20, 2017 11:27
[perlbrew] ld: library not found for -lgcc_s.10.4
$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib