Skip to content

Instantly share code, notes, and snippets.

View rnaveiras's full-sized avatar

Raúl Naveiras rnaveiras

  • London, United Kingdom
  • 19:35 (UTC +01:00)
View GitHub Profile
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
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
input {
syslog {
type => "haproxy-access"
port => 514
}
}
filter {
grok {
type => "haproxy-access"
{
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect": "Allow",
"Resource": [
@rnaveiras
rnaveiras / rollbar.rb
Last active August 29, 2015 14:05 — forked from brianr/rollbar.rb
# 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
namespace :common do
task :restart, :roles => :web do
puts "Nooooo"
end
end
namespace :workers do
task :restart, :roles => :workers do
puts "nooooo"
end
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,
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!"
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
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