Ansible wait_for with docker_container

When using Ansible’sdocker_container to manage containers, we’ve seen people use wait_for ensure the container is started. This requires that the container exposes a port and typically on the host network. Then the IP and the exposed/published port can be used to verify the container (or the service inside) is running. What if there is no port, or no host binding? If there is nothing to expose from the container (e.g. think of a queue worker), Read more

How to Configure the Linux Firewall for Docker Swarm on Ubuntu 16.04

Docker Swarm is a feature of Docker that makes it easy to run Docker hosts and containers at scale. A Docker Swarm, or Docker cluster, is made up of one or more Dockerized hosts that function as manager nodes, and any number of worker nodes. Setting up such a system requires careful manipulation of the Linux firewall. The network ports required for a Docker Swarm to function correctly are: TCP port 2376 for secure Docker Read more

How can I make git accept a self signed certificate?

To permanently accept a specific certificate Try http.sslCAPath or http.sslCAInfo. Adam Spiers’s answer gives some great examples. This is the most secure solution to the question. To disable TLS/SSL verification for a single git command try passing -c to git with the proper config variable, or use Flow’s answer: git -c http.sslVerify=false clone https://example.com/path/to/git To disable SSL verification for a specific repository It is possible to globally deactivate ssl verification. It is highly recommended to Read more

Building Driver-based Components in Laravel

Componentization is a great way to build extensible and reliable software systems. It allows us to build large systems that are composed of decoupled, independent and reusable components. It gives us a plug-and-play approach to building software systems. Laravel as a framework is richly composed of reusable components — some of which are third-party Symfony components — that are all well-defined and pieced together to make up the system. Components Most modern software systems are Read more

Laravel: The hidden Manager class

When creating your application, sometimes you may find a class that accepts different implementations of something. For example, a delivery courier may need any transportation to reach your house with your package: bicycle, car, or even public transport. Okay, you get the picture. Now you need a way to create these implementations depending on what the delivery courier needs to use to reach your house. And each of these implementations of transport have their own Read more

Drivers and Managers in Laravel

One of the biggest features in Laravel is the ability to create services easily that can be extended and customized in a painless way. For example, we can quickly set up our own authentication guard and use it where we want. Let’s take a look at how to write a custom manager that we can extend without touching it. Laravel offers a very simple way to switch between different technologies easily. Let’s say we want Read more

A simple way to enable CORS on Laravel

What is CORS? CORS stands for Cross Origin Resource Sharing. Origin consists of protocol, domain and port number such as https://hogehoge.com:443. Therefore, CORS means allowing an web application on a certain origin (e.g. https://hogehoge.com) to access an web application on a different origin (e.g. https://fugafuga.com). Why is CORS necessary? In order to prevent cross site scripting (XSS) and cross site request forgeries, JavaScript’s asynchronous communication such as Ajax follows the same origin policy, which bans Read more

The docker-proxy

Containers created and managed by the Docker platform, are able to provide the service that is running inside the container, not only to other co-located containers, but also to remote hosts. Docker achieves this with port forwarding. For a brief introduction to containers, take a look at a previous article. When a container starts with its port forwarded to the Docker host on which it runs, in addition to the new process that runs inside Read more

Checking if structure is empty or not in Golang

If the structure is empty means that there is no field present inside that particular structure. In Golang, the size of an empty structure is zero. Whenever the user wants to know if the created structure is empty or not, he can access the structure in the main function through a variable. If there doesn’t exist any field inside the structure, he can simply display that the structure is empty. Syntax: type structure_name struct { Read more

Progressively Build an Optimized Docker Image for Golang Projects

If you’re getting started with a brand new golang project and want to package it inside a docker image, this is a good starting point for you. I tend to switch programming languages often depending on the project I’m in and in order to help me with the quirks of each language I keep handy cheat-sheets, here is one I have for Golang that includes a quick walkthrough of the golang basics in less than Read more


Любишь мемасики?

Подпишись на мой телеграм-канал!

Открыть
Закрыть