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 StringToBoolean | |
def to_bool | |
return true if self == true || self =~ (/^(true|t|yes|y|1)$/i) | |
return false if self == false || self.blank? || self =~ (/^(false|f|no|n|0)$/i) | |
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") | |
end | |
end | |
class String; include StringToBoolean; 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
# Run with: rake environment elasticsearch:reindex | |
# Begins by creating the index using tire:import command. This will create the "official" index name, e.g. "person" each time. | |
# Then we rename it to, e.g. "person20121001" and alias "person" to it. | |
namespace :elasticsearch do | |
desc "re-index elasticsearch" | |
task :reindex => :environment do | |
klasses = [Place, Person, Caption] |
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
$ aws opsworks describe-stacks | |
{ | |
"Stacks": [ | |
{ | |
"ServiceRoleArn": "arn:aws:iam::047170177871:role/aws-opsworks-service-role", | |
"StackId": "575e1389-1df3-427d-99d3-d60f89a41442", | |
"DefaultRootDeviceType": "ebs", | |
"Name": "rhenning_test", | |
"ConfigurationManager": { | |
"Version": "11.4", |
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 this in /etc/logrotate.d/mongodb | |
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth | |
/log/*.log { | |
daily | |
rotate 30 | |
compress | |
dateext | |
missingok | |
notifempty |