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
build_package_reconfigure() { | |
test -f configure || autoconf | |
} | |
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/01-current-2.1.1-fixes.patch | |
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/02-zero-broken-tests.patch | |
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/03-improve-gc-stats.patch |
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
company = Company.find_by_name 'BT TV' | |
exit(0) unless company | |
ActiveRecord::Base.transaction do | |
User.current = company.users.find_by_login('bebanjo_btvision') | |
tmt = company.titles_metadata_template |
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
input { | |
syslog { | |
type => "haproxy-access" | |
port => 514 | |
} | |
} | |
filter { | |
grok { | |
type => "haproxy-access" |
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
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"route53:ChangeResourceRecordSets", | |
"route53:GetHostedZone", | |
"route53:ListResourceRecordSets" | |
], | |
"Effect": "Allow", | |
"Resource": [ |
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
# put all of this in config/initializers/rollbar.rb | |
# from http://hawkins.io/2013/08/using-the-ruby-logger/ | |
class NullLogger < Logger | |
def initialize(*args) | |
end | |
def add(*args, &block) | |
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
namespace :common do | |
task :restart, :roles => :web do | |
puts "Nooooo" | |
end | |
end | |
namespace :workers do | |
task :restart, :roles => :workers do | |
puts "nooooo" | |
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
require 'aws-sdk' | |
AWS.config(:credential_provider => AWS::Core::CredentialProviders::SharedCredentialFileProvider.new) | |
aws = AWS.regions['eu-west-1'] | |
lc = aws.auto_scaling.launch_configurations | |
launch_config = lc.create('staging-loadbalancer', 'ami-XXXXX', 'm1.small', { | |
detailed_instance_monitoring: true, |
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
let's make a list of sinatra-based apps! | |
apps: | |
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com" | |
- http://github.com/rtomayko/wink "minimalist blogging engine" | |
- http://github.com/foca/integrity "The easy and fun Continuous Integration server" | |
- http://github.com/sr/git-wiki "git-powered wiki" | |
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits." | |
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>. See in action @ www.restafari.org" | |
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!" |
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
module ActiveSupport | |
module DependencyModule | |
def append_features(base) | |
return if base < self | |
(@_dependencies ||= []).each { |dep| base.send(:include, dep) } | |
super | |
base.extend const_get("ClassMethods") if const_defined?("ClassMethods") | |
base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block") | |
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
require 'net/pop' | |
require File.dirname(__FILE__) + '/../config/environment' | |
logger = RAILS_DEFAULT_LOGGER | |
logger.info "Running Mail Importer..." | |
Net::POP3.start("mail.server.net", nil, "username", "password") do |pop| | |
if pop.mails.empty? | |
logger.info "NO MAIL" | |
else |
OlderNewer