Install and Use Redis Server

Sort Introduction

Redis is an extremely fast, atomic key-value store. It allows the storage of strings, sets, sorted sets, lists and hashes. Redis keeps all the data in RAM, much like Memcached but unlike Memcached, Redis periodically writes to disk, giving it persistence. It is quite useful as both a cache store and as a full-fledged, NoSQL data store.

This blog describes getting Redis working on your rails application.

Initial setup

  1. Start off by updating all of the apt-get packages:
    $ sudo apt-get update
  2. Now Download a compiler with build essential which will help us install Redis from source:
    $ sudo apt-get install build-essential
  3. Now in the last we need to download tcl:
    $ sudo apt-get install tcl8.5

Redis Installation

Thats all… Finish Now try to run the redis server into your machine

$ redis-serverredis

Stop redis server running in background :

  • $ killall redis-server

OR

  • sidekiqctl

If you are, looking to Develop and design for your project then feel free to contact us at any time

  • Call Us- +91 9910781148, +1 8033353593
  • Email: company@tecorb.com
  • Skype- tecorb

“We maintain transparency with our customers. Our values and business ethics has given us repeated customers. We tend are proud to be a reliable outsourcing partner for many clients across the World.”

Advertisements

SMO (Social Media optimization)

SMO (Social Media Optimization) is the way to fetch traffics on websites from Social Media like Twitter, LinkedIn, Facebook, and Pinterest. Now a day’s SEO (Search Engine optimization) and SMO (Social Media optimization) become more important part of business strategy.

Everyone wants his business on top of the major search engine such as Google, Yahoo, Bing etc.

Social-Media-Marketing

Social Media Marketing

Social Media Marketing: Social media marketing (SMM) refers to the process of gaining traffic through social media websites; some top social media websites are given below;

  • Facebook
  • Google+
  • Twitter
  • Pinterest
  • Linkedin
  • Instagram

 Why does my company need social media?

Whether you can running a small, local operation, or heading a global, enterprise-level effort, the statistics above make it clear: Your customers are online. They are interacting in social media with their friends, colleagues, and other brands in search of information, recommendations, and entertainment.

If your company is not around to answer then your competitor will be use social media for increase own business.  By using social website like Facebook, Google+, LinkedIn, and some other social sites you can increase own business and you can connect with new person for getting new ideas.

How can social be a springboard for success in other marketing channels?

Capturing your company’s voice and sharing it with the world through social media website will open up unique opportunities in all other websites of inbound marketing, including SEO, branding, public relations, sales, and more.

advocacy

Relationships

Some of the most successful SEOs/SMO and public relations professionals earn their popularity. To get the most out of social media, make the relationships you build with it your end goal. The relationships built with customers are the foundations upon which other aspects of your business can and will flourish.

Feedback

Information are often shared through social media website at associate quick pace, and users are more and more turning to social website to share info in present time. This info usually takes the shape of opinions, thus if you can listening for the proper cues from your audience, social media will become a useful supply of insights and feedback

feedback

Also Read- Model View Controller (MVC) Pattern

Deploy Ruby on Rails project with Passenger and Nginx

I’m assuming that you have installed ruby and rails at your server and have a Ruby on rails project to deploy with Passenger and Nginx

Step 1 –  First of all, we need to add a Sudo User to our system so user can have privilege to access the files.

create a user if not exists, in this example, I will explain to create a root user

tecorb@tecorb-Lenovo-B40-80:~$  adduser root

(this will ask few questions like your password etc.)

Step 2 – Now we have to add this new user to the sudo group

Syntex:

tecorb@tecorb-Lenovo-B40-80:~$ gpasswd -a root sudo

Step 3 – Now we need to install Passenger and Nginx

First of all we will install a PGP (Pretty Good Privacy) key:

tecorb@tecorb-Lenovo-B40-80:~$  sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 561F9B9CAC40B2F7

Now we have to create an APT (Advanced Packaging Tool) source file

tecorb@tecorb-Lenovo-B40-80:~$  sudo vim /etc/apt/sources.list.d/passenger.list

And insert the following line in the file:

deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

Press ESC then :wq and hit enter, Now our file has been saved through vi editor

Now we need to change the owner and permissions for this passenger.list file:

tecorb@tecorb-Lenovo-B40-80:~$  sudo chown root: /etc/apt/sources.list.d/passenger.list

tecorb@tecorb-Lenovo-B40-80:~$  sudo chmod 600 /etc/apt/sources.list.d/passenger.list

Now we have to update our APT cache:

tecorb@tecorb-Lenovo-B40-80:~$   sudo apt-get update

And finally, we will install Passenger with Nginx:

tecorb@tecorb-Lenovo-B40-80:~$  sudo apt-get install nginx-extras passenger

Step 4- In this step we will open the Nginx configuration file for some changes:

tecorb@tecorb-Lenovo-B40-80:~$  sudo vim /etc/nginx/nginx.conf

now file will be open in vi editer, Uncomment given line, These lines will look like this:

# passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;

# passenger_ruby /usr/bin/ruby;

uncomment these lines and update the path mentioned in the passenger_ruby line and add default user :

passenger_default_user root;

passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;

passenger_ruby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby;

Note if you are unable to get what is your path to ruby then follow these steps:

tecorb@tecorb-Lenovo-B40-80:~$   which passenger-config

this will return a path like: /usr/bin/passenger-config

If you are on RVM and use Ruby 2.2.1 (version can be whatever you are using)

tecorb@tecorb-Lenovo-B40-80:~$  rvm use 2.3.0

Now finally, we will invoke passenger-config with its full path, passing –ruby-command as parameter like:

tecorb@tecorb-Lenovo-B40-80:~$  /usr/bin/passenger-config –ruby-command

This will show you something like:

  To use in Apache: PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p358/ruby

  To use in Nginx : passenger_ruby /usr/local/rvm/wrappers/ruby-1.8.7-p358/ruby

  To use with Standalone: /usr/local/rvm/wrappers/ruby-1.8.7-p358/ruby /opt/passenger/bin/passenger start

From here you will get path for your passenger_ruby (Nginx). This path will use at passenger_ruby in nginx.conf

Now finally we will save our file and exit by Press ESC then type :wq and hit enter.

Step 5- Now we have almost done, we need to disable the default Nginx configuration at Nginx config file:

tecorb@tecorb-Lenovo-B40-80:~$  sudo vim /etc/nginx/sites-available/default

Findout these lines and comment them:

# listen 80 default_server;

# listen [::]:80 default_server ipv6only=on;

Save this config file, Press ESC then type :wq and hit enter.

Step 6- Now we will create an Nginx configuration file for our application (like our app name is tecorbapp):

tecorb@tecorb-Lenovo-B40-80:~$  sudo vim /etc/nginx/sites-available/tecorbapp

Add the following server block into this file:

server {

  listen 80 default_server;

  server_name tecorbdomain.com http://www.tecorbdomain.com;

  passenger_enabled on;

  passenger_app_env development;

  root /home/rails/tecorbapp/public;

}

In this file we enable listening on port 80, set our domain, enable Passenger, set the application environment here we have used development environment and set the root to the public directory of our ruby on rails project.

If you don’t want to add your domain to the application, you can skip the server_name line from this file, or if you want to use any IP address you can replace

tecorbdomain.com http://www.tecorbdomain.com with your ip address.

Now we will save this config file, Press ESC then type :wq and hit enter.

Step 7- Now finally we will create a symlink this file:

tecorb@tecorb-Lenovo-B40-80:~$   sudo ln -s /etc/nginx/sites-available/tecorbapp /etc/nginx/sites-enabled/tecorbapp

and Restart our Nginx:

tecorb@tecorb-Lenovo-B40-80:~$  sudo nginx -s reload

Now our application should be accessible from our domain, go to your browser and hit the domain.

Also Read- AngularJs with Ruby on Rails Task-1

If you are, looking to Develop and design for your project then feel free to contact us at any time

  • Call Us- +91 9910781148, +1 8033353593
  • Email: company@tecorb.com
  • Skype- tecorb

“We maintain transparency with our customers. Our values and business ethics has given us repeated customers. We tend are proud to be a reliable outsourcing partner for many clients across the World.”

AngularJs with Ruby on Rails Task-3

In Part-2 we have worked with the controller and model in angularJs with Ruby on Rails  and submitted the book form, add that book into the list.

Today we will discuss how to save and get and save data  from/to  the database model using API in ruby on rails with the help of AngularJs.

Lets proceed further :

Step 1: First of all we have to create a Book model in rails with name attribute. And migrate the migration.

Step 2. Now create a  books controller in rails that will contain two actions first for index (to  make an api to get all books records from the db) and another for create( to save data in Book Model). And generate the routes for both of these.

  • Assuming that you are generating the routes using resources :books  in route.rb
  • So for index action path will be ‘books/’ with GET type and for create action path will be same ‘books/’ with POST type.

 Step 3: Now we have to create the JSON Apis for index and create in our books controller like so we can call them from angularJs Controller

rsz_book8

Step 4: Now from AngularJS controller that we have defined in welcome.js we have to call these apis to fetch the book records and save the book into the database.

rsz_1book9

Now We have all done. Refresh your page add book from text-box that will save into your database and all blow listing will be fetch from database. Have fun with AngularJS

rsz_book6

Also Read- AngularJs with Ruby on Rails Task-II

If you are, looking to Develop and design for your project then feel free to contact us at any time

Call Us- +91 9910781148, +1 8033353593
Email: company@tecorb.com
Skype- tecorb
“We maintain transparency with our customers. Our values and business ethics has given us repeated customers. We tend are proud to be a reliable outsourcing partner for many clients across the World.”

AngularJs with Ruby on Rails Task-II

In Part-I we have done how to use basic AngularJs in our Ruby on Rails Project.

Now today we will work with the controller and model in angularJs and submit that book form and add that book into the list.Lets proceed further:

Step 1: Now we will define a controller into our view (index.html.erb) using a div using ‘ng-controller’ like:

rsz_book3

Step 2: Now we will define the controller in the welcome.js fil

rsz_book4

Here ‘myapp’ is same as we have defined in application.html.erb within ‘ng-app’ and ‘welcomeCtrl’ is same which we have defined in view index.html.erb.

$scope is an object by which we will use to interact with the view, we can get and set variables and functions on it.

Here we have set a books array with hashes as the elements.

Step 3: Now first of all we have to access this books array on our view and show a list of books . So come to the index.html.erb and add a list like:

rsz_2book5

Here ‘ng-repeat’ will works like as loop and return every book one by one that are available in books array.

rsz_book6

Step 4: Now we have to submit this form and add the value to the list shown below.

For this we have to add  ng-submit=”addEntry()” in our form tag. Basically ‘ng-submit’ will call the ‘addEntry()’ method when this form will submit. Like,

<form ng-submit=”addEntry()”>

Step 5: Now we have to define this ‘addEntry()’ method in our Angular controller that we have defined in welcome.js file

rsz_1book7

Here $scope.books.push($scope.newEntry) will push the newEntry object in books array. ‘newEntry’ is that object which will use to access the form fields as we have described in Part-I blog.

And after pushing the newEntry data into books array we have to reset the fields so we will initialize ‘newEntry’ with null {}

Now All Done, refresh and add some book.

Also Read- AngularJs with Ruby on Rails Task-1

If you are, looking to Develop and design for your project then feel free to contact us at any time

Call Us- +91 9910781148, +1 8033353593
Email: company@tecorb.com
Skype- tecorb
“We maintain transparency with our customers. Our values and business ethics has given us repeated customers. We tend are proud to be a reliable outsourcing partner for many clients across the World.”

Offshore Ruby on Rails (RoR) Development Services

Hire Ruby on Rails Development

Ruby on Rails called as Rails or RoR. RoR is an open source web application development framework. Ruby on rails mainly runs on the general programming language, Ruby. Ruby on Rails is an object-oriented programming (OOP) language with properties from PERL & Python. RoR uses the variant framework of the MVC (Model/View/Controller) architecture pattern to organize application programming. The Model-view-controller architecture simplifies the coding process. Ruby on Rails includes tools that run a typical development task easier. Ruby on Rails is an open source web framework.

aaeaaqaaaaaaaaovaaaajdjizwm4yzlkltjkntetndfhzi1imdzhlwqyytayyzrhmzzhoq-1Ruby on Rails features a distinctive convention over configuration approach that has created it to grab a bigger market share among ten years of your time. As Ruby on Rails Development relies on MVC design it’s less code and repetition that helps the appliance development faster for Ruby on Rails developers. The options of Ruby on Rails have created it to deliver unmatchable, climbable and versatile web applications.

Some of the Features of Ruby on Rails Development

  • Most reliable
  • Easy to use
  • Easy to make changes.
  • Agile Development
  • MVC architecture
  • Client Library
  • Available for free use.
  • Allows Platform independent coding.
  • Faster launch.

Ruby on Rails Outsourcing Services

Being an offshore RoR development service supplier, we tend to understand the importance of Ruby on Rails development and also the skills needed for a RoR Developer. To develop a web application you wish a responsive, reliable, active and moreover experienced partner, thus Tecorb Technologies. We offer end to end RoR development services. Our RoR developers are passionate about RoR development.

Some RoR web based application development services.

  • RoR porting and migration.
  • RoR testing services.
  • RoR content management (CMS) development services.
  • RoR blogs, widgets, and social networking site development.
  • RoR e-commerce application development
  • RoR layout design.

Tecorb Technologies provides skilled offshore RoR development services. Deliver the goods best results out of Ruby on Rails Development technology operating with specialists on Ruby on Rails Development. We can get delivered multiple comes on RoR since our origination. We have a decent understanding of the technology.

ruby_and_rails_large-1Our Ruby on Rails Web application developers has glorious information on ruby on rails development.

  • Radrail, Rails 2, Rails 3, Rails Framework
  • BootStrap
  • MySQL, SQL, Postgresql, SQLite.
  • Web 2.0/3.0 Techniques.
  • Query, Sencha Touch
  • HTML5, CSS 3
  • Source code control using Git, SVN etc
  • Database installation
  • Development and Testing Environment
  • Coding standards and other solutions too.

Ruby On Rails Development for Different Industries

We understand the importance of different RoR application for various Industries, and our offshore Ruby On Rails developers are ready to cater the necessity of each client. The areas wherever we have competence and have verified our technical skills are:

  • IT Consulting /IT Services.
  • Web/IT Services.
  • Travel & Tourism.
  • Manufacturing & Services.
  • Social Networking
  • Social Plug-in Widgets
  • Construction Industry.
  • Print Media
  • Blog Widgets
  • E- Commerce.

Outsource Ruby on Rails Development with Tecorb Technologies and get

  • The expertise of 6+ years in Web Development.
  • Excellent Team for Ruby on Rails Development.
  • Flexible Customer Engagement Models.
  • Competitive Pricing.
  • Soft communication
  • Adherence to strict Coding Guidelines and Standards.
  • Complete Documentation.

Need Ruby on Rails Development for your project or product?

If you are, looking to Hire Ruby On Rails developers for your project then please talk to us today

  • Call Us- +91 9910781148, +1 8033353593
  • Email: company@tecorb.com
  • Skype- tecorb

“We maintain transparency with our clients or customers. Our values and business ethics has given us repeated customers. We tend are proud to be a reliable outsourcing partner for many clients across the World.”

Feel secure while choosing Ruby on Rails for your application as comparatively others.

Ruby on Rails is a popular framework for web applications, built on the dynamic Ruby programming language. Estimates indicate that a quarter of a million websites use it, including Airbnb, Basecamp, Groupon, Hulu, and Slideshare. Developers love working with it because it is expandable and it helps them get from concept to prototype quickly.

Ruby on Rails Built in Security Features

I am a good believer in secure by default and making security easy for developers. Some can argue that by create security easy, it can make developers pay less attention to security and possibly lead them to making creating security mistakes. Kind of like a horse with blinkers on. In reality I think it is probably a balance, do not create security invisible to the developer but instead create it just easy enough for them to implement in right way.

So be warned! Do not just RORs built in security features thinking that they offer a 100% most effective way at mitigating the vulnerabilities they could designed to prevent against. Instead, learn how to used them rightly and know their limitations.

Supported versions:

For major security issues or error, the current release series, the next most recent one, and the last additional major series may receive or take patches and some latest versions. This is currently new versions 5.0.x and 4.2.x.

When a release series is no longer supported, it’s your own responsibility to deal with issues or errors. We can offers backports of the fixes and publish them to git, however there may be no new versions released. If you are not comfortable maintaining your own versions, you should upgrade to a new supported version.

Ruby on Rails Security Gems

As we have seen, Rails provides many built in security features to help protect our applications, data and users from web based virus attacks and some other attacks. But we also saw that these have their limitations. For security features that Rails does not provide by default there are always Gems, lots and lots of Gems

ror-development

System or devise is a popular authentication and authorization Gem for Rails. It provides secure password storage using bcrypt to hash salted passwords. User lockouts, user registration, forgot password functionality and more.

Although system or Devise’s own README states, “If you may building your 1ST Rails application, we recommend you do not use Devise or System”, I would ignore this statement. If you are security aware and you have built applications in other frameworks before, I do not see any issue or error with using Devise or system for your IST Rails application.

URL: https://github.com/plataformatec/devise

Brakeman

Brakeman is a Static Code Analysis (SCA) tool for Rails applications. It searches your application’s source code for potential vulnerabilities. Although it can report the occasional False or Positive, personally, I think this is a great Gem and one I would definitely recommend running against your application before going into production. Even better, run it after every commit.

URL: https://github.com/presidentbeef/brakeman

secure_headers

Developed by Twitter, Secure Headers is a Gem that implements security related HTTP (Hypertext Transfer Protocol) headers into your application’s HTTP(Hypertext Transfer Protocol) responses. Headers such as Content Security Policy to help protect against Cross-Site Scripting (XSS) attacks, HTTP Strict Transport Security (HSTS) to ensure your site is only accessible over secure HTTPS, X-Frame-Options and others.

URL: https://github.com/twitter/secureheaders

rack-attack

Developed by Kickstarter, Rack::Attack is a Gem for blocking & throttling abusive requests.   Personally, I use Rack::Attack to prevent forms being abused, for example, instead of implementing a CAPTCHA on a submission form, I use Rack::Attack to ensure it is not submitted too many times in a short space of time. This would prevent automated tools from abusing the form submission. It also supports whitelisting and blacklisting of requests.