.gitignore not working correct

Posted: 21 February 2020 in git

One of the causes of a dysfunctional gitignore file could be the fact that it was added later and someone already committed files that are meant to be ignored. To fix this issue execute the following commands in the git bash console:

git rm -r –cached .
git add .
git commit -m “.gitignore is now working”

The first line unstages and removes the paths to your files from the git index recursively. The second line adds all your files back in but because the .gitignore is present it will not add files that should be ignored. The final line commits all your files back to the index.

The learning is that .gitignore file works only for committed files only when you rebuild the git index.

Installing Docker on Ubuntu 18.04

Posted: 10 August 2018 in Docker

In this post i will put down the steps to install docker on Ubuntu 18.04.


  • Installed os version is Ubuntu 18.04
  • Configured firewall
  • non-root sudo user available

Step 1 — Installing Docker

The Docker installation package available in the official Ubuntu repository may not be the latest version. To ensure we get the latest version, we’ll install Docker from the official Docker repository. To do that, we’ll add a new package source, add the GPG key from Docker to ensure the downloads are valid, and then install the package.

First, update your existing list of packages:

$ sudo apt update

Next, install a few prerequisite packages which let apt use packages over HTTPS:

$ sudo apt install apt-transport-https ca-certificates curl software-properties-common

Then add the GPG key for the official Docker repository to your system:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

Next, update the package database with the Docker packages from the newly added repo:

$ sudo apt update

Finally, install Docker:

$ sudo apt install docker-ce

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:

$ sudo systemctl status docker

The output should be similar to the following, showing that the service is active and running:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-07-05 15:08:39 UTC; 2min 55s ago
     Docs: https://docs.docker.com
 Main PID: 10096 (dockerd)
    Tasks: 16
   CGroup: /system.slice/docker.service
           ├─10096 /usr/bin/dockerd -H fd://
           └─10113 docker-containerd --config /var/run/docker/containerd/containerd.toml

Installing Docker now gives you not just the Docker service (daemon) but also the docker command line utility, or the Docker client. We’ll explore how to use the docker command later in this tutorial.

Step 2 — Executing the Docker Command Without Sudo (Optional)

By default, the docker command can only be run the root user or by a user in the docker group, which is automatically created during Docker’s installation process. If you attempt to run the docker command without prefixing it with sudo or without being in the docker group, you’ll get an output like this:

docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.

If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group:

$ sudo usermod -aG docker ${USER}


To apply the new group membership, log out of the server and back in, or type the following:

$ su - ${USER}


You will be prompted to enter your user’s password to continue.

Confirm that your user is now added to the docker group by typing:

$ id -nG


The output should now state that you are in the docker group. If you need to add a user to the docker group that you’re not logged in as, declare that username explicitly using:

$ sudo usermod -aG docker username


The rest of this article assumes you are running the docker command as a user in the docker group. If you choose not to, please add sudo in front of the commands.

Let’s explore the docker command next.

Step 3 — Using the Docker Command

Using docker consists of passing it a chain of options and commands followed by arguments. The syntax takes this form:

$ docker [option] [command] [arguments]


To view all available subcommands, type:

$ docker


As of Docker 18, the complete list of available subcommands includes:


  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes


To view the options available to a specific command, type:

$ docker docker-subcommand --help


To view system-wide information about Docker, use:

$ docker info


I will explore some of these commands in another blog post. We’ll start by working with images.

To connect to a running docker container and change files residing within the container you need to start an interactive session. First list all the running containers with the following command:

docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS         
08a9a1701107        rabbitmq:3.7.3-management   "docker-entrypoint.s…"   3 hours ago         Up About an hour

Docker will list all your running container as seen above. The column CONTAINER ID is important and we will be using this ID to connect to the interactive session of that container. To connect to the container enter the following command:

docker exec -it 08a9a1701107 su -

alternative for the CONTAINER ID is the container name if you happen to know this. In my case this would be:

docker exec -it rabbitmq-docker su -

What is docker!?

Posted: 8 August 2018 in Docker

Docker is a computer program that performs operating-system-level virtualization also known as containerization.[6] It was first released in 2013 and is developed by Docker, Inc.[7]

Docker is used to run software packages called “containers”. In a typical example use case, one container runs a web server and web application, while a second container runs a database server that is used by the web application. Containers are isolated from each other and bundle their own tools, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating system kernel and are thus more lightweight than virtual machines. Containers are created from “images” that specify their precise contents. Images are often created by combining and modifying standard images downloaded from repositories.

Recently I was searching the internet for a good approach to perform database maintenance and index rebuilds on a scheduled basis. While searching for frameworks I found a nice project at https://ola.hallengren.com/ by Ola Hallengren.

A quote of the description from the authors page:

SQL Server Backup, Integrity Check, and Index and Statistics Maintenance

The SQL Server Maintenance Solution comprises scripts for running backups, integrity checks, and index and statistics maintenance on all editions of Microsoft SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, and SQL Server 2014. The solution is based on stored procedures, the sqlcmd utility, and SQL Server Agent jobs. I designed the solution for the most mission-critical environments, and it is used in many organizations around the world. The SQL Server Maintenance Solution has been voted as Best Free Tool in the 2013, 2012, 2011, and 2010 SQL Server Magazine Awards, and a top session at PASS Summit 2014. The SQL Server Maintenance Solution is free.

If you are looking for a method to perform easy database maintenance look no further and check out the provided page. This is a really nice set of scripts to put to good use in your own SQL environment! And in case you didn’t see that the description states it’s free this is your second chance at realizing this.

One of the nice features is that it contains a procedure to rebuild or reorganize indexes based on a fragmentation threshold.

All this indexation heaven is possible on a per-table-approach or even a complete database-at-once approach. Be aware to schedule this in your maintenance window time, otherwise this could slow down your server performance significantly when you start re-indexing large database tables in the middle of peak hours.

Tuna with Teriyaki Soy sauce

Posted: 7 May 2016 in BBQ

If you like roasted fish from the BBQ, I have a really easy and tasty recipe. Take a look at the picture of the result and decide for yourself if you want to give it a go.


BBQ Tuna in Teriyaki soy sauce marinade sprinkled with roasted sesame seeds.

What you need:
– Teriyaki sauce
– Soy sauce
– Roasted sesame seeds
– Tuna steaks (around 2/2,5cm thick and as fresh as possible)
– Temperature probe (i use a digital version, something like THIS.)
– Optional: wooden board for a smokey touch. Mine is Canadian western Red Cedar.
– A BBQ 🙂

If you are using a wooden board submerge the it in water for at least 45 to 60 minutes. It needs to be soaking wet when you put it on the BBQ.

Seasoning dishes is not an exact science and you should always take this as a guideline not a strict rule. Play with the used ingredients until you have something to your own liking.

I mixed about 3 tablespoons of teriyaki sauce with 2 tablespoons of Soy sauce. Smear the mix on the first side of the tuna and sprinkle the roasted sesame seeds on the tuna. The teriyaki mix will glue the seeds to the tuna. Flip the tuna and repeat this with the other side. If you have leftover teriyaki mix keep this aside for later.

Heat up the BBQ with 2 zones. 1 Hot zone and 1 low heat zone. Put the wooden board on the hot zone to heat up. The side where the fish will be put on needs to be on the downside. After 2 to 3 minutes flip the board and move it to the border of the hot zone onto the low heat zone.

Put the tuna on the board and insert the probe into the middle of the tuna to monitor the temperature. Close the lid of the BBQ and wait until the core temperature of the tuna hits 50 degrees Celsius or even 46 degrees for very fresh Sashimi grade tuna. Sashimi grade tuna has been flash frozen to kill any parasites.

If you don’t use a wooden board sear the tuna for a couple of minutes on both sides. After that, move the tuna to the low heat zone and wait for the tuna to hit the desired temperature.

A couple degrees before the desired temperature is hit, sprinkle the rest of the teriyaki mix over the tuna for some extra flavor.

Enjoy! If you are going to try this give me some feedback on how you liked this.

FPV Mini quad racer

Posted: 7 June 2015 in Quadcopter
Tags: ,

A couple of weeks ago i had a walk in the park and ran into two guys who where flying mini quads on a field with a lot of tree’s and obstacles. I found it quite impressive and I could not resist the urge to have a talk with them to check out the hardware they where using. To make an impression of what they where doing check out the youtube movie they made with a Go-Pro on one of the quads: I take no credit for this insane flying. This is one of the guys i met at the park! I had the opportunity to watch his flying with a second pair of FPV glasses. This made me very enthusiastic to get started with FPV flying myself. And i ordered myself a 250 frame from Hobbyking.com.


This is the unbuild frame with the motors and BESC. Below you will find a build report of the 250 mini-frame and the soldering of the BECS to the integrated circuit board.


I am using Multistar brushless motors and 12a afro BECS for this project. This was a set bought together.

DSCN1879 DSCN1883

Al the frame parts in the kit and the integrated power distribution board where i will be soldering the ESC’s on. But lets start with building the frame to get an impression of the spots and spaces where all the electronics will be placed. The pictures are quite self explaining so enjoy the ride.

DSCN1885 DSCN1886


DSCN1882 DSCN1888 DSCN1890 DSCN1891 DSCN1892 DSCN1893 DSCN1894 DSCN1895 DSCN1896 DSCN1897 DSCN1898 DSCN1899 DSCN1900 DSCN1901 DSCN1902 DSCN1904 DSCN1903 DSCN1910 DSCN1914 DSCN1917

Soldering the ESC with short wires

Soldering the ESC with short wires onto the power distribution board.

DSCN1924 DSCN1929 DSCN1934 DSCN1935

Putting everything together with the esc’s soldered on. And ready to mount on the Naze32 flightcontroller, the receiver and the FPV circuit board.