The following error appeared upon upgrading JRuby:
OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format
| variable "aws_region" { | |
| default = "eu-west-1" | |
| } | |
| variable "domain" { | |
| default = "my_domain" | |
| } | |
| provider "aws" { | |
| region = "${var.aws_region}" |
| # Model | |
| class Company < ApplicationRecord | |
| has_many_attached :attachments | |
| end | |
| # Controller | |
| def create | |
| @company = Company.new(company_params) | |
| attachments = params[:company][:attachments] |
| require "active_record" | |
| namespace :db do | |
| db_config = YAML::load(File.open('config/database.yml')) | |
| db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
| desc "Create the database" | |
| task :create do | |
| ActiveRecord::Base.establish_connection(db_config_admin) |
| def variables | |
| variables = GC.stat.keys.map(&:to_s) | |
| end | |
| variables.each do |name| | |
| instance_variable_set("@#{name.to_s.gsub(' ', '_')}", Array.new()) | |
| end | |
| def get_recent_stats |
| Devise.setup do |config| | |
| config.warden do |manager| | |
| manager.strategies.add(:remote, Devise::Strategies::RemoteAuthenticatable) | |
| manager.default_strategies(:scope => :user).unshift :remote | |
| end | |
| end |
| project_dir = "my_code_hub" | |
| repos = Dir["#{project_dir}/*"] | |
| success_pull = repos.map do |rep_path| | |
| response = `cd #{rep_path}; git checkout master; git pull`; | |
| print '=>' | |
| rep_path.split('/').last if response.length > 0 | |
| end; |
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc
| # LiquidView is a action view extension class. You can register it with rails | |
| # and use liquid as an template system for .liquid files | |
| # | |
| # Example | |
| # | |
| # ActionView::Base::register_template_handler :liquid, LiquidView | |
| class LiquidView | |
| PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template | |
| _response url _request _cookies variables_added _flash params _headers request cookies | |
| ignore_missing_templates flash _params logger before_filter_chain_aborted headers ) |
SSH into Root
$ ssh [email protected]
Change Root Password