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
| # Taken from passenger_memory_stats script | |
| # Returns the private dirty RSS for the given process, in KB. | |
| def determine_private_dirty_rss(pid) | |
| total = 0 | |
| File.read("/proc/#{pid}/smaps").split("\n").each do |line| | |
| line =~ /^(Private)_Dirty: +(\d+)/ | |
| if $2 | |
| total += $2.to_i | |
| 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
| upstream unicorn { | |
| server unix:/u/apps/something/shared/sockets/unicorn.sock; | |
| } | |
| server { | |
| listen 80; | |
| server_name something.com; | |
| access_log /u/apps/something/current/log/access.log main; | |
| error_log /u/apps/something/current/log/error.log error; |
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
| writeboards: | |
| enforce_writeboard_quota: | |
| you_must_upgrade_before_you_can_add_more_writeboards_to_this_project: "You must upgrade before you can add more writeboards to this project." |
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 'json' | |
| require 'bunny' | |
| class AMQPNotifierQueue | |
| def initialize(options = {}) | |
| @amqp = Bunny.new(options) | |
| @amqp.start | |
| @exchange = @amqp.exchange('rails', :type => :topic) | |
| @hostname = `hostname -s` |
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
| #if (NGX_HTTP_CACHE) | |
| { | |
| u_char *p, *last; | |
| ngx_int_t n; | |
| if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL) { | |
| return NGX_OK; | |
| } | |
| if (r->cache == NULL) { |
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
| name "cf-stream" | |
| description "CF Streaming API" | |
| recipes "rails::apps" | |
| default_attributes :active_groups => {:app => {:enabled => true}}, | |
| :active_applications => { "campfire" => { "env" => "production" }}, | |
| :rails => {:web_server => "nginx", :app_server => "thin"}, | |
| :sysctl => { | |
| :settings => { | |
| # General gigabit tuning: |
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 'thor' | |
| class Test < Thor | |
| class_options %w(password -p) => :required | |
| def initialize(*) | |
| super | |
| puts options.inspect | |
| 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
| #!/usr/bin/env ruby | |
| $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) | |
| require 'rubygems' | |
| require 'thor' | |
| require 'chef' | |
| require 'chef/node' | |
| require 'chef/role' | |
| require 'chef/data_bag' |
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
| if (-f $document_root/system/maintenance.html) { | |
| rewrite ^(.*)$ /system/maintenance.html last; | |
| break; | |
| } |
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
| location / { | |
| if ($request_method ~ ^OPTIONS|PROPFIND|REPORT$ ) { | |
| return 403; | |
| } | |
| try_files /system/maintenance.html $uri @backend; | |
| } | |
| location @backend { |