Script Analytics

2016/01/12

Unable to write enclosing bracket with Atom ? You have a keybinding issue

I started using Atom as a Notepad++ substitute for some time now. I find it really convenient and extensible, however one thing bugged me for a few days...

I am a windows 10 user with a french keyboard and I was unable to add an enclosing bracket "altgr + )" or curly bracket "altgr + =". After a bit of digging, this is due to default keybinding.

2015/12/09

Install docker-machine in your Boot2Docker VM

Boot2Docker still has a non-persistent filesystem.
The following commands will download docker-machine and install it in /usr/local/bin at each image start.

Once again, we will modify the /var/lib/boot2docker/bootlocal.sh file :
sudo vi /var/lib/boot2docker/bootlocal.sh
We add the following commands to automatically install docker-machine 0.5.2 :
# install docker machine
curl -L https://github.com/docker/machine/releases/download/v0.5.2/docker-machine_linux-amd64.zip > machine.zip && \
   unzip machine.zip && \
   rm -f machine.zip && \
   sudo mv -f docker-machine* /usr/local/bin

Install docker-compose in your Boot2Docker VM

Since Boot2Docker uses Tiny Core Linux, which runs from RAM, it does not persist filesystem changes by default.
The following commands will download docker-compose and install it in /usr/local/bin at each image start.

Once again, we will modify the /var/lib/boot2docker/bootlocal.sh file :
sudo vi /var/lib/boot2docker/bootlocal.sh
We add the following commands to automatically install docker-compose 1.5.0 :
# install docker-compose
curl -L https://github.com/docker/compose/releases/download/1.5.0/docker-compose-`uname -s`-`uname -m` | \
  sudo tee /usr/local/bin/docker-compose > /dev/null && \
  sudo chmod +x /usr/local/bin/docker-compose

2015/11/09

Auto-mount Windows folder to Boot2Docker VM

Boot2Docker is a simple VM used to run Docker in Windows.
With Docker-Machine, you are able to run Docker container inside the Boot2Docker VM from your Windows CMD.
And Everything is bundled into Docker Toolbox.


However, It can be annoying to execute shell scripts inside the Boot2Docker VM then retrieve everything on the Windows FS to finally build the Docker image.
In order to simplify my docker workflow and do everything inside the VM, I wanted to have access to my windows workspace from the boot2docker VM.

2014/02/10

How to test exception with JUnit

Testing that an exception has been thrown in JUnit test was painfull until I discovered ExpectedException rule.
Here is a brief overview of exception test mechanisms available in JUnit.

2013/07/05

Dandelion-Datatables integration with Grails

Dandelion-DataTables Logo
"Dandelion-DataTables is a component of the free and Open Source web framework Dandelion. It allows you to quickly create full-featured HTML table based on the amazing DataTables jQuery plugin."
It provides two ways to use the library : JSP taglib or Thymeleaf dialect.

Grails Logo
"Grails is an Open Source, full stack, web application framework for the JVM. It takes advantage of the Groovy programming language and convention over configuration to provide a productive and stream-lined development experience."
Grails works both with GSP (Groovy Server Page) and JSP.

2012/12/22

How to debug a remote Java application

It is not worth an entry but... I always forgot how to remotely debug a jvm :

Firstly, jvm options :
-Xdebug : Enables debugging support in the VM
-Xrunjdwp:<options> : Loads in-process debugging libraries and specifies the kind of connection to be made (Xrunjdwp parameters)
I use -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000