Skip to content

Instantly share code, notes, and snippets.

View apsoto's full-sized avatar

Alex Soto apsoto

  • San Francisco, CA
View GitHub Profile
@apsoto
apsoto / links.textile
Created November 5, 2011 02:23 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@apsoto
apsoto / ebs_raid.rb
Created November 11, 2011 05:25 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@apsoto
apsoto / gist:1364958
Created November 14, 2011 19:57
template example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Mustache Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="http://github.com/downloads/wycats/handlebars.js/handlebars.1.0.0.beta.3.js"></script>
<script id="some-template" type="text/x-handlebars-template">
<table>
@apsoto
apsoto / gist:1503758
Created December 20, 2011 23:18 — forked from jtimberman/gist:1040853
Ohai plugin to return semantic reference attributes for network addresses
require 'rubygems'
require 'ohai'
o = Ohai::System.new()
o.all_plugins
# And retrieve some useful semantic reference attributes for network interfaces
o['network']['interfaces'].each do |iface, addrs|
addrs['addresses'].each do |ip, params|
@apsoto
apsoto / autossh init.d
Created May 2, 2012 06:06 — forked from atr000/autossh init.d
launches and maintains uniquely named autossh tunnels alive
#! /bin/sh
#
# Author: Andreas Olsson <[email protected]>
# Version: @(#)autossh_tunnel.foo 0.1 27-Aug-2008 [email protected]
#
# For each tunnel; make a uniquely named copy of this template.
## SETTINGS
#
@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" )
@apsoto
apsoto / gist:5051014
Created February 27, 2013 19:42
chef-client run fail after rvm installed system wide via chef-rvm
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find chef (>= 0) amongst [bundler-1.2.4, foreman-0.61.0, rake-10.0.3, rubygems-bundler-1.1.0, rvm-1.11.3.6, thor-0.17.0] (Gem::LoadError)
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/bin/chef-client:22:in `<main>'
@apsoto
apsoto / series.json
Last active December 15, 2015 19:59
backbone.siren actions examples
{
"class": [
"series"
],
"properties": {
"id": 14,
"description": "GUNS & EXPLOSIVES",
"channelsRank": 0,
"pubDate": "2013-03-20T17:13:07Z",
@apsoto
apsoto / gist:5726877
Last active December 18, 2015 04:39 — forked from davist11/gist:1204569
Propane/Campfire sounds: /play ITEM
56k: "https://123.campfirenow.com/images/56k.gif"
bell: ":bell:"
bezos: ":laughing::thought_balloon:"
bueller: "anyone?"
clowntown: "https://123.campfirenow.com/images/clowntown.gif"
crickets: "hears crickets chirping"
dangerzone: "https://123.campfirenow.com/images/dangerzone.png"
danielsan: ":fireworks: :trophy: :fireworks:"
deeper: "https://123.campfirenow.com/images/top.gif"
drama: "https://123.campfirenow.com/images/drama.jpg"
@apsoto
apsoto / bundle_no_ref.json
Created July 26, 2013 00:27
JSON sample validation
{
"$schema" : "http://json-schema.org/draft-04/schema#",
"type" : "object",
"properties" : {
"class" : {
"type" : "array",
"items" : {
"type" : "integer"
}
}