sudo apt-get install python3-pip
sudo pip3 install virtualenv
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |
| Install pyenv on Ubuntu 18.04 + fish shell | |
| - Install the packages required to compile Python | |
| $ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | |
| - Download pyenv code from github | |
| $ git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
| - Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned | |
| $ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish |
| rm -f out | |
| mkfifo out | |
| trap "rm -f out" EXIT | |
| while true | |
| do | |
| cat out | nc -w1 -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out". | |
| export REQUEST= | |
| while read line | |
| do | |
| line=$(echo "$line" | tr -d '[\r\n]') |