This file contains 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 self.cap_remote_run(server, cmd, ssh_key, user, logger = nil) | |
config = ::Capistrano::Configuration.new | |
config.role :app, server | |
config.set :user, user | |
config.default_run_options[:pty] = true | |
config.ssh_options[:strict_host_key_checking] = 'no' | |
config.ssh_options[:keys] = ssh_key | |
config.logger = logger unless logger.nil? | |
config.run cmd | |
end |
This file contains 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 is_authorized?(security_group, port) | |
return security_group.ip_permissions.detect do |ip_permission| | |
ip_permission['ipRanges'].first && ip_permission['ipRanges'].first['cidrIp'] == '0.0.0.0/0' && | |
ip_permission['fromPort'] == port && | |
ip_permission['ipProtocol'] == 'tcp' && | |
ip_permission['toPort'] == port | |
end | |
end |
This file contains 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
<a href="http://www.cloud66.com"><img src="http://cdn.cloud66.com/images/powered-by-cloud66.png" title="Powered by Cloud 66"/></a> |
This file contains 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
Handlebars.registerHelper('equal', function(lvalue, rvalue, options) { | |
if (arguments.length < 3) | |
throw new Error("Handlebars Helper equal needs 2 parameters"); | |
if( lvalue!=rvalue ) { | |
return options.inverse(this); | |
} else { | |
return options.fn(this); | |
} | |
}); |
This file contains 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 'oauth2' | |
require 'json' | |
base = 'https://www.cloud66.com' | |
api_url = 'https://www.cloud66.com/api/2' | |
if File.exists? '/tmp/cloud66_oauth_test.json' | |
config = JSON.parse(File.read('/tmp/cloud66_oauth_test.json')) | |
client = OAuth2::Client.new(config['app_id'], config['app_secret'], :site => base) |
This file contains 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
echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list | |
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add - | |
apt-get update | |
apt-get install newrelic-sysmond | |
nrsysmond-config --set license_key=YOUR_LICENSE_KEY | |
/etc/init.d/newrelic-sysmond start |
This file contains 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
class Dashing.TflStatus extends Dashing.Widget |
This file contains 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 'oauth2' | |
require 'json' | |
base = 'https://www.cloud66.com' | |
api_url = 'https://www.cloud66.com/api/2' | |
if File.exists? '/tmp/cloud66_oauth_test.json' | |
config = JSON.parse(File.read('/tmp/cloud66_oauth_test.json')) | |
client = OAuth2::Client.new(config['app_id'], config['app_secret'], :site => base) |
This file contains 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
global | |
maxconn 4096 | |
user haproxy | |
group haproxy | |
daemon | |
defaults | |
option dontlognull | |
retries 3 | |
option redispatch |
This file contains 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 | |
# reset.fw - Reset firewall | |
# set x to 0 - No reset | |
# set x to 1 - Reset firewall | |
# --------------------------------------------------------------------------------------------------------------- | |
# Added support for IPV6 Firewall | |
# --------------------------------------------------------------------------------------------------------------- | |
# Written by Vivek Gite <vivek@nixcraft.com> | |
# --------------------------------------------------------------------------------------------------------------- | |
# You can copy / paste / redistribute this script under GPL version 2.0 or above |