Skip to content

Instantly share code, notes, and snippets.

joe1chen

Block or report user

Report or block joe1chen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mongodb
# 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
View opsworks_blue_green_deploy_test_long_version
$ 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",
View elasticsearch.rake
# 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]
@joe1chen
joe1chen / string_boolean.rb
Created Nov 21, 2012 — forked from equivalent/string_boolean.rb
String "false" to_bool ... or how to convert Rails/SimpleForm radio buttons to boolean
View string_boolean.rb
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
You can’t perform that action at this time.