Nginx server ip's & errors statistics:
=========================
=> tail -f /mnt/errors/access.log | ngxtop top remote_addr => Shows IP'S list of users
=> ngxtop -i 'status >= 502' print request status http_referer -l /mnt/errors/access.log =>Shows for which pages we get 502 error
=>ngxtop -l /mnt/errors/access.log => Shows all types of errors from log
=>configure mongrel_cluseter?
Set up a mongrel cluster
Configure 2 or three ports for the mongrel cluster
Create a map file for my random load balancer
Set up a way to restart the cluster if the server reboots
Configure Apache to forward requests to the mongrel cluster
Configure capistrano to deploy the application.
================================
=>How can you generate sitemaps for your Rails site?
You can use dynamic_sitemaps gem to generate sitemaps
How can you show search user friendly urls instead of using only numeric ids?
The simplest way to do this is to use the gem FriendlyID.
It gives you the ability to specify a friendly URL for pages so that instead of the standard page URLs like:
http://mysite.com/page/1
You can build pages such as:
http://mysite.com/page/my-awesome-page-about-articles-and-content
How can you create page titles and metadata for your pages?
You can use the Headliner plugin for adding page titles.
You can use the MetaMagic plugin to add meta tags.
How can you create breadcrumbs on your pages?
Gretel is a great plugin to introduce breadcrumbs in your Rails application.
Another very simple implementation is breadcrumb_on_rails.
Architecture Related Questions
This questions can be from different angles like: quality, security, scalability, manageability, interoperability, reusability and all the other ilities you name! Here are a few example questions:
Is Rails scalable?
Yes Rails gives you complete freedom to use all traditional means of scaling an application. Things like memcached, caching full pages, caching fragments are all supported.
You can use any standard CDN to serve your media and static content as well.
Database scaling using sharding is supported.
Finally heroku makes your life easier by giving you the flexibility to scale up/down based on your need. Mostly websites have a peak time during which you need more servers and then there is a sleep time. Heroku makes that on-demand scaling process simpler. Companies such as HireFireApp.com makes the autoscale process easier.
============================================
=>How can you safeguard a rails application from SQL injection attack?
User.first("login = '#{params[:name]}' AND password = '#{params[:password]}'")
SELECT * FROM users WHERE login = '' OR '1'='1' AND password = '' OR '2'>'1' LIMIT 1
User.where("login = ? AND password = ?", entered_user_name, entered_password).first
User.where(:login => entered_user_name, :password => entered_password).first
=============================================
create branch in heroku:
{from git
commit all changes to current branch => authenticaion
move changes to from git to heroku:
gem install heroku
heroku login
heroku create qjitsu-staging
git push heroku authentication:master
git remote add heroku git@heroku.com:qjitsu-staging.git
heroku keys
heroku keys:remove ramanaa85@mail.com
remove branch in local:
$ git branch -D branch_name
remove branch which is in remote:
$git push origin :branch_name
$git remote prune origin
============
ruby by satishtalim:
http://rubylearning.com/satishtalim/ruby_overriding_methods.html
paperlicp:
http://gkunwar1.wordpress.com/2012/06/25/how-to-upload-file-using-paperclip-in-rails/
HAML:
http://haml.info/docs/yardoc/file.REFERENCE.html
**Ubuntu on windows7 with VMWare:
=> http://www.howtogeek.com/howto/11287/how-to-run-ubuntu-in-windows-7-with-vmware-player/
=> http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Ubuntu-Precise-Pangolin-76997.shtml
capistrano:
https://github.com/capistrano/capistrano/wiki/2.x-Getting-Started
rspec testing:
http://spitfiresky.com/blog/how-you-should-be-doing-testing-in-rails.html
http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html
javascriptclient side validations:
http://webtempest.com/easy-client-side-form-validation-for-rails-3-1/
javascript client side validations:
http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
**mobile application development:
http://www.tobiascohen.com/articles/2012/07/01/creating-a-mobile-version-of-your-rails-site/
http://stackoverflow.com/questions/5126085/ruby-on-rails-mobile-application/5130756#5130756
basics => http://www.rubyinside.com/21-ruby-tricks-902.html
authentication =>http://rubysource.com/rails-userpassword-authentication-from-scratch-part-ii/
aptana: http://www.pixelite.co.nz/article/installing-aptana-ubuntu-1204
==================================
=>google api key:
https://code.google.com/apis/console/#project:300004415644:access
http://railscasts.com/episodes/241-simple-omniauth?view=asciicast (omniauth-twitter)
twitter api key
https://dev.twitter.com/apps/4355889/show
facebook:
https://developers.facebook.com/apps/515338231858750/summary?save=1
================
=>Why rails slow?
Rails applications can run slowly for few fundamental reasons. The first is simple: Rails makes assumptions for you to speed up development. Usually, these assumptions are correct and helpful. They are not always beneficial for performance, however, and they can result in an inefficient use of resources — particularly database resources.
For example, ActiveRecord selects all fields on a query by default, using a SQL statement equivalent to SELECT *. In situations with a large number of columns — particularly if some are large VARCHAR or BLOB fields — this behavior can be a significant problem in terms of memory usage and performance.
Another significant challenge is the N+1 problem, which this article examines in detail. Essentially, this results in many small queries being performed, rather than one large query.ActiveRecord has no way to know that, for example, a child record is being requested for each of a set of parent records, so it will produce one child record query for each parent record. Because of per-query overhead, this behavior can cause significant performance issues.
==================
=>google api key:
https://code.google.com/apis/console/#project:300004415644:access
http://railscasts.com/episodes/241-simple-omniauth?view=asciicast (omniauth-twitter)
twitter api key
https://dev.twitter.com/apps/4355889/show
facebook:
https://developers.facebook.com/apps/515338231858750/summary?save=1
=======================
pg_dump -C -h localhost -U postgres myapp_production | psql -h 111.22.33.44 -U postgres myapp_production
mysql dis-adv's
=>A subquery with a depth of 3 levels cannot be optimized by MySQL anymore and is executed on every row.
=> time fields do not record milliseconds
=>multiple engines and one server layer
=>postgres =>full text search good,only one server layer
New Relic for ROR performance
Ruby core concepts
=>rho mobile
http://www.slideshare.net/Anubavam/rails-to-rhomobile
=>Capistrano deployment
http://robmclarty.com/blog/how-to-deploy-a-rails-4-app-with-git-and-capistrano
=>ruby docs
http://www.ruby-doc.org/core-2.0.0/Struct.html
=>jquery questions
http://www.codeproject.com/Articles/618484/Latest-jQuery-interview-questions-and-answers
=>ruby method_missing
Ruby's define_method, method_missing, and instance_eval
=>html elements
https://developer.mozilla.org/en-US/docs/Web/HTML/Element
=>Heroku
http://railsapps.github.io/rails-heroku-tutorial.html
https://devcenter.heroku.com/articles/getting-started-with-rails4
=>Mongodb
http://docs.mongodb.org/ecosystem/drivers/ruby/
=>Turbolinks
http://geekmonkey.org/articles/28-introducing-turbolinks-for-rails-4-0
=>ruby 1.9 vs 2.0 vs 1.8
http://slideshow.rubyforge.org/ruby19.html#1
http://globaldev.co.uk/2013/03/ruby-2-0-0-in-detail/
=>facebook with koala
https://github.com/arsduo/koala
Sendmail:
=========
/sbin/service
/etc/init.d/sendmail
locate sendmail
==========================
HOSTING THE SITE:
=================
sudo gem install mongrel –include-dependencies
sudo gem install mongrel_cluster
mongrel_rails cluster::configure -p 8001 -e production -a 127.0.0.1 -N 3
mongrel_rails cluster::start
mongrel_rails cluster::status
mongrel_rails cluster::stop
mongrel_rails cluster::restart
Nginx/APACHE-load balancing and fault tolerance
Apache and Nginx can serve static files faster
Apache/Nginx will take care of distributing requests between the instances in the cluster(mongrel).
sudo mongrel_rails cluster::configure -e production -p 3010 -N 2 -c /home/corti/Documents/ror/myapp -a 127.0.0.1 --user mongrel --group mongrel
mongrel_rails cluster::configure -e production -p 8000 -N 2 -c /home/demo/public_html/railsapp -a 127.0.0.1
-N=>2 processes
-a=>127.0.0.1 (@)
-p=>ports( 3010 and 3011)
-c=> /home/corti/Documents/ror/myapp path of the appplication
cluster= collection of ports
(http://stackoverflow.com/questions/4113299/ruby-on-rails-server-options)
webrick(ruby),mongrel(c and ruby),thin,Phusion Passenger(c++),
Phusion Passenger can start any no. of processes for you when your site becomes busy, not like mongrel only a perticular ports
Capistrano:here "deployment" refers to doing all this preparation work to run the application(is not an application server.)==>replacement for FTP
http://articles.slicehost.com/2007/9/28/ubuntu-feisty-apache-vhosts-rails-and-mongrels
==================
s/w projects developement types:
===============================
t&m =
retain = vertis(everyday 16hrs)
fixed bid = sayagame,cherry branch gallery(fixed for 80hrs)
rails deployment servers:-
========================
slicehost,kattare,capistrono,dreamhost,go-daddy,heroku,amazon s3
http://ariejan.net/2011/09/14/lighting-fast-zero-downtime-deployments-with-git-capistrano-nginx-and-unicorn =>deployments with git, capistrano, nginx and Unicorn
https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning =====>capistrano deployment
http://www.rorexperts.com/rvm-installation-on-ubuntu-10-04-version-t2211.html
http://stjhimy.com/posts/10-five-quick-steps-to-set-up-rvm-with-rails-2-and-rails3
http://www.rubyinside.com/rvm-ruby-version-manager-2347.html
desiga: 0011+9566655680
http://railsapps.github.com/installing-rails-3-1.html
http://telugudictionary.telugupedia.com/
http://ubuntuguide.net/install-firefox-7-stable-in-ubuntu-11-1010-0410-10 ==> to update FIREFOX browser
application controller: stop back button:
before_filter :set_cache_buster
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
mongrel_rails cluster::start -C /home3/s/smcampbell/public_html/nanohygienics_pr/config/mongrel/production.yml
http://www2.elc.polyu.edu.hk/CILL/speaking.htm ==========> spoken english
http://sidorovis.blogspot.com/2011/02/ruby-gems-errnoetimedout-issue-solution.html => gem is not installing
http://www.railsecommerce.com/ ============>rails e-commerce applications
http://en.wordpress.com/tag/ruby-on-rails-ror/ -==> tuts of ror while mutiple dbs connections
http://www.slideshare.net/wycats/jquery-presentation-to-rails-developers-110063 ====> for jquery
http://www.slideshare.net/mokolabs/haml-and-sass-in-15-minutes ========> haml and sass:video tutorails
http://rails.nuvvo.com/lesson/6380-action-controller-streaming-and-file-downloads ===> rails tutorials
http://wowkhmer.com/2011/09/19/unobtrusive-ajax-with-rails-31/ ===========>3.1 tuts,ajax
gnome-open =>to open website
http://www.blog.bridgeutopiaweb.com/post/how-to-install-rvm-and-rails-3-on-snow-leopard/ ==>RVM
http://magicmodels.rubyforge.org/magic_multi_connections/ => multiple db connections
http://rails-erd.rubyforge.org/install.html ==> rails E-R diagrams
rake erd orientation=horizontal title='Global Brand Assurance ERD' filename="BA_ERD_rough" indirect=true notation=bachman attributes=foreign_keys,primary_keys,timestamps,inheritance,content
http://tutorvideo.org/ =>video tutorials
https://help.ubuntu.com/community/PostgreSQL =====> postgresql
git repo-config --get-regexp user. -> ====> git command to find system username
user.name ROR Dev2
user.email deepaks@dckap.com
http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#top ==>RUBY ON RAILS TUTORAILS
http://chat.stackoverflow.com/rooms/24/ruby-rails =========>stack overflow chat
http://www.alfajango.com/blog/rails-3-remote-links-and-forms/ =======>rails 3.1 jquery and ajax
wine 'C:\Program Files\Internet Explorer\iexplore' =>cmd to open ie
http://twitter.rubyforge.org/
https://dev.twitter.com/docs/tweet-button
http://www.paolocorti.net/2007/11/08/ruby-on-rails-applications-with-mongrel-clusters-and-apache-on-ubuntu/ =====>deployment
git --version =>to find git version installed on system
http://kibyegon.wordpress.com/2010/05/13/how-to-install-git-on-ubuntu-lucid-10-04/
http://coding.smashingmagazine.com/2009/02/25/ruby-on-rails-tips/ ====>tips for ror developers
http://www.webresourcesdepot.com/23-amazing-and-open-source-ruby-on-rails-applications/ ====>
23 different ror apps(cms,crm..)
http://mashable.com/2007/09/30/ruby-on-rails-toolbox/ ====> 23 different ror apps(cms,crm..)
http://dsal.uchicago.edu/dictionaries/gwynn/ =====>telugu -to- english site
how to go for mongrel/webrick ==============> how to decide the server
=>admin-creation :http://stackoverflow.com/questions/2708417/creating-an-admin-user-in-devise-on-rails-beta-3
http://guides.rubyonrails.org/form_helpers.html =>ajax in guides
http://edgeguides.rubyonrails.org/ajax_on_rails.html
http://www.ultrasaurus.com/sarahblog/2009/06/simple-web-services-with-rails/ ====>webservice
http://blog.complitech.net/web-services-basics-ruby-on-rails/
https://peepcode.com/ ======>screencasts
http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html
http://railscasts.com/episodes?utf8=%E2%9C%93&search=web+service
=>developing a game with Ruby using the Gosu and Chipmunk gems
Don't cry because it's over, smile because it happened
http://changelogshow.com/ ===========> audio tutorials
http://srikanthjeeva.blogspot.com/2010/04/thinking-sphinx.html =====>thinking-sphinx
http://railsapps.github.com/rails-heroku-tutorial.html ===>heroku
http://peepcode.com/products/phusion-passenger ========>phusion-passenger
http://devcenter.heroku.com/articles/rails3
crm tools for rubyonrails:
=========================
1)Fat Free http://www.fatfreecrm.com/
2)XLsuite http://xlsuite.org/
3)salesforce http://www.salesforce.com/platform/cloud-infrastructure/integration.jsp
4)cohort
5)mongo
SERVER:
========
cat /etc/httpd.conf | more
cat /etc/httpd-2.2/httpd.conf | grep 10505
ps ax | grep ru
ps ax
tail -100f production.log
/home3/s/smcampbell/conf/apache2.conf
ror tuts "http://rubymonk.com/"
cms tools for rubyonrails:-
==========================
1)Radiant cms
2)Refinery cms
3)adva-cms
4)BrowserCMS
5)locomotive
===============================
Scalability:
===========
http://nerdfortress.com/2008/05/13/ruby-on-rails-pros-cons-lets-get-real/
= put a Nginx load balancing reverse proxy in front and then choose your framework, this allows you to add in a pretty well unlimited number of instances. If you care about hardware and electricity costs then go for a more efficient stack. The key part is intelligent cache's.
AGILE AND SCRUM:
===============
http://www.questions-interviews.com/software-development-testing-models/scrum.aspx#what_is_the_difference_between_agile_and_scrum_development
SEO (search engine optimization):
================================
Headliner for titles
Metamagic for meta tags
Gretel for breadcrumbs
FriendlyId for friendly URLs
Dynamic Sitemaps for sitemaps
- See more at: http://www.railsant.com/rails-seo-pack-5-plugins-optimize-site/#sthash.JAyRTS7P.dpuf