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.

Saturday, January 17, 2015

Changing the default boot option in Grub2

Grub2 is using a new weird configuration format. If you want to change the default boot option you can find instructions here.

In short do a  fgrep menuentry /boot/grub/grub.cfg

find the menu entry you are interested in, edit /etc/default/grub  and copy the name of the entry in the

GRUB_DEFAULT=0
entry. Save the file and do a


sudo update-grub

Thats it



Thursday, January 8, 2015

Tmux cheat sheet

tmux is a terminal multiplexer. It is newer than the venerable screen and is supposed to have a richer feature set. Here is a cheatsheet

Sunday, January 4, 2015

Converting a typical netbeans project to maven.

For some weird reason, i think that converting my netbeans project from ant to maven is a good idea, so i will give it a go following the directions at this blog post and this