Angel Ruiz
elasticsearch, java, json, debug

Debugging elasticsearch Java API queries as JSON REST queries

Angel Ruiz elasticsearch, java, json, debug


It took me enough time to find out, that I think I should make a post for anyone else who is after the answer in the future.

In Groovy code:

log.debug("ElasticSearch Query using Java Client API:\n${searchRequestBuilder.internalBuilder()}")  

And this in Java:

log.debug("ElasticSearch Query using Java Client API:\n" + searchRequestBuilder.internalBuilder());  

The out put is prettified by default.

Read More
Angel Ruiz
grails, spock, testing

Integrated vs Functional testing: how to test REST APIs in Grails using Spock

Angel Ruiz grails, spock, testing
This guide was written using Grails 2.4.4 although it should work the same for Grails 2.3.x and 3.x (almost the same :-P)

Since current official documentation only covers unit testing for controllers and that it took me a while to to figure them out completely, I thought I would leave it here in case it helps someone else.

The reason for writing these tests was to validate some REST API endpoints implemented using Grails Controllers

Read More
Angel Ruiz
grails, how-to, javascript

How to render JSON properly (without escaping quotes) inside a GSP script tag

Angel Ruiz grails, how-to, javascript

Grails logo

This issue was encountered while using Grails version 2.3.11

In theory it should be as simple as:

  1. Return JSON in your model from your controller
def index() = {  
    [data: data as JSON]
  1. Render the model attribute without encoding using the raw() method
    var data = ${raw(data)};

Unfortunately this does not work, at least when you are using the resources plugin. You know it does not work because all the quotes have

Read More
Angel Ruiz
ubuntu, rabbitvcs, nautilus, integration, git

How to integrate RabbitVCS with Nautilus file manager in Ubuntu 14.04 Trusty Tahr

Angel Ruiz ubuntu, rabbitvcs, nautilus, integration, git

RabbitVCS Git client in Ubuntu

There are still some instances of very nice applications that do not work straight away after installing them via the apt package manager and unfortunately RabbitVCS is one of them.

RabbitVCS is for Linux what TortoiseGit and TortoiseSVN are for the Windows platform. It is a SCM client that integrates itself with the OS file manager to manage local Git or SVN repositories.

Today I wanted to install RabbitVCS (v0.16.0) in Ubuntu 14.04 which has the tool

Read More
Angel Ruiz
vagrant, ubuntu, devops, virtualization, virtualbox

Steps to create a Vagrant Base Box with Ubuntu 14.04 Desktop (GUI) and VirtualBox

Angel Ruiz vagrant, ubuntu, devops, virtualization, virtualbox

Vagrant + VirtualBox + Ubuntu = Ubuntu Boxes

Since the advent of the IaaS and PaaS providers, the decline in usage of monolithic architectures (e.g.: application server + relational DB) and the need for distributed and automatically scalable applications, as software developers we have to be increasingly more aware and skilled in the tools and techniques used to orchestrate and automate the deployment of all the different components that our architecture might end up with.

Among these tools, normally encompassed in the DevOps space, I am currently very

Read More
Angel Ruiz
grails, plugins, how-to

How to reference a file inside a Grails plugin

Angel Ruiz grails, plugins, how-to

Grails logo

Recently I had to creat a Groovy script that copies some files from my plugin to the host application. The problem is I did not know how to reference those files inside my plugin.

If you have the same problem here is the solution:

String yourPluginDir = GrailsPluginUtils.pluginInfos.find { == 'your-plugin-name' }.pluginDir  
Read More
Angel Ruiz
grails, migration, programming

Migrating from Grails 2.2 to 2.3

Angel Ruiz grails, migration, programming

Grails logo

I am writing this post to record all the things I have done in order to migrate an existing Grails 2.2.x app to 2.3.x.

The reasons for me to upgrade are:

  • Project progress is at an early stage where is not very risky to do that. We also have a considerable amount of automatic tests. You have also need to take into consideration that the more major versions you skip, the harder it gets to migrate
Read More
Angel Ruiz
Adobe AIR, Desktop, Apps

ABC iView Desktop - Using Adobe AIR to wrap your Web Application as a cross platform Desktop Application

Angel Ruiz Adobe AIR, Desktop, Apps

Adobe Air logo

What is it?

I have known about the Adobe AIR runtime and its concept for quite a long time, which were initially introduced back in 2007. It was an attempt to bridge the existing gap between the desktop and browser based apps, keeping as many of their respective advantages as possible.

For what I know, basically there are two ways of using Adobe AIR:

  1. You can develop an application using web technologies like HTML or Flash/Flex expecifically targeting this
Read More
Angel Ruiz
MongoDB, Presentations

My MongoDB presentation at the CJUG

Angel Ruiz MongoDB, Presentations

Long overdue, here is the presentation I did for the Canberra J(ava) Users Group on the 14th of Ausgust 2013.

Please click once inside the presentation area and then use the spacebar or the arrow keys to go through the presentation:

The presentation was created using the impress.js library, which seems to be discontinued. The effects are cool but after a few slides is starts to get a bit cumbersome. At the end I was able to manage

Read More
Angel Ruiz
Android, Hacking

How to upgrade your HDMI dongle MK809II to Android 4.2.2 with the Finless ROM 2.0

Angel Ruiz Android, Hacking


This post is a concise and comprehensive summary of the steps I have followed to upgrade my HDMI dongle MK809II (Rochip RK3066 chipset) to use the 4.2.2 version of Android.

After reading plenty of confusing guides, finally I stambled upon this video bellow which explains the process for the older 1.7 version of the Finless ROM. But if all you want is to flash a ROM, you can skip to the 26:30 minute.

Once I watched

Read More