Wednesday, August 19, 2015

Tip: Elasticsearch OSX ConnectException

If you downloaded the latest Elasticsearch installation and you are getting the following exception: connection timed out:/xyz.def.zzzz:9300
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$


go to config/elasticsearch.yml

Uncomment the following line false

Restart Elasticsearch

Tuesday, July 14, 2015

Git Tip: Repository not found

If you get any of the following errors:
GitLab: The project you were looking for could not be found.
Git The Repository not found
Please make sure you have the correct access rights

and the repository exists.

when you do operations such as git clone or git push,
it is possible that your ssh key has not been added with ssh-agent

$ ssh-add
Enter passphrase for /home/name/.ssh/id_rsa: [] Identity added: /home/name/.ssh/id_rsa 

After this, it should hopefully work

Tuesday, September 16, 2014

JSONP: Escape JSON String

Assume you have a JSON string that you are going to send as result value back to Javascript, then you need to do the following:

        String dataString = stringWriter.toString();
        dataString = dataString.replaceAll("\\u2028","\\\\u2028");
        dataString = dataString.replaceAll("\\u2029","\\\\u2029");

Basically, you need to escape the unicode characters.