Hot Posts:

Nov 20

Mac – Install NPM / Nodejs without sudo or root

I don’t like to use sudo/root while installing third party softwares. I ran into issues while installing nodejs. Then I found a nice article which takes cares of this issue.

npm installs packages locally within your projects by default. You can also install packages globally (e.g. npm install -g ) (useful for command-line apps). However the downside of this is that you need to be root (or use sudo) to be able to install globally.

Here is a way to install packages globally for a given user.

1. Create a directory for your global packages

mkdir “${HOME}/.npm-packages”

Read the rest of this entry »

Oct 26

Fixed: redirect_uri_mismatch Google SignIn Problem Oauth2

If you are trying to integrate Google oauth into your application then you might see this kind of error. This happens because you didn’t correctly configure the redirect url in Google console. Follow this steps:

– Login to & Go to your existing project
– Go to Api & Auth -> Credentials
– In my case I was trying to integrate it locally so ‘Authorized Javascript Engines’ say ‘http://localhost:8080’
– Now in ‘Authorized redirect URIs’ add entry ‘http://localhost:8080/signin/google’. You are done!

Oct 20

Fixed : Spring Hibernate – could not obtain transaction-synchronized Session for current thread

If you ever run into this exception in your spring-hibernate setup then just do following things.

1 – Annotate all your @Repository classes with @Transactional attribute
2 – Add @EnableTransactionManagement to your config class which is generating sessionFactory & hibernateTransactionManager. That’s it :)

Oct 16

Multi module project spring boot parent

If you are using a spring boot in your application then you might stumble upon spring-boot-parent artifact is represented this way e.g.

<relativePath /> <

But in case if you already have multi-module project setup, you might have existing parent structure. How to integrate two?


Just keep your existing project structure as it is and instead of the above spring block add a dependency management section in pom. e.g


This was suggested on the stackoverflow & it did trick for me :)

Oct 12

criteria uniqueresult() null projections hibernate

Ran into weird issue with hibernate

long count = (Long) criteria.uniqueResult();

in above case criteria.uniqueResult() should never return null.

This happens when you have multiple sessions factories in the code & they are not wired correctly. Just match them correctly so they don’t interfere with each other. :)

Feb 24

Apache caught SIGTERM, shutting down MAMP Yosemite

When I upgraded my macbook to Yosemite OS the apache webserver wouldn’t start. That started driving my crazy because¬†it wasn’t indicating any proper error. The log would only say this –

[notice] caught SIGTERM, shutting down

Environment: Yosemite + MAMP 2.1.3 + Apache 2.2

Finally I found the workaround –

1. Just rename your

/Applications/MAMP/Library/bin/envvars file to something else like “_envvars

2. You are done :)



Nov 24

Solved: /opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture

I was trying to install macports on my Mac Mavericks & while updating the older version using

sudo port upgrade outdated

it messed up my system & started giving the following error on the command line

/opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture

. Finally I was able to fix it by running following step:

sudo port install libidl +universal


Nov 13

MySQL Library not loaded: libmysqlclient.18.dylib

Although I had MySQL community edition installed on my Mac OSX , I recently had the following error while running some python installation script which uses mysql as a backend. The error was:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQLdb/", line 19, in
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

1. Locate your MySQL installation & create symlink in /usr/lib for that. That’s it :)

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

Jun 14

MAMP with MySQLWorkbench on MAC OS X

If you try to run MySQLWorkbench with MAMP you might run into issues like start/stop control related issues. Follow this steps to resolve it:

1. Connection Method: localhost/pipe
2. Socket pipe path: /Applications/MAMP/tmp/mysql/mysql.sock
3. You are done :)

Jun 13

Change SSH key passphrase

You don’t have to generate new key-value pair :)

Follow this in your terminal:

$ ssh-keygen -p
$ Enter file in which the key is (/Users/you/.ssh/id_rsa): [Hit enter]
$ Enter new passphrase (empty for no passphrase): [YOUR_SECRET]
$ Enter same passphrase again: [YOUR_SECRET]