Some quick tomcat shell functions

Here are some bash profile functions to help you use tomcat as a pro. The following needs to be done in either your .profile file or .bash_profile, depending on what shell you have and whichever method you prefer. First off, make sure you have exported CATALINA_HOME variable pointing to the base of your tomcat installation.

Once you’ve got that done, you can define the following shell functions.Continue reading →

Some docker helper commands

So a lot of times when you’re working with some cool docker containers, you might need to remove all those dead containers that are just lying around. This could happen if you’re running docker containers in background or forgot to use --rm flag.

Not to worry, just run this command to remove ALL running docker containers in one go:Continue reading →

Streaming folders from a server over SSH using tar and gzip

This is how you can stream a folder or multiple folders from a server over SSH protocol.

To stream folders in uncompressed, raw format, run:

Since the tar file is being streamed raw, this could potentially take longer as more data is being passed between server and client. In my test for 700 megabytes of data, this command took 1:56 seconds.

There’s another method. Continue reading →

Taking out Netflix’s gradle-lint-plugin for a spin

Dependency management is a complex thing. A typical gradle project has several dependencies, each of which in turn has multiple other dependencies and so on. This continues and what forms as a result is called a dependency graph. While this is great, unused dependencies is a big problem. For instance, say your project depends on dependency A which then depends on B, C and D. Your project also depends directly with another dependency E which in turn depends on F and G. The dependency graph would look something like this:

Your Project -> A -> (B, C, D)
Your Project -> E -> (F, G)

Now, your project probably only uses code in A which only then directly depends on some code in B. Also, maybe you also have some code that depends on E but that code in E doesn’t depend directly on neither F, nor G. This means that C, D, F and G are your unused dependencies.Continue reading →