Converting number from any base system to decimal in linux shell

Problem

You would like to quickly convert a number from a different base system (i.e. binary, octal, hexadecimal), to decimal.

Solution

Use the echo $(()) shell command to convert it passing it the current base system and the number, as in $((2#101010)) or using the O for octal or 0x for hexadecimal notations.
Examples:

echo $(( 16#FF ))
255
echo $(( 0xFF ))
255
echo $(( 8#21 ))
17
echo $(( 021 ))
17

Taken from Linux Journal’s Work the Shell column (March 2016)

rvm “You need to change your terminal emulator preferences to allow login shell.”

Problem

After a new rvm installation in an (k)ubuntu system you get the following error from rvm when trying to switch between rubies:

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

Solution

As the message suggests you can change the setting in your terminal which is fine if you are using the gnome-terminal by going to the link provided:

Please visit https://rvm.io/integration/gnome-terminal/ for a example.

but if you are using Konsole in KDE you need to go to a different link that explains the change in the settings:

Please visit http://rvm.io/integration/konsole/ for a example.