HP BL460
- 48 Gb Memory
- 2 x X5675 @ 3.07GHz
- 2 x 10 gbps NIC
- 2tb NetApp NFS volume for ES data
#!upstart | |
description "Workers [resque]" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
respawn | |
respawn limit 99 5 | |
console none |
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
# Putting this at the top of your "base" recipe or some common recipe that | |
# is loaded very early on will force Chef to only run one process at a time. | |
# This is enforced using a file lock. The file lock is automatically released | |
# when the process exits, so there is no need to explicitly do so. | |
#---------------------------------------------------------------------- | |
# Obtain File Lock | |
#---------------------------------------------------------------------- | |
$_chef_lock_file = File.open(File.join(Chef::Config[:file_cache_path], "chef_lock"), "w+") | |
if $_chef_lock_file.flock(File::LOCK_EX | File::LOCK_NB) === false |
#!/bin/sh | |
# Do elasticsearch optimize on logstash previous day index | |
# if $1 = all then optimize all indicies | |
esindex="/opt/elasticsearch/data/elasticsearch/nodes/0/indices" | |
# Grab yesterday's values | |
D=`date +%d -d yesterday` | |
M=`date +%m -d yesterday` | |
Y=`date +%Y -d yesterday` |
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
{ | |
"template": "logstash-*", | |
"settings" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0, | |
"index" : { | |
"query" : { "default_field" : "@message" }, | |
"store" : { "compress" : { "stored" : true, "tv": true } } | |
} | |
}, |
source :rubygems | |
gem 'shotgun', :group=>:development | |
gem 'rack-cache' | |
gem 'sinatra', :require => 'sinatra/base' | |
gem 'sinatra-support' | |
gem 'haml' |
--- | |
driver_plugin: lxc | |
driver_config: | |
base_container: ubuntu | |
overlay: /var/lib/lxc/overlay | |
require_chef_omnibus: true | |
username: root | |
password: password | |
platforms: |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps