Monthly Archives: April 2017

List of good Curl commands

I use CURL for debugging my REST endpoints every now and then if I don’t want to use Postman or DHC clients. I usually like to copy paste results / statistics from command line into emails to my colleagues. This gives them a plain jane command which they can use to test themselves as well as compare their results with mine. The following article has some good pointers on how to use CURL and some very practical examples have been provided.

15 Practical Linux cURL Command Examples (cURL Download Examples)

Displaying memory statistics along with hostname and war files

I recently got into a situation where I had to debug around 10 servers all of which were suffering from memory issues. My java applications were slowing down after a day or so. Although its is difficult to diagnose this kind of issues which span across multiple VMs (welcome to Micro Services!) but with some little bit of scripting it is possible to see in real time the actual numbers if you manage to use tmux to multiplex multiple shell sessions stacked together. I hacked up the following command to display hostname, running war files as well as the memory statistics refreshed every 1 second on screen.

watch -d -n 1 "hostname | tr '\r\n' ' ' && printf \" \" && jps -l | grep .war | tr '\r\n' ' ' && echo "" && free -h"