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" )
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@archagon
archagon / playlist-to-podcast.py
Created September 28, 2012 07:03
A script that downloads videos from YouTube playlists, extracts their audio, and only downloads missing files each time it's run. Also generates an iTunes-compliant podcast xml file for private hosting purposes. Requires youtube-dl, ffmpeg, and ffprobe.
# YouTube playlist audio retreiver and iTunes-compliant podcast XML generation tool.
# This script will download each video file from the specified YouTube playlist, losslessly extract
# the audio, delete the video, and ultimately produce an iTunes-compliant podcast XML with the
# appropriate metadata, including chapter markers (if provided in the description). If you run the
# script again, only videos that haven't already been converted will be downloaded, allowing you to
# schedule the script to run as often as needed without stressing your internet connection or
# hard drive space. After generating the files and xml, you can easily host them on a local server
# in order to use them with iTunes or your favorite podcast aggregator -- but that's beyond this
# script's jurisdiction.
@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] }]
@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

<!-- 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>
@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
@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
@acolyer
acolyer / service-checklist.md
Last active January 30, 2024 17:39
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866