like in remote SSH reads ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order.
like in Terminal in GUI reads /etc/bash.bashrc and ~/.bashrc
contains general things like the environment variables
I use SSH as a powerful tool that it deserves its own gist.
Create a dynamic port:
ssh -fNCq -D 8123 -p 22 [email protected]
Good page with description:
In the following, we assume a working Flask application with the name of SCRIPT_NAME
. First we need to install a couple of things:
sudo apt-get update && sudo apt-get upgrade
Installing nginx
will fail if apache is running. If your installation breaks half ways, then remove the fragments, stop apache (and I actually suggest removing it in case not needed) and then install nginx again:
sudo apt-get remove nginx* --purge
sudo /etc/init.d/apache2 stop
# show number notation | |
def get_number_notation(value, decimal_place=2, unit=''): | |
ref = {24: 'Y', 21: 'Z', 18: 'E', 15: 'P', | |
12: 'T', 9: 'G', 6: 'M', 3: 'k', 0: '', | |
-3: 'm', -6: 'u', -9: 'n', -12: 'p', | |
-15: 'f', -18: 'a', -21: 'z', -24: 'y', | |
} | |
num = max([key for key in ref.keys() if value > 10 ** key]) | |
mult = ref[num] if unit else 'e{}'.format(num) | |
return '{}{}{}'.format(int(value / 10 ** num * 10 ** decimal_place) / 10 ** decimal_place, mult, unit) |