Skip to content

Instantly share code, notes, and snippets.

View rafaelfelix's full-sized avatar

Rafael Felix Correa rafaelfelix

View GitHub Profile
@arthurgeek
arthurgeek / coreos-stable-hvm-vpc.template
Created December 28, 2015 13:26
CoreOS CloudFormation Template for VPC
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-ffafb293"
},
"ap-northeast-1" : {
"AMI" : "ami-dae8c1b4"
@zarmstrong
zarmstrong / ec2tags.rb
Last active July 4, 2016 19:03 — forked from drohr/ec2tags.rb
replaces spaces with pipes to take into account non-word (\w) characters in key or value.
require 'facter'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
tags = Facter::Util::Resolution.exec("ec2dtag --filter \"resource-id=#{instance_id}\" --region #{region} | cut -f 4-|awk 'BEGIN{FS=\" \";OFS=\"|\"} {$1=$1; print $0}'")
tags.scan(/(.*)\|+(.*)/) do |key, value|
fact = "ec2_tag_#{key}"
Facter.add(fact) { setcode { value } }
end
@jpetazzo
jpetazzo / gist:6127116
Created July 31, 2013 23:21
Debian/Ubuntu containers protips, thanks to @spahl
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
@drohr
drohr / ec2tags.rb
Created February 27, 2013 15:29
Hack to get ec2 tags to facter.
require 'facter'
instance_id = Facter::Util::Resolution.exec("ec2-metadata -i | awk '{print $2}'")
tags = Facter::Util::Resolution.exec("ec2-describe-tags --region eu-west-1 --filter \"resource-id=#{instance_id}\" | cut -f 4-")
tags.scan(/(\w+)\s+(\w+)/) do |key, value|
fact = "ec2_tag_#{key}"
Facter.add(fact) { setcode { value } }
end
@rafaelfelix
rafaelfelix / pear.rb
Created December 27, 2011 19:23 — forked from jakemcgraw/pear.rb
Puppet PHP Pear provider
# Puppet PHP PEAR Package support
# Taken from https://raw.github.com/gist/1524864/fdd8fd047aa702587c0b7cce7a77d55dbd781f01/pear.rb
require 'puppet/provider/package'
# PHP PEAR support.
Puppet::Type.type(:package).provide :pear, :parent => Puppet::Provider::Package do
desc "PHP PEAR support. By default uses the installed channels, but you
can specify the path to a pear package via ``source``."
@jakemcgraw
jakemcgraw / pear.rb
Created February 16, 2010 18:40
Puppet PHP Pear provider
We couldn’t find that file to show.