This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
IMAGE="image.bin" | |
DISK="coreos.vdi" | |
VM_NAME="CoreOS" | |
# Delete any existing VDI | |
rm -f $DISK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "coreos" | |
config.ssh.username = "core" | |
config.vm.synced_folder ".", "/vagrant", disabled: true | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results = {} | |
results[:tcp] = {} | |
results[:udp] = {} | |
Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\VMware, Inc.\VMnetLib\VMnetConfig') do |reg| | |
# Get each of the vmnets | |
reg.each_key do |vmnet| | |
reg.open(vmnet) do |vmnet_reg| | |
# If this network doesn't include the NAT key, we | |
# don't really care about it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a dead simple wrapper that can have setuid set on it so that | |
// the sudo helper is run as root. It is expected to run in the same CWD | |
// as the actual Ruby sudo helper. Any arguments to this script are forwarded | |
// to the Ruby sudo helper script. | |
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is just a sample of what the new networking syntax in | |
# Vagrant 1.1 can look like. | |
Vagrant.configure("2") do |config| | |
# ... | |
# High-level configurations that are portable across providers. | |
# Providers do a "best effort" to satisfy these. If they can't, | |
# they should warn and still try to come up. | |
config.vm.network :forwarded_port, 80, 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This is the script responsible for updating our Puppet master data, | |
# which includes modules, manifests, hiera data, etc. All of this data is | |
# managed in a git repository and upon "deploy" it is synced into the Puppet | |
# master. | |
# | |
# This script mirrors the remote git repository, looking for branches that | |
# match "env-*" (such as "env-production" or "env-test"). Each of these branches | |
# is setup as an environment into the Puppet master's data files. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "fiber" | |
module Middleware | |
# This is a basic runner for middleware stacks based on Ruby fibers. | |
# By using fibers rather than recursion, the stack is not deepened, and | |
# therefore cannot stack overflow. This allows middleware sequences of | |
# thousands to be used without crashing Ruby. | |
# | |
# This runner is much more complicated than the normal runner because it | |
# has to do a lot of work to _simulate_ a call stack. For example, one of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
### BEGIN INIT INFO | |
# Provides: postgresql-cluster-<%= @cluster_name %> | |
# Required-Start: $local_fs $remote_fs $network $time | |
# Required-Stop: $local_fs $remote_fs $network $time | |
# Should-Start: $syslog | |
# Should-Stop: $syslog | |
# Default-Start: 2 3 4 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Mixin | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def foo | |
puts "HELLO!" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONSTANT = "in <global>" | |
class Foo | |
CONSTANT = "in foo" | |
end | |
class Foo::Bar | |
puts CONSTANT # => "in <global>" | |
end |