/etc/security/limits.conf
elasticsearch hard memlock 100000
/etc/default/elasticsearch
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
{ | |
"use_simple_full_screen": false, | |
// calculates indentation automatically when pressing enter | |
"auto_indent": true, | |
// sets the colors used within the text area (default) | |
// see https://github.com/olivierlacan/monokaim to download | |
// the customized Monokai I use. | |
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme", |
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
namespace :dynamodb do | |
desc "Create DynamoDB tables" | |
task :create => :environment do | |
puts "Creating tables in the #{Rails.env} environment..." | |
Rails.application.eager_load! # Force the loading of modules | |
prefix = AWS::Record.table_prefix # Table name prefix | |
tables = AWS::DynamoDB.new.tables # Create an AWS connection |
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |
require 'torquebox-stomp' | |
class DemoStomplet | |
def initialize() | |
super | |
@subscribers = [] | |
# passthrough for local messages to skip auth | |
@passthrough_code = "e32f53ac7569ae3a1f692177" | |
end |
desc "Clear pending tasks" | |
task "resque:clear" => :environment do | |
queues = Resque.queues | |
queues.each do |queue_name| | |
puts "Clearing #{queue_name}..." | |
Resque.redis.del "queue:#{queue_name}" | |
end | |
puts "Clearing delayed..." # in case of scheduler - doesn't break if no scheduler module is installed | |
Resque.redis.keys("delayed:*").each do |key| |
Since there are new regions of Amazon S3 services that accepts only Signature v4 (e.g. frankfurt) you cannot use aws-sdk-v1
gem's #presigned_url functionality. And newer aws-sdk
gem (beeing stil in preview for 2.x) doesn't have a functionality to do direct uploading either. Here's my inplementation of that functionality, build on top of aws-sdk v2.0.16.pre
and jquery (it's using some javascript stuff that older browsers won't support though).
For some basic information see this Heroku's Direct to S3 Image Uploads in Rails article https://devcenter.heroku.com/articles/direct-to-s3-image-uploads-in-rails . A "how to" by Amazaon itself in Authenticating Requests in Browser-Based Uploads Using POST (AWS Signature Version 4) http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-UsingHTTPPOST.html (notice beelow are subsections of details, like how to create signing policy).
So, I build it the way,