How to Install Preloader.io Service in Ubuntu 14.04

If you’re finding a solution for SEO especially for AngularJS, BackboneJS, EmberJS and other javascript frameworks. Preloader will be one of your options.

Preloader is a node server that uses phantomjs to create static HTML out of a javascript page.

you are able to use their solutions instead of installing in your own machine.

But, what if you just like me, want to try their service first and want to customize your own Preloader?

here are flows that show how I install Preloader in Ubuntu 14.04.

Read on →
Comments

How to Setup a Simple Standalone Faye Websocket Server Using SSL and Ruby

Demo faye websocket server using Ruby

References:

faye-websockets-part-1

faye-websockets-part-2

How to Use Faye as a Real-Time Push Server in Rails

====================================================

In your remote Ubuntu server

====================================================

Step1. Install Ruby environment in Ubuntu

Reference: https://gorails.com/deploy/ubuntu/14.04

Add user

1
2
3
sudo adduser deploy
sudo adduser deploy sudo
su deploy

Make sure you can login using new user

1
2
3
4
cd ~
mkdir .ssh
cd .ssh
vim authorized_keys

then put the content in ~/.ssh/id_rsa.pub in your local machine into it.

Install Ruby and RVM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sudo apt-get update

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

curl -L https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm

rvm install 2.2.3

gem install bundler
Read on →
Comments

Ruby on Rails Development Using Mongoid 5.0.0 - 3. How to Use MapReduce to Get Pageview Data

What is MapReduce?

Map-reduce is a data processing paradigm for condensing large volumes of data into useful aggregated results.

MapReduce is a popular big data term in recent years proposed by Google. It is a method for manipulate large data sets parallelly and distributedly on many machines. In my words, I usually said that Map-Reduce, “Map” is to assign match function to many machines for cutting a huge data into small data sets(group matched data), and then use “Reduce” to aggregate these calculated data.

In this map-reduce operation, MongoDB applies the map phase to each input document (i.e. the documents in the collection that match the query condition). The map function emits key-value pairs. For those keys that have multiple values, MongoDB applies the reduce phase, which collects and condenses the aggregated data. MongoDB then stores the results in a collection. Optionally, the output of the reduce function may pass through a finalize function to further condense or process the results of the aggregation.

MongoDB MapReduce

if you want more details, please check official documents

Let’s go check how to use map reduce in Mongoid.

Read on →
Comments

Ruby on Rails Development Using Mongoid 5.0.0 - 2. How to Use Aggregation to Get Pageview Data

What is Aggregation ?

Aggregations are operations that process data records and return computed results.

In my opinion, it just like queries but it can do some operations step by step when processing the query just like a pipeline.

MongoDB Aggregation

if you want more details, please check official documents

Read on →
Comments

[HowTo] Integrate Google Analytics and Google AdWords for Customize Ads Retargeting

Comments

Ruby on Rails Development Using Mongoid 5.0.0 - 1. Setup MongoDB

MongoDB

This tutorial series will help you start your Rails project with MongoDB.

And I use Mongoid 5.0.0 as an example.

In this tutorial, you will be able to see how to

  1. Install MongoDB in Mac OSX

  2. Create Some Database Users in MongoDB

  3. Setup Rails Projects

(Tips)

  1. Dump Data

  2. Restore Data

Let’s go !

Read on →
Comments
Google Analytics Alternative