Wednesday, 10 June 2015

Allow Rserve to be accessed from a remote machine

By default Rserve allows you to access the Rserve instance using localhost and port as 6311

This can be changed by creating a configuration file and specifying it as arguments to Rserve.
The configuration file is not present by default we will have to create one.
Create a file Rserv.cfg ( you can use any name doesnot matter)

Inside the Rserv.cfg
remote enable
port 6566
plaintext disable
R command to start Rserve
Rserve(args="--RS-conf D:\fakepath\Rserv.cfg")
replace absolute path in windows to the corresponding Linux equivalent. Have heard there is a config file in /etc/Rserve.conf( not sure though) if not create a new one.

This will take in the arguments specified in the cfg file
For more parameters and command line arguments for Rserve visit Rserve Documentation

Monday, 25 May 2015

Create a gmail river using imapriver in elasticsearch

curl -XPUT localhost:9200/_river/gmailriver/_meta -d 
"{"type":"imap",
   "mail.store.protocol":"imap",
   "mail.imap.host":"imap.googlemail.com",
   "mail.imap.port":993,
   "mail.imap.ssl.enable":true,
   "mail.imap.connectionpoolsize":"3",
   "mail.debug":"true",
   "mail.imap.timeout":10000,
   "user":"xxxx@gmail.com",
   "password":"xxxx$",
   "schedule":null,
   "interval":"60s",
   "threads":5,
   "folderpattern":"^INBOX$",
   "bulk_size":100,
   "max_bulk_requests":"2",
   "bulk_flush_interval":"5s",
   "mail_index_name":"gmailriveridx",
   "mail_type_name":"mail",
   "with_striptags_from_textcontent":true,
   "with_attachments":false,
   "with_text_content":true,
   "with_flag_sync":true,
   "index_settings" : null,
   "type_mapping" : null
}"

Sunday, 17 May 2015

Maven Dependencies for rserve and rengine

<dependency>
  <groupId>org.rosuda.REngine</groupId>
  <artifactId>Rserve</artifactId>
  <version>1.8.1</version>
</dependency>

<dependency> 
  <groupId>org.rosuda.REngine</groupId>
  <artifactId>REngine</artifactId>
  <version>2.1.0</version>
</dependency>

Tuesday, 18 November 2014

Firefox 31+ crashes in centos 6.4/6+

After updating firefox on Centos 6.4 it started showing the following error and would not start firefox.
$ firefox\n
/usr/lib64/firefox/firefox: symbol lookup error: /usr/lib64/firefox/libxul.so: undefined symbol: gdk_window_get_visual

The issue was resolved after installing
$ sudo yum list gdk-pixbuf2

Still if you get the following error:
/usr/lib64/firefox/firefox: symbol lookup error: /usr/lib64/libgdk-x11-2.0.so.0: undefined symbol: _XGetRequest

Then update gtk and libX11, in my case gtk was already updated to the latest version so, just updated the libX11 and it worked
$ sudo yum update libX11

Tuesday, 11 November 2014

R snippet to remove quotes from a data frame

as.data.frame(sapply(dataFrameName, function(x) gsub("\"", "", x)))

Thursday, 23 October 2014

Eclipse keyboard shortcuts

1. Convert all letters to capitalcase -
 Ctrl + Shift + X 
2. Convert all letters to lowercase -
 Ctrl + Shift + Y