How to create a REST client to POST a JSON object to a server and receive the data in Java

I just went through a lot of internet search in order to do exactly what the title says, looks like in the Java world you need to have always a IDE like Eclipse, or even worse, Netbeans, but sometimes I just need to test a concept and I don’t want to create a project for it.

In this case I just wanted to make a simple REST client posting a JSON object and receiving the information, lots of posts uses libraries, frameworks and all kind of stuffs, but I wanted to make it the simpler possible so, here’s my code:

Continue reading

How to install the tab completion for commands and files on ubuntu terminal

Most of the server versions for ubuntu doesn’t comes by default with this extremely useful feature, in order to use it you just need to:

sudo apt-get install bash-completion

And add this text to the ~/.bashrc file

# enable bash completion in interactive shells
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

And just logout and login again, it should work now!