Saturday, March 28, 2015

Simple rest with scala

If you are interested in writing simple rest enabled Web apps and are looking for a sinatra like framework in the java world, scalatra may be the answer.
It leverages the rich feature set of scala and the rich community of java. It uses jetty by default making it easy to use without complicated setup but I guess that the end product could be used in a traditional container server quite easily

Sunday, March 15, 2015

Programming scala

Finished this book (almost). Oh boy this book goes deep. Deeper than I would like for an introductory book. That is good and bad at the same time. It is an investment. It also presents best practices in a number of cases and provides elegant solutions in a number of problems.
So I will say that it is a good book to read more than once.

Monday, March 2, 2015

Motorworld

Finished reading this book by top gear presenter Jeremy Clarkson.
This is a book about his experiences while filming the Motorworld episodes around the world.
It makes for a nice relaxed reading especially if you are a motorsports fan. It is not heavy on technical details and Clarkson's humour makes it really easy to read.

Sunday, February 22, 2015

Salt in masterless mode

It seems that salt supports a standalone, isolated "masterless" execution mode. The only thing needed is salt-minion and the state/pillar files. For more details check this out. No extra services are needed.

Friday, January 30, 2015

Mpv and mps-youtube

After the suggestion of friends, i have tried to use the command line media mplayer mpv yestreday and the mps-youtube, youtube player today.
As promised, both are command line tools, that are both powerful and simple at the same time.
mpv exists as a command on its own through the ubuntu repos and mps-youtube is a python tool installable through pip.
In order to use it you need to call the command mpsyt

Tuesday, January 20, 2015

View git tag creation date

The git tag creation date should be easy to retrieve, right?
Wrong. The command to do that is not very easy to remember.
Here is how you can do it:

git log --tags --simplify-by-decoration --pretty="format:%ai %d"

Sunday, January 18, 2015

A few words about swap in linux

Just because swap is allocated, doesn't mean it's being 'used'. Whilst programs like system monitor and top will show some of your swap space being allocated that doesn't mean that the system is actively swapping in/out.
To find out if anything is swapping in/out you can use the vmstat command. Leave it running a few seconds to settle down and watch the si (swapin) and so (swapout) columns. If nothing is happening then there is no reason to be concerned.

Use the command vmstat 1 and watch the output.

Some people suggest that in order to clean the swap used on the machine you can do a swapoff -a && swapon -a. That will do the trick, but i am not sure what will happen if the system needs the swap while it is off. It possible that just rebooting is a better option.