iTerm3 and docker startup

If you open iTerm2 and try to run docker ps you’ll probably receive below error:

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

The solution to use iTerm2 instead of Docker QuickStart Terminal is relatively simple:

That will generate below output:

You then need to run:

The output of it is:

All you need to do now is to run:

That’s all 😉


Docker Engine and DockerCompose on OSX – configure iterm2

After you install docker toolbox via

just add below on your iterm console and add support for zsh


Docker private registry

Docker even has a public registry called Docker Hub to store Docker images. While Docker lets you upload your Docker creations to their Docker Hub for free, anything you upload is also public. This might not be the best option when you work on your projects or inside your organization.

So I wanted to spin up my own private docker registry based on … docker. Actually docker-compose as I need to components for my repo: the docker server itself and the nginx server acting as a proxy to handle authentication and ssl.

Below the docker-compose.yml file I’m using to spin up the environment:

On my host I created two directories to handle data images and nginx configuration.

In nginx directory I added the configuration file nginx.conf together with the ssl certificate.

The registry.password file is used by nginx to keep users and passwords for our registry.

Initially created with

you can strip -c and add additional users.

You can spin up the docker registry with:

If everything is ok, you can check if platform is up:

If you want to start docker-registry as a service you need to create the Upstart script:

Let’s test our new Upstart script by running:

Feel free to check the log files:

Your private repository is accessible via

Using our private docker registry:

You can login to your registry with:

From your client machine, create a small empty image to push to our new registry. We will create a simple image based on the ubuntu image from Docker Hub

Inside the container create a dummy directory (eg. my_application) and commit the change:

then tag the image:

Note that you are using the local name of the image first, then the tag you want to add to it. The tag does not use https://, just the domain, port, and image name.

Now we can push that image to our registry. This time we’re using the tag name only:

Similar you can pull images from your private registry:


Happy Dockering!

Vagrant on 123-reg Cloud server

To install Vagrant on your cloud server, you need to download and run the installation kit. Before going further, be sure that you have dpkg and Virtual box installed:

Go to the downloads page of Vagrant and check for the latest release, download and install it:

Next you’ll need to install Kernel headers:

Then, reconfigure the VirtualBox DKMS:

If everything is ok, you should be able to type into your shell:

Feel free to look on other articles for some quick demos and capabilities of vagrant.



MongoDB – Profiling and performance

You can retrieve the status of your server by using:

See the list of running operations in current shell:


  • Exercise care killing operations on secondaries (replica set)
  • Exercise care killing compact operations
  • Don’t kill internal operations – data migration / sync


The mongostat utility provides a quick overview of the status of a currently running mongod or mongos instance.


Mongotop tracks the amount of time a MongoDB instance spends reading and writing data.



The database profiler collects fine grained data about MongoDB operations, cursors, and commands. Profiling can be enabled at database level or per MongoDB instance.

Levels of profiling :

  • 0 = off, no profiling
  • 2 = on
  • 1 = selective, show only slow operations ( > slowms)

A “new” collection will be visible. As a note, the system.profile collection is capped.

The output:

Retrieve the last profile info:

Additional links:


Vagrant – Intro

Vagrant makes it possible to quickly create a virtual environment for development. It is different than cloning or snapshots in that it uses minimal base OSes and provides a provisioning mechanism to setup and configure the environment exactly the way you want for development.


  • All developers work in the exact same environment
  • Developers can get a new environment up in minutes
  • Developers don’t need to be experts at setting up the environment.
  • System details can be versioned and stored alongside code.

You need to create a single Vagrantfile and everything will be configured as you requested.

Vagrant is using different provides but by default VirtualBox is the free and easy to use.

We’ll use a separate work folder to keep things together.

You can download any vagrant image and keep it locally for future instantiation.

A huge list of vagrant images are available on HashiCorp’s Atlas box catalog.

The above script includes the fix for


If vagrant image is running you need to use

You can see the vagrant instance by browsing http://localhost:8000/

To share (you need to register to

You can see it via

To stop the VM:


Install latest nodejs on ubuntu

Note for myself: If you want to “dockerize” latest version of nodejs don’t forget below:


for v5.0

MongoDB 3.2 into xUbuntu 15.10

After I looked over the the steps from:  I wanted to start the service with:

Unfortunately I had below error:

Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.

This error occurred due to the problem with the new Ubuntu (15 and ahead).

Default init system is systemd which was Upstart previously. So you need to install Upstart, reboot your system and here you go, you can now run mongodb service.

  • Install Upstart

  • Reboot your system

sudo service mongod start mongod start/running, process 3371

As alternative to install mongodb:

Edit: 05.01.2016: Just follow below steps as an alternative to fix mongod.service:

Create a mongod.service into /lib/systemd/system/

Then run the commands:

My /etc/mongod.conf file looks like:



Zsh and themes into Linux Console

Extract Youtube videos/audio

One of my favorite Linux applications is the command-line utility youtube-dl, which I use quite often to download YouTube videos or extract only the audio.

So, let’s install.

Extract the mp3 file from youtube url:

Extract the mp3 file from youtube url at 128k audio quality:

Extract the mp3 file from youtube url at the best audio quality:

Display available video formats:

Extract the video: