Skip to content

Instantly share code, notes, and snippets.

@obazoud
obazoud / Gateway.java
Last active August 29, 2015 14:01
Reactor questions
public class Gateway {
TcpClient<String, String> client = null;
NetChannel<String, String> channel;
public Gateway(String host, int port) {
client = new TcpClientSpec<String, String>(NettyTcpClient.class)
.env(env)
.codec(StandardCodecs.STRING_CODEC)
.connect(host, port)
.get();
@obazoud
obazoud / export.json
Created April 28, 2014 14:55
Zabbix Json
{
hosts: [
{
checks_enabled: "1",
display_name: "xxx",
name: "xxx",
num_services: "19",
num_services_crit: "0",
num_services_ok: "19",
num_services_pending: "0",
#!/usr/bin/env node
/* -*- js2 -*- */
/* ************************************************************* */
// Set up classes to support Range objects. Ported from
// Nagios::Plugin::Range. See named functions below.
// TODO: Modularize properly/idiomatically.
/*
* Represents a Nagios plugin range object.

This gist contains everything you need to install StatsD and Graphite on CentOS 6.3. Unless I forgot something. If I did, shoot a reminder email to noah at one more bug dot com. tl;dr: womm, ymmv, yolo.

I (mostly) followed the steps shown in the EZUnix wiki

And I also referred back to this gist by Michael Grace

@obazoud
obazoud / Dockerfile
Last active August 29, 2015 13:57
Docker image Chef - CentOS
FROM centos:6.4
RUN curl -L https://www.opscode.com/chef/install.sh | bash
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients curl
RUN sed -i '/requiretty/c\# Defaults requiretty' /etc/sudoers
@obazoud
obazoud / Berksfile
Created March 23, 2014 21:20
berkshelf hangs 100% CPU
# -*- mode: ruby; coding: utf-8; -*-
source "http://api.berkshelf.com"
# Official Opscode cookbooks / Community
cookbook 'apt', git: 'https://github.com/opscode-cookbooks/apt.git', tag: 'v2.3.8'
cookbook 'ark', git: 'https://github.com/opscode-cookbooks/ark.git', tag: 'v0.7.0'
cookbook 'build-essential', git: 'https://github.com/opscode-cookbooks/build-essential.git', tag: 'v2.0.0'
cookbook 'chef-client', git: 'https://github.com/opscode-cookbooks/chef-client.git', tag: 'v3.2.0'
cookbook 'chef_handler', git: 'https://github.com/opscode-cookbooks/chef_handler.git', tag: 'v1.1.5'
vagrant@vagrant-vm:~$ sudo chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json
vagrant@vagrant-vm:~$ sudo chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json --why-run > /tmp/why-run.out
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++
# Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.0.tar.gz
tar zxvf collectd-5.4.0.tar.gz
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM