Category: Other

Why to use Vagrant or Docker for development?

Few years ago, I was introduced to Vagrant and for me it was the most elegant tools I ever used, at the end it ended up the most annoying argument I ever hear all the time ” It works on my computer “, at that my team at the company used to use MAMP (yes they all use MAC so we are all have the same OS but different versions), and when I did introduced Vagrant they really liked the idea, especially that it was so easy to have your environment up and running in just few hours (based on your internet connection and what tools you will have to download).

Now things got more better, so I created a Vagrant file which we all used and share, it was based on Vaprobash and everything went so simple after that, we never heard that annoying phrase anymore, we all now have the same environment (despite the fact that I always update & upgrade my installed image, and I cant guarantee that everyone else does that), and the benefit was way more than what we though, now if we are working for a Node.js project, you can just grab a Vagrant file or image for it, if we are working on PHP the choices are open and we have no limit.

Continue reading

Filed under: Code, docker, Other, PHP

Few months without Facebook and no regret

For me, and somehow for most Syrians Facebook was a tool for us to communicate with other family members around the world, things has changed, and Facebook become a place where you started to read news, to see the point view of other people, a revolution here and revolution there, and a lot of sources for news, all type of news ..

To make my story short, things started to be a bit annoying for me, everyone trying to post the happy moment they have, the success they do and every single moment they can share just to let you know that they are living the Dream  no matter if its true or not, all what we see is that part.

In my live I don’t interact with people that much, I love to stay behind my computer, reading twitter or even try to chat on twitter ( do you remember when others used to say Twitter is not a chat ), any way, seeing all this nice and joyful atmosphere made my live like hell, yes when I can see everyone else has no issues, I remember that I have too much issues to deal with (and am not alone, the past 5y was not the easiest on us the Syrians), may be I was lucky to get out of the country, but that does not mean that I am living the Dream nor that I don’t have problems to deal with every single day.

So eventually I decided to just suspend my Facebook account, and only leave the Messenger, at least with the Messenger, I’ll not have to deal with everyone posts nor read everything they post, I can only read what they send to me and when they send it to me.

This somehow got some nice peace to my inner mind, maybe not 100% cause the source for my problems was not only Facebook nor seeing people happy. And till today, I cant say how much nice I find my live without Facebook and his sh%$#y social media, I know I still have to deal with twitter, but at least twitter is not Facebook (at least not for now).

Filed under: Other

[Tip] Cloning a host machine via Rancher

If you have setup Rancher correctly and you have a machine running, you can clone it using the following option

Actually its not cloning by the exact name of cloning, but the thing is that it will use the same API token ( or any credentials ) you have used to create that Host, so for example am using DO, so it just going to use the same API token that I used before to create this host but you will got to the same UI that you have used to create the host like this one

Filed under: docker, Linux, Other

What I have learned about Docker in the past few days

In the past few days, I was only reading about Docker, trying to understand it more and more, see how can I use it and how can I implement it in my workflow, and yet still need a lot to learn.

In my learning journey I depends on reading articles (a lot of articles), checking Docker documentation, watching online courses or even youtube videos, and trust me not all of them is worth the time I spend because either they are old or does not cover the situation am trying to achieve in my head. And am not saying they are bad, but everyone knows that Docker release cycle is fast, and with each new version they introduce a big breaking features which will not work with the older versions, so if you dont follow up fast you will lose the track and thats also apply to any article you read, if its talking about version 1.11 mean while you are working with 1.12, you may get lucky and you find the solution for the issue you are facing.

Now enough with this long talk, which is debatable by the way, lets focus about what I have learned in the past few days and how I got what I want fast.

Basically I wanted to have a small API + Database images, based on Docker like this

Continue reading

Filed under: docker, Linux, MySQL, nodejs, Other

Run your docker images in order

One of the many things that I found annoying in Docker (when you use docker-compose) is that you have no control over the order which the images is going to be up and running, in the documentation they have pointed out to three ways, am not going to cover them all, am just going to cover my experience with dockerize and how I used it to make sure that the database is up and running before I run the next image.

PS: please note that my way is not the best way, but it worked for me, and you should invest more time knowing and familiarize yourself with dockerize.

  1. Make sure that you install dockerize within the image which should be waiting for other images to finish
  2. Make sure that your image does not have any service that run as daemon ( In my case it was NGINX )
  3. Make sure that your entrypoint should look like :
  4. You will need to replace  tcp://database:5432 with the service and the port that you are waiting for, lets say for example tcp://nginx where we need to make sure that nginx is up and running on the default port 80.
  5. You will need to replace kong start with the service that you want to run, in my case it was Kong server

You can look at this github repo where I created a small docker repo to run Kong and Postgresql out of the box

Filed under: docker, Linux, Nginx, Other