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 Dir | |
def empty? | |
Dir.glob("#{ path }/*", File::FNM_DOTMATCH) do |e| | |
return false unless %w( . .. ).include?(File::basename(e)) | |
end | |
return true | |
end | |
def self.empty? path | |
new(path).empty? | |
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
[default] [Fri, 19 Aug 2011 08:53:20 +0000] INFO: Processing execute[rvm-cleanup] action nothing (rvm::default line 19) | |
: stdout | |
[default] [Fri, 19 Aug 2011 08:53:20 +0000] INFO: Processing bash[installing system-wide RVM stable] action run (rvm::default line 25) | |
: stdout | |
[default] [Fri, 19 Aug 2011 08:53:20 +0000] INFO: Processing bash[upgrading to RVM head] action run (rvm::default line 31) | |
: stdout | |
[default] [Fri, 19 Aug 2011 08:53:20 +0000] INFO: Processing bash[upgrading RVM stable] action run (rvm::default line 38) | |
: stdout | |
[default] [Fri, 19 Aug 2011 08:53:20 +0000] INFO: Processing cookbook_file[/usr/local/bin/rvm-gem.sh] action create (rvm::default line 50) | |
: stdout |
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
# Install all the packages required for using ruby on rails in cygwin | |
# Cygwin is a Linux-like environment for MS Windows. | |
# Download the Cygwin setup.exe from http://www.cygwin.com/setup.exe | |
# Few packages name and description | |
# inetutils # telnet(1) | |
# ncurses # see Terminator FAQ | |
# openssh # SSH (client and server, though the server's not so great) |
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
/Users/millisami/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 52 column 11 (Psych::SyntaxError) | |
from /Users/millisami/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:148:in `parse_stream' | |
from /Users/millisami/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:119:in `parse' | |
from /Users/millisami/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:106:in `load' | |
from /Users/millisami/rubygems/cloud_factory_ruby/lib/cf/cli/line_yaml_validator.rb:6:in `validate' | |
from /Users/millisami/rubygems/cloud_factory_ruby/lib/cf/cli/line.rb:128:in `create' | |
from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/task.rb:22:in `run' | |
from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task' | |
from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch' | |
from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation |
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 'httparty' | |
require 'active_support' | |
# require 'httplog' | |
module Linode | |
class Nodebalancer | |
include HTTParty | |
base_uri 'https://api.linode.com' |
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
# Copyright (c) 2010 Tech-Angels | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the | |
# Software is furnished to do so, subject to the following | |
# conditions: |
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
PID_DIR = '/srv/myapp/shared/pids' | |
RAILS_ENV = ENV['RAILS_ENV'] = 'production' | |
RAILS_ROOT = ENV['RAILS_ROOT'] = '/srv/myapp/current' | |
BIN_PATH = "/home/rails/.rvm/gems/ree-1.8.7-2010.02/bin" | |
God.log_file = "#{RAILS_ROOT}/log/god.log" | |
God.log_level = :info | |
%w(unicorn resque).each do |config| | |
God.load "#{RAILS_ROOT}/config/god/#{config}.god" |
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 'mail' | |
class EmailValidator < ActiveModel::EachValidator | |
attr_reader :record, :attribute, :value, :email, :tree | |
def validate_each(record, attribute, value) | |
@record, @attribute, @value = record, attribute, value | |
@email = Mail::Address.new(value) | |
@tree = email.__send__(:tree) |
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
$ sudo cat /etc/sudoers | |
[sudo] password for deploy: | |
# /etc/sudoers | |
# | |
# This file MUST be edited with the 'visudo' command as root. | |
# | |
# See the man page for details on how to write a sudoers file. | |
# | |
Defaults env_reset |
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 python | |
# webkit2png - makes screenshots of webpages | |
# http://www.paulhammond.org/webkit2png | |
__version__ = "0.5" | |
# Copyright (c) 2009 Paul Hammond | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy |