Friday, August 30, 2013

Tip: Mac OSX: Start IntelliJ with sudo permissions

There may be instances where the code you are developing is binding to a particular port that is lower than 1024. So you will not be able to bind to that port.

You will see something like a SocketException : permission denied.

If you are sure that this is temporary and you are developing on your Apple laptop, then do the following in a terminal window:

$>cd IntelliJ\ IDEA\ 12\ CE.app/Contents/MacOS/
$> sudo ./idea

Now IntelliJ is running with sudo permissions.

WARNING: This is a sensitive operation. Do not try it on Apple based servers or production environments.

Netty: UDP based Server Example

An example is the Quote of the Moment Server.

Package is:
https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/qotm/

Server is:
https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/qotm/QuoteOfTheMomentServer.java

Server Handler is:
https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/qotm/QuoteOfTheMomentServerHandler.java