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
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
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 Bluepill | |
module ProcessConditions | |
class ProcMemUsage < MemUsage | |
def run(pid) | |
begin | |
total = 0 | |
File.read("/proc/#{pid}/smaps").split("\n").each do |line| | |
line =~ /^(Private)_Dirty: +(\d+)/ | |
if $2 | |
total += $2.to_i |
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
# cookbooks/chef/attributes/chef.rb | |
set_unless[:chef][:log_location] = "STDOUT" | |
set_unless[:chef][:log_level] = "info" | |
set_unless[:chef][:url_type] = "http" | |
set_unless[:chef][:server_fqdn] = "your-chef-server" | |
set_unless[:chef][:server_port] = "4000" | |
set_unless[:chef][:validation_client_name] = "chef-validator" | |
set_unless[:chef][:cache_path] = "/var/cache/chef" |
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
Feature: Advanced scripting | |
As a My script writer | |
I want to nest tasks inside of questions | |
So I can respond dynamically to the user's needs | |
@aruba_interactive | |
Scenario: Nesting questions | |
Given a file named "yes.template" with: | |
""" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Border Image Test</title> | |
<style type="text/css"> | |
#slider { | |
/*This shows how to use border-image to mimic the behavior | |
of stretchableImageWithLeftCapWidth:topCapHeight: in CSS. | |
This example has a border-left and border-right width of 15px. |
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 'rubygems' | |
require 'mongo' | |
module MongoPubSub | |
QUEUES_COLLECTION = 'queues' | |
class EndSubscriptionException < Exception; end | |
class Publisher | |
def initialize(queue_name, mongo_connection) | |
# Initialize queue collection as a capped collection | |
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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
def compare_to(version) | |
reject_fields = ["_id", "updated_at", "version"] | |
diff_array = self.versions[version-1].attributes.to_hash.to_a - self.attributes.to_hash.to_a | |
diff_array.delete_if {|f| reject_fields.include?(f.first) } | |
Hash[diff_array] | |
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
#!/bin/bash | |
# Setup script designed to get a Ubuntu 10.4 LTS server | |
# up and running with secure defaults. | |
# Documentation for StackScripts | |
# is pretty sparse: see http://www.linode.com/stackscripts/ | |
# User-inputted values for new Linode | |
# <UDF name="user_hostname" Label="Hostname for new Linode" /> |
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
# Based on half of https://s3.amazonaws.com/cloudformation-templates-us-east-1/WordPress-1.0.0.template | |
# Methods beginning with a lowercase letter are 'native' and have special behaviour. | |
# Methods beginning with an uppercase letter get literally transformed into JSON | |
templates do | |
Alarm do | |
EvaluationPeriods 1 | |
Statistic 'Average' | |
Period 60 | |
AlarmActions: ref('AlarmTopic') |
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
God.watch do |w| | |
w.name = "mysqld" | |
w.interval = 30.seconds # default | |
w.start = "service mysql start" | |
w.stop = "service mysql stop" | |
w.restart = "service mysql restart" | |
w.start_grace = 20.seconds | |
w.restart_grace = 20.seconds | |
w.pid_file = "/var/lib/mysql/hostname.pid" | |
OlderNewer