Skip to content

Instantly share code, notes, and snippets.

#Get pip:
yum -y install python-pip
#Install pyzabbix:
pip install pyzabbix
@lukedemi
lukedemi / gist:7884896
Created December 10, 2013 02:32
Vagrant 1.4.0 Error
INFO global: Vagrant version: 1.4.0
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/help/plugin.rb
@lukedemi
lukedemi / gist:7885325
Created December 10, 2013 03:29
Install Open vSwitch and Xen on CentOS 6.4
# Install Centos 6.4 Minimal (for this gist I used an iLO virtual media, not a kickstart file)
# Change Hostname
vi /etc/sysconfig/network
# Edit eth0 to get ssh and network access to the box
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.9.2.32
start on filesystem and started docker
stop on runlevel [!2345]
respawn
chdir /location/of/fig
script
FILE=/var/run/docker.sock
while [ ! -e $FILE ] ; do
Nov 04 15:21:50 ip-10-21-1-206.ec2.internal bash[5540]: The push refers to a repository [10.21.1.206:5000/deis/slugrunner] (len: 1)
Nov 04 15:21:50 ip-10-21-1-206.ec2.internal bash[5540]: Sending image list
Nov 04 15:21:50 ip-10-21-1-206.ec2.internal bash[5540]: Pushing repository 10.21.1.206:5000/deis/slugrunner (1 tags)
Nov 04 15:21:50 ip-10-21-1-206.ec2.internal bash[5540]: Image 511136ea3c5a already pushed, skipping
Nov 04 15:21:51 ip-10-21-1-206.ec2.internal bash[5540]: Image 4fc3518d6f35 already pushed, skipping
Nov 04 15:21:51 ip-10-21-1-206.ec2.internal bash[5540]: Image fb8e2f5f8a6c already pushed, skipping
Nov 04 15:21:51 ip-10-21-1-206.ec2.internal bash[5540]: Image 2f651070bd84 already pushed, skipping
Nov 04 15:21:52 ip-10-21-1-206.ec2.internal bash[5540]: Image 4952f4d06428 already pushed, skipping
Nov 04 15:21:52 ip-10-21-1-206.ec2.internal bash[5540]: Image be3222d80b80 already pushed, skipping
Nov 04 15:21:52 ip-10-21-1-206.ec2.internal bash[5540]: Image 735b326a5714 already pushed, skipping
@lukedemi
lukedemi / gist:a5cbbb851b2a49e084a7
Created November 4, 2014 22:18
etcdctl recursive
/deis/platform
/deis/platform/domain
/deis/platform/version
/deis/router
/deis/router/gzip
/deis/router/hosts
/deis/router/hosts/10.21.2.218
/deis/router/hosts/10.21.1.206
/deis/services
/deis/services/newish-tailbone
Nov 04 22:27:03 ip-10-21-1-206.ec2.internal sh[3861]: 10.21.2.218 - - [04/Nov/2014:22:27:03 +0000] "GET /v1/repositories/lonely-quotient/images HTTP/1.1" 200 1748 "-" "docker/1.3.0 go/go1.3.2 git-commit/c78088f kernel/3.16.2+ os/linux arch/amd64"
Nov 04 22:27:03 ip-10-21-1-206.ec2.internal sh[3861]: 10.21.2.218 - - [04/Nov/2014:22:27:03 +0000] "GET /v1/repositories/library/taller-handbill/tags HTTP/1.1" 200 474 "-" "docker/1.3.0 go/go1.3.2 git-commit/c78088f kernel/3.16.2+ os/linux arch/amd64"
Nov 04 22:27:04 ip-10-21-1-206.ec2.internal sh[3861]: 10.21.2.218 - - [04/Nov/2014:22:27:04 +0000] "GET /v1/repositories/library/lonely-quotient/tags HTTP/1.1" 200 158 "-" "docker/1.3.0 go/go1.3.2 git-commit/c78088f kernel/3.16.2+ os/linux arch/amd64"
Nov 04 22:27:04 ip-10-21-1-206.ec2.internal sh[3861]: 10.21.2.218 - - [04/Nov/2014:22:27:04 +0000] "GET /v1/images/10038695a0264b9e9196a8861d3626da10038695a0264b9e9196a8861d3626da/ancestry HTTP/1.1" 200 1632 "-" "docker/1.3.0 go/go1.3.2 git-commit/c78088f kernel/3.16.2+ os
class GeoEngineer::Project
after :initialize, :setup_default_tags
def setup_default_tags
defaults = {
org: org,
ProjectName: name
}
self.tags = GeoEngineer::SubResource.new(self, 'tags') unless self.tags
defaults.each do |key, value|
class GeoEngineer::Resource
validate -> { validate_has_tag(:Name) if support_tags? }
validate -> { validate_has_tag(:ProjectName) if self.project? && support_tags? }
validate :validate_project_name_correct
def validate_project_name_correct
bad_name = support_tags? && self.project && tags['ProjectName'] != self.project.full_name
"ProjectName tag should equal \"#{project.full_name}\" for resource \"#{type}.#{id}\"" if bad_name
end
def validate_statement_ip_restrictions(statement)
errors = []
if statement.ip_restrictions.empty?
errors << "IPAddress Condition aws:SourceIP must contain cidr blocks"
else
for cidr_block in statement.ip_restrictions
if !valid_cidr?(cidr_block)
errors << "#{cidr_block} is not included in the valid_cidr array for this environment"
end