SSH into your EC2 instance. Run the following:
$ sudo yum install gcc
This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
#!/bin/bash | |
cat $(find app/assets/stylesheets/ -type f) | | |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// | | |
while read CSS; do | |
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then | |
echo $CSS >> unused.scss; | |
fi | |
done |
module Concerns | |
module AasmStateEvent | |
extend ActiveSupport::Concern | |
included do | |
attr_accessor :state_event | |
end | |
# It behaves just like `save!`, but when `state_event` was set through | |
# `assign_attributes` before, `save!` uses the given state with a `!` to |
#!/usr/bin/env bash | |
# | |
# Rails console script that can be run on AWS Elastic Beanstalk. | |
# | |
# Run this script from the app dir (/var/app/current) as root (sudo script/aws-console) | |
# | |
set -xe | |
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) |
# Sidekiq interaction and startup script | |
commands: | |
create_post_dir: | |
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
mode: "000755" | |
owner: root | |
group: root |
#!/bin/bash | |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
SSH into your EC2 instance. Run the following:
$ sudo yum install gcc
This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
# Install Git needed for Git based gems | |
packages: | |
yum: | |
git: [] | |
module LiquidPresenters | |
class Plan < SimpleDelegator | |
def to_liquid | |
@to_liquid ||= HashWithIndifferentAccess.new({ | |
id: self.id, | |
name: self.name, | |
description: self.description, | |
status: self.status, | |
class_id: self.plan_class_id | |
}) |
module RailsAppName | |
class Application < Rails::Application | |
# .... your settings | |
require "#{Rails.root}/lib/cloud_flare_middleware" | |
config.middleware.insert_before(0, Rack::CloudFlareMiddleware) | |
# ... your settings | |
end | |
end |