Examples are decalred using the it method
Assertions are called Expectations
should and should_not are called Modifiers
Matchers are the operators in the assertions (==, >, be_true, etc.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This playbook has been removed as it is now very outdated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu | |
| MAINTAINER Eric Mill "[email protected]" | |
| # turn on universe packages | |
| RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list | |
| RUN apt-get update | |
| # basics | |
| RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
| RUN apt-get install -y nano |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this monit config goes in /etc/monit/conf.d | |
| check process puma_master | |
| with pidfile /data/myapp/current/tmp/puma.pid | |
| start program = "/etc/monit/scripts/puma start" | |
| stop program = "/etc/monit/scripts/puma stop" | |
| group myapp | |
| check process puma_worker_0 | |
| with pidfile /data/myapp/current/tmp/puma_worker_0.pid |
Elasticsearch is a real time search engine where a change to an index will be propegated to the whole cluster within a second.
An elasticsearch cluster indicated as one or more nodes, collection of nodes containing all the data, default cluster name is elasticserach.
A node is a single server and part of a cluster, node participate in searching and indexing.
Index is collection of documents equavalent to a database within a relational system, index name must be lowercase
Type is represetn a class = table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class API::V1::BaseController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| before_filter :cors_preflight_check | |
| after_filter :cors_set_access_control_headers | |
| def cors_set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream myapp_puma { | |
| server unix:/tmp/myapp_puma.sock fail_timeout=0; | |
| } | |
| # for redirecting to https version of the site | |
| server { | |
| listen 80; | |
| rewrite ^(.*) https://$host$1 permanent; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| ##If you want to install OpenJDK | |
| #sudo apt-get update | |
| #sudo apt-get install openjdk-8-jre-headless -y | |
| ###Or if you want to install Oracle JDK, which seems to have slightly better performance | |
| sudo add-apt-repository ppa:webupd8team/java | |
| sudo apt-get update | |
| sudo apt-get install oracle-java8-installer |
OlderNewer