rails new newapp -d mysql
rails generate scaffold Post title:string body:text author:references
| :update_sources: true | |
| :sources: | |
| - http://gems.rubyforge.org | |
| - http://gems.github.com | |
| gem: --no-document | |
| :verbose: true | |
| :benchmark: false | |
| :backtrace: false |
| 1) get data into DB | |
| 2) make sure table names are PLURAL - ruby convention, models singular | |
| 3) point config/database.yml to DB and test: rails dbconsole, show tables | |
| 4) run "rake db:schema:dump" # generate db/schema.rb | |
| 5) run "gem install schema_to_scaffold" | |
| 6) run "scaffold" | |
| Select a path to the target schema: 0 <- Hit enter | |
| * for all tables | |
| 7) run each output command in same order, one by one | |
| 8) check routes "rake routes" |
| syntax enable " enable syntax for known file ext ext | |
| colorscheme darkblue " nice and available for most cases | |
| set shiftwidth=4 " tab = 4 spaces | |
| set tabstop=4 | |
| set expandtab " tabs are evil | |
| set smartindent " use lang logic for indent |
| .DS_Store | |
| .foreman | |
| .vagrant | |
| .irb_history | |
| .powrc | |
| .rbenv-version | |
| .ruby-version | |
| .tm_properties | |
| CREDENTIALS | |
| *.pid |
| # generate self signed certificate: | |
| openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -subj /CN=localhost -keyout cert.key -out cert.crt | |
| # show contents of certficiate | |
| openssl x509 -in cert.crt -text |
| --- | |
| - name: Ansible examples to copy & paste | |
| hosts: all | |
| vars: | |
| firstvar: firstvalue | |
| secondvar: secondvalue | |
| roles: | |
| - common |
| # To see the current indenting settings, and where they were set, enter: | |
| :verbose set ai? cin? cink? cino? si? inde? indk? | |
| # Prevent auto indenting within that file, enter: | |
| :setlocal noautoindent | |
| :setlocal nocindent | |
| :setlocal nosmartindent | |
| :setlocal indentexpr= |
| http://www.census.gov/popest/data/historical/2010s/vintage_2013/datasets.html | |
| http://www.census.gov/popest/data/datasets.html | |
| https://archive.org/download/stackexchange | |
| http://www.datawrangling.com/some-datasets-available-on-the-web/ | |
| https://aws.amazon.com/datasets/ | |
| https://vincentarelbundock.github.io/Rdatasets/datasets.html | |
| # Apache access logs: | |
| http://ita.ee.lbl.gov/html/traces.html |
| http://localhost:9200/_cluster/health | |
| http://localhost:9200/_cat/nodes?v | |
| http://localhost:9200/_cat/shards?v | |
| http://localhost:9200/_cat/allocation?v | |
| http://localhost:9200/_cluster/health?level=shards&pretty | |
| http://localhost:9200/_cluster/state?pretty | |
| http://localhost:9200/_cluster/stats?human&pretty | |
| http://localhost:9200/_cat/master?v | |
| http://localhost:9200/_cat/health?v |