A basic example of layering: FTP < TCP < IP < Ethernet
Benefis of layering:
- You can understand a layer without knowing much about the others.
- Minimize dependencies.
| #Reference | |
| #https://devnotcorp.wordpress.com/2012/08/21/usage-examples-of-rubys-openssl-lib/ | |
| #!/usr/bin/ruby | |
| require 'openssl' | |
| require 'date' | |
| require 'time' | |
In this article, I'll walk through a basic Rails (3.2.x) setup for creating a nested resource for two models. Nested resources work well when you want to build out URL structure between two related models, and still maintain a RESTful convention. This code assumes you are running RVM to manage Ruby/Gem versions, and Git for version control.
$ mkdir family # create rvm gemset
$ echo "rvm use --create ruby-1.9.2@family" > family/.rvmrc
$ cd family # install rails
$ gem install rails # create new rails project
$ rails new . # version control | Recording Rule Example 1 | |
| ================================ | |
| # Aggregating up requests per second that has a path label: | |
| - record: instance_path:requests:rate5m | |
| expr: rate(requests_total{job="myjob"}[5m]) | |
| - record: path:requests:rate5m | |
| expr: sum without (instance)(instance_path:requests:rate5m{job="myjob"}) | |
| Recording Rule Example 2 |
| # Add field | |
| echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
| # { | |
| # "hello": "world", | |
| # "foo": "bar" | |
| # } | |
| # Override field value | |
| echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
| { |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| Based on these: | |
| https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu | |
| http://www.intridea.com/blog/2013/5/21/howto-install-setup-jenkins-ci-for-rails-projects | |
| Setup an EC2 instance with Ubuntu (14.04) | |
| Open port 8080 | |
| Install Jenkins | |
| wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - |
| abc 1 2 3 | |
| def 4 5 6 | |
| ga 7 9 10 | |
| hij 1 5 99 |