Copying a lxc container to a new host is so damn easy that I couldn’t believe at first!
- First of all, stop your container
sudo lxc-stop -n <YOUR-CONTAINER-NAME>
- Compact it into a tar archive. Containers are usually found on
sudo tar --numeric-owner -czvf lxc.tgz /var/lib/lxc/<YOUR-CONTAINER-NAME>
- Move tar file to new host. Do it the way you like: by network, usb stick or pigeon.
- Untar your container to where it belongs, usually /var/lib/lxc
sudo tar --numeric-owner -xzvf lxc.tgz
sudo lcx-start -n<YOUR-CONTAINER-NAME>
When I was a neofite with Angular JS I had many problems to understand when I had to EMIT or BROADCAST an event: both methods are called the same way but event will take opposite directions:
EMIT GOES UP
When an event is emitted, the curent scope and its anchestors will receive it.
So, if I emit an event from SCOPE 4, I can intercept it on scopes 4, 2 and the root scope.
BROADCAST GOES DOWN
As opposite, a broadcasted event is sent by the scope to and all its children.
If I broadcast en event from scope 2, it can be intercepted by scope 2 itself but also scope 3 and 4… so, if I broadcast from the root scope, i can intercept the event EVERYWHERE!!
Understanding Postgres’ autovacuum isn’t easy at the beginning: it’s a balance between many settings. To help you, here’s a query to understand them and know which tables are pending for autovacuum and how many dead tuples are required before a table gets vacuumed again. Continue reading A simple query to know when Postgres’ autovacuum will run
What’s the best content image size if you want to share your site on Facebook? Continue reading Best image sizes for sharing links on Facebook
Here’s what you should check when you get: “ReflectionException: Class log does not exist in ……. “.
Continue reading Solving Laravel’s “Class log does not exist”
Laravel comes with a great validation system, but sometimes it’s not enough and you need to write your own custom validator.
After some googling, coding, and a big headache, here’s how to do it. Continue reading Create a custom validator in 4 steps
I don’t know what happened in the mind of LastFm api developers when they named a json attribute “#text” …. but they did!
If, just like me, you are going crazy with it, just use single quotes:
Recently I had to install Composer on my Windows 10 system, it’s quite easy but you need to satisfy some dependencies first, so, I wrote this little howto, I hope it will help. Continue reading Howto: Install Php and Composer on Windows
Vagrant is your next work companion: it will create a virtual development environment ready to run on every machine, you no longer need to install a web server, a database or any other package on every single machine, just set it up once and share the same environment with your team. Continue reading Easy virtual development envinronments with Vagrant