Skip to content

Instantly share code, notes, and snippets.

View druchoo's full-sized avatar

Andrew Choo druchoo

  • Vonage
  • NC
  • 09:09 (UTC -04:00)
View GitHub Profile
@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
@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)
@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
@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"
]
}
@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.

@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
@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
@atyachin
atyachin / aws_regions.json
Created September 29, 2020 19:08
AWS Regions / Datacenters Geo Locations
[
{
"code": "us-east-1",
"region": "US East",
"city": "Virginia",
"lat": 38.9940541,
"long": -77.4524237,
"country": "US"
},
{
@ChrisTollefson
ChrisTollefson / 0 GitHub Markup Reference README.md
Last active February 12, 2024 20:21
GitHub Markup Reference

GitHub Markup Reference

GitHub supports a number of

@ferdnyc
ferdnyc / rar2zip.sh
Last active April 4, 2024 18:48
Conversion from rar to zip
#!/bin/bash
#
# rar2zip conversion script
# Based on: https://shkspr.mobi/blog/2016/12/converting-rar-to-zip-in-linux/
#
# Usage: rar2zip.sh file [file ...]
echo "Converting RARs to ZIPs"
# Use RAM disk for temporary files.