How to run examples:
- Run $ createdb nplusonedb to create DB
- Run specs $ rspec demo.rb
How to run examples:
| ### Nginx ### | |
| check process nginx with pidfile /run/nginx.pid | |
| start program = "/usr/sbin/service nginx start" | |
| stop program = "/usr/sbin/service nginx stop" | |
| if cpu > 60% for 2 cycles then alert | |
| if cpu > 80% for 5 cycles then restart | |
| if memory usage > 80% for 5 cycles then restart | |
| if failed host 188.166.44.84 port 80 protocol http | |
| then restart | |
| if 3 restarts within 5 cycles then timeout |
| Привет. У меня спрашивали в основном все что спрашивают везде. Единственное было два сложных вопроса: | |
| 1. Описать все что происходит когда грузится страница в браузере. Типа от отправляется запрос на dns, после его обрабатывает веб сервер и тд уже в рельсу | |
| 2. Если вдруг появится репорт что медленно работает фронт, то с чего начну деббагинг | |
| Знание React ( работал или нет ) | |
| Lambda , proc, block | |
| Service Object - что это и тд |
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.bundleRAILS_ENV=production rake db:create db:migrate db:seedrake secret and copy the outputexport SECRET_KEY_BASE=output-of-rake-secretrake assets:precompile. This will create a folder public/assets that contains all of your assets.RAILS_ENV=production rails s and you should see your app.Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.
| module Storage | |
| module Models | |
| class Brand < ActiveRecord::Base; end | |
| end | |
| end |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
| matcher | aliased to | description |
|---|---|---|
| a_truthy_value | be_truthy | a truthy value |
| a_falsey_value | be_falsey | a falsey value |
| be_falsy | be_falsey | be falsy |
| a_falsy_value | be_falsey | a falsy value |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |