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.

Monday, July 21, 2014

Tip: Apache Kafka

If you get the following exception:
$ ./zookeeper-server-start.sh  ../config/zookeeper.properties
Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain

then you will have to do the following:
$ ./gradlew  jar

to build the Kafka distribution and get the dependencies.