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 | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title passenger status | |
graph_vlabel count | |
sessions.label sessions | |
max.label max processes |
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 | |
# put in /etc/munin/plugins and restart munin-node | |
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin | |
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title Passenger memory stats | |
graph_vlabel count |
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
mix :default | |
mix :utils, :users, :rails, :munin, :monit, :sudoers, :sphinx, :mailserver, :red5 | |
DOMAIN = "example.com" | |
NAME = "production" | |
base_domain DOMAIN | |
base_email "admin" | |
AUTHORIZED = %w/vitaly@sirius-id_dsa.pub/ |
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
{ | |
"test": 123 | |
} |
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 -e | |
MIN_MAJOR=9 | |
MIN_MINOR=4 | |
function banner() | |
{ | |
cat <<_ | |
Bootstraping blender... | |
Date: `date` |
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
ActionController::Routing::Routes.draw do |map| | |
map.resource :account, :except => :destroy | |
map.resources :password_resets, :only => [:new, :create, :edit, :update] | |
map.resources :users | |
map.resource :user_session, :only => [:new, :create, :destroy] | |
map.login 'login', :controller => "user_sessions", :action => "new" | |
map.logout 'logout', :controller => "user_sessions", :action => "destroy" | |
map.register 'register', :controller => "accounts", :action => "new" | |
map.root :controller => "pages", :action => "home" | |
map.pages 'pages/:action', :controller => "pages" |
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
class UsersController < ApplicationController | |
before_filter :require_no_user, :only => [:new, :create] | |
before_filter :require_user, :only => [:show, :edit, :update] | |
before_filter :admin_required, :only => [:index, :destroy] | |
def index | |
@users = User.all | |
@page_title = "All Users" | |
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
class AccountsController < ApplicationController | |
before_filter :require_no_user, :only => [:new, :create] | |
before_filter :require_user, :only => [:show, :edit, :update] | |
def new | |
@user = User.new | |
@page_title = "Create Account" | |
render :template => "users/new" | |
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
>> class Configuration | |
>> def self.files | |
>> @@files ||= Array.new | |
>> end | |
>> def self.inspect | |
>> @@files.inspect | |
>> end | |
>> end | |
=> nil | |
>> Configuration.files << 1 |
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 ($mystat{'Created_tmp_tables'} > 0) { | |
if ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} < 256*1024*1024) { | |
badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_disk_tables'} + $mystat{'Created_tmp_tables'})." total)\n"; | |
push(@adjvars,"tmp_table_size (> ".hr_bytes_rnd($myvar{'tmp_table_size'}).")"); | |
push(@adjvars,"max_heap_table_size (> ".hr_bytes_rnd($myvar{'max_heap_table_size'}).")"); | |
push(@generalrec,"When making adjustments, make tmp_table_size/max_heap_table_size equal"); | |
push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses"); | |
} elsif ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} >= 256) { | |
badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_disk_tables'} + $mystat{'Created_tmp_tables'})." total)\n"; | |
push(@genera |