Wednesday 14 September 2016

Piwik database using Ruby script in Rails Framework

Ruby script for connecting Piwik Database in rails


One of my client I have two different application/Framework 1.Piwik: Which is used as a Analytic framework for tracking all the activites of a web sites and you can store your analytic data in your server basic need for using piwik it's free and easy to integrate with any application and it is provide very good support if you are a paid customer but it's available free also .

So why we need to integrate that PIWIK database in Rails ! Actually we had a requirement to show Analytic dashboard of piwik for some of the Account holder so our Admin maually create the client app on Piwik and we populating that piwik token and other stuff via connecting the Piwik database .


Easy way to create dump of mongodb database Raw

Dump from MogoDB server :)



Installing node version in centos 7 ( Digital Ocean )

Below are the some command which is use-full if you Installing node version in centos 7


Showing uploaded File in Iframe using Javascript



Nokogiri ERROR: Failed to build gem native extension.

Problem with Nokogiri Gem in Mac OS

Setup Rails project in Ubuntu system is pretty much easy for me,  one of my friend when I am setup the Rails porject in Mac OS I found some error during intallation which is related to Nokogiri Gem.


Building nokogiri using system libraries.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --use-system-libraries
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --help
    --clean
    --use-system-libraries
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-libxml-2.0-config
    --without-libxml-2.0-config
    --with-pkg-config
    --without-pkg-config
    --with-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/lib
    --with-libxslt-config
    --without-libxslt-config
    --with-pkg-config
    --without-pkg-config
    --with-exslt-dir
    --without-exslt-dir
    --with-exslt-include
    --without-exslt-include=${exslt-dir}/include
    --with-exslt-lib
    --without-exslt-lib=${exslt-dir}/lib
    --with-libexslt-config
    --without-libexslt-config
    --with-pkg-config
    --without-pkg-config

extconf failed, exit code 1

Gem files will remain installed in /Users/myuser/projectpath/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.2.rc2 for inspection.
Results logged to /Users/myuser/projectpath/vendor/bundle/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/nokogiri-1.6.2.rc2/gem_make.out
An error occurred while installing nokogiri (1.6.2.rc2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.rc2'` succeeds before bundling.
After googling I found a way to resolve that issue .

brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install


Happy coding :)


Shell Scripting in Ruby :) Fun time or Free time




Creating Page Object in AngularJS


Below are the sample of a page object in AngularJs



Changing the version of pod in MAC EI captain

Below are the basic steps for changing the version of pod in MAC EI captain


Auto Rotation Script for Tracker

A simple Test script which help you to rotate the screen via script.

This is usefull for lazy personal who have only one task "RUN TRACKER :)" "not me for me....! ;)"




Salesforce CRM vs. Zoho: A Comparative Analysis

Introduction: Selecting the right customer relationship management (CRM) software is crucial for businesses seeking to streamline their sal...