Blog of science and life

Contact
Archives
Feed

Move Docker volumes to other server


New home

I've been self-hosted a few services for my daily needs, and I choosed Hetzner because of their's pricing.

But now after I know Contabo, I will move my services to Contabo, because it's cheaper and more powerful.

I can reduce the server cost for about 30%. Neet.

But I don't want to lose my data. And I don't want to spent a lot of time migrate things either.

Luckily, all of my projects was deployed using Docker. If you don't know Docker, now is good time to start because it's awesome.

Moving data

Let's say I want to move from server A (Hetzner) to server B (Contabo)

And my jobs now are:

  1. Generate ssh key (ssh-keygen -t ed25519) and add public key to server B ~/.ssh/authorized_keys file.
  2. rsync -av my projects from A to B
  3. Find the right directory where Docker bind volumes with docker inspect <container_name …
Read more

Trick for Python dev


If you are a Python dev, I will share with you this trick to avoid future Python related problems.

After install a new, fresh OS, you should install those dependencies

Example, after installed a new Ubuntu for my PC, I will run this command

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Then I will install pyenv, which I think is the best python version management system.

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

And I never have a problem with Python anymore.

Read more

PyMC3 install tips (Ubuntu 20.04)


To install and use PyMC3 with pyenv without Theano error, when install python you need to add flag CONFIGURE_OPTS=--enable-shared

Example:

CONFIGURE_OPTS=--enable-shared pyenv install 3.8.5

Source: https://stackoverflow.com/questions/21342931/error-importing-theano

Read more

« Page 3 / 4 »