Skip to content

Instantly share code, notes, and snippets.

@apsoto
apsoto / gist:2869888
Created June 4, 2012 18:00
Diagram Showing EC2 Security Group Data Flows
require 'rubygems'
require 'activesupport'
require 'aws'
require 'graphviz'
ec2 = Aws::Ec2.new(ENV["AMAZON_ACCESS_KEY_ID"], ENV["AMAZON_SECRET_ACCESS_KEY"])
g = ec2.describe_security_groups
gv = GraphViz::new( "structs", "type" => "graph" )
@dcarley
dcarley / gist:3811003
Created October 1, 2012 11:11 — forked from apsoto/gist:2869888
Diagram Showing EC2 Security Group Data Flows
#!/usr/bin/env ruby
require 'fog'
require 'graphviz'
ec2 = Fog::Compute.new(:provider => 'AWS')
graph = GraphViz::new("structs", "type" => "graph")
groups = ec2.security_groups
group_map = Hash[groups.collect { |g| [g.group_id, g.name] }]
@dhoer
dhoer / deps.rb
Created December 12, 2013 18:19
Adds version info to knife deps output. Kudos to bjbishop for providing this hack.
require 'chef/chef_fs/knife'
class Chef
class Knife
class Deps < Chef::ChefFS::Knife
banner "knife deps PATTERN1 [PATTERNn]"
category "path-based"
deps do
<!-- note that this requires the rabbitmq management plugin -->
<!-- also requires collectd 5.1 with curl_json plugin support -->
<Plugin curl_json>
<URL "http://localhost:55672/api/overview">
Instance "rabbitmq_overview"
User "guest"
Password "guest"
<Key "message_stats/publish">
Type "counter"
</Key>
@csabapalfi
csabapalfi / awesome-histograms.md
Last active December 31, 2018 04:32
awesome histograms
require 'gsl'
require 'time'
module Diskalerter
class ThresholdEstimator
attr_reader :timestamps, :signal, :threshold, :now
# timestamps - a list of timestamps in epoch milliseconds
# signal - a list of values for the provided timestamps
# threshold - the "exhaustion" threshold (e.g., 100 for a percentage signal)
@lost-theory
lost-theory / 01_intro.md
Last active March 26, 2019 15:52
Monitorama 2014 notes

Monitorama 2014 notes

http://monitorama.com/

Best talks day 1:

  • Please, no More Minutes, Milliseconds, Monoliths... or Monitoring Tools! - Adrian Cockcroft
    • gave 5 good rules for monitoring systems, showed what cloud / microservices monitoring looks like @ Netflix
  • Simple math to get some signal out of your noisy sea of data - Toufic Boubez
  • explains why static alert thresholds don't work and gave 3 techniques to use instead
@gmr
gmr / README.md
Last active April 12, 2020 22:06
Chef + Cobbler Integration files

Note: These work for us with Cobbler 2.2.3 and Chef 11.4.0 on CentOS

Quick Install

These are our install steps on CentOS 6:

mkdir -p ~/.chef/plugins/knife/
curl -o ~/.chef/plugins/knife/set_environment.rb https://gist.github.com/gmr/5339326/raw/5bd498d25bc2f4d17f029cdc4a34ed38e461fec2/set_environment.rb
curl -o /usr/lib/python2.6/site-packages/cobbler/modules/install_pre_chef.py https://gist.github.com/gmr/5339326/raw/0b248a8b40e5bac5673bd7df7cfd60185af778bc/install_pre_chef.py

curl -o /usr/lib/python2.6/site-packages/cobbler/modules/delete_post_chef.py https://gist.github.com/gmr/5339326/raw/ae71362ae721c0391f0be2f4b2166f3806e90a91/delete_post_chef.py

@nf
nf / nofrils-adg.vim
Created December 6, 2016 02:29
adg's modified nofrils vim color scheme
" Name: modified nofrils
" Author: adg
" URL: based on https://github.com/robertmeta/nofrils
" (see this url for latest release & screenshots)
" License: OSI approved MIT license
" Modified: 2016 Feb 26
hi clear
if exists("syntax_on")
syntax reset
@lusis
lusis / README.md
Last active September 14, 2020 17:47
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.