Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Setup Mirror Between 2 or More Git Server Using Hooks Script

Permalink

First make sure the two server can using ssh to login each other, then add remote mirror to bare git repository.

git remote add --mirror=push cvpgitip01 git@10.11.37.110:repositories/Feng-Wu/demo.git

Add hooks post-commit in bare git repository.

#!/bin/sh
exec git push cvpgitip01 -f --mirror

Install Shiny Server in Ubuntu 12.04

Permalink

R package Shiny originally not support R Studio Server, so shiny.R need change before install

install shiny package for R Studio
cd ~
wget http://cran.r-project.org/src/contrib/shiny_0.13.2.tar.gz
tar xvfz shiny_0.13.2.tar.gz
vi shiny/R/server.R
# search 'Listening on http://' and replace 'startServer(host, port' to 'startServer("0.0.0.0", port'
# search 'Test port to see if we can use it' and replace 'try(startServer(host, port' to 'try(startServer("0.0.0.0", port'
# search 'QtWebKit' and replace 'paste("http://", browseHost,' to 'paste("http://", "your.rstudio.host.name",'
tar cvfz shiny_0.13.2-server.tar.gz shiny
R CMD INSTALL shiny_0.13.2-server.tar.gz # (may need install htmltools before this line)
service rstudio-server restart # if you previous install shiny from CRAN

Before install shiny server, make sure you install node.js version 0.8.17 or higher and meet prerequisites.

install shiny-server
npm install -g shiny-server # install shiny-server

or use the offline install mode:

git clone https://github.com/rstudio/shiny-server
cd shiny-server/
node tools/bundle-offline-installer.js
mv shiny-server-0.3.0.tgz ..
cd ..
npm install --no-registry -g shiny-server-0.3.0.tgz

The sample shiny server config file.

run_as shiny;
log_dir /var/log/shiny-server/;
server {
listen 3838 127.0.0.1;
location /first {
app_dir /var/shiny-server/first;
}
location /diamonds {
app_dir /var/shiny-server/diamonds;
}
}

How to Avoid the Ruby Debugger Warning Already Initialized Constant VERSION in Rubymine

Permalink

Now I'm using the Rubymine instead of pry-debugger as my primary Rails environment, Rubymine has much great debug facility and what's more, I spend $17 when the JetBrains offer 75% off at the Mayan Doomsday.

But I found a problem that rubymine always refuse to enter the debug mode when I using my pl-form project in below warning:

debugger-1.2.3/lib/ruby_debug.so: warning: already initialized constant VERSION

finally I found prject Gemfile need a little review:

group :development do
gem 'quiet_assets'
# Disable below two line if you using rubymine
#gem 'pry-rails'
#gem 'pry-debugger'
end