Recursively counting files in a Linux directory

This should work: find DIR_NAME -type f | wc -l Explanation: -type f to include only files. | (and not ¦) redirects find command’s standard output to wc command’s standard input. wc (short for word count) counts newlines, words and bytes on its input (docs). -l to count just newlines. […]

Accessing private properties in PHP

Private properties can only be accessed by the class that defines the property… right? Actually, PHP has a few ways to circumvent this: reflection, closures and array casting. Reflection: slow, but clean PHP provides a reflection API to retrieve metadata of classes, methods, interfaces, and so on. Of special interest […]

Awesome HTTP Load Balancing on Docker with Traefik

Why Traefik? Traefik is the up-and-coming ‘Edge Router / Proxy’ for all things cloud. Full disclosure, I like it. The cut back features compared to products like F5 which I have used throughout my career is refreshing — these products still do have their place, and they can do some […]

Zero Downtime Deployments With Docker Swarm

Zero downtime deployments is an important topic when it is come to hosting a highly available software. This is especially the case with frequent software deployments ,following Agile methodologies, and trying to apply continuous deployment guidelines and techniques. The Problem The zero-downtime deployment topic is most relevant to the web […]

Очистка места на диске после docker

Технология Docker позволяет упаковать приложение или сервис в контейнер, который легко может быть запущен в любом окружении. Однако при активной работе с Docker жесткий диск быстро засоряется неиспользуемыми образами, контейнерами и томами данных. Давайте разберемся с набором инструментов для чистки системы, предоставляемым Docker и рассмотрим несколько примеров! Как мы уже […]

Docker: работа с контейнерами

Ранее мы рассматривали процесс установки Docker в операционной системе Ubuntu 16.04 и для проверки работоспособности запускали тестовый контейнер hello-world — это был очень простой пример контейнера, который запускался, выводил сообщение на экран и завершал работу. Как правило, контейнеры выполняют более полезные действия, ведь они очень похожи на виртуальные машины (но […]

Breaking down monoliths: blue-green microservice deployments with Traefik

When downtime is not acceptable, experts start speaking about zero downtime deployment strategies, for example blue-green deployment, sometimes referred to as A/B deployment. The main idea behind blue-green deployment is that you have some kind of load balancer, and behind that a live system that we refer to as “green” […]

Почему ООП — это плохо

Это перевод статьи Джо Армстронга Why OO Sucks, повествование ведётся от имени автора оригинальной публикации. Когда я впервые познакомился с объектно-ориентированным программированием (ООП), мне не понравилась эта идея. Не знаю, почему именно — просто почувствовал, что здесь что-то не так. После появления ООП эта парадигма стала очень популярной, а её […]

Why can’t I delete a layer in my private docker registry(v2)?

You have to add the parameter delete: enabled: true in /etc/docker/registry/config.yml make it look like that : version: 0.1 log: fields: service: registry storage: cache: layerinfo: inmemory filesystem: rootdirectory: /var/lib/registry delete: enabled: true http: addr: :5000 take a look here for more details Or by adding an environment var to […]

Очистка места в private docker-registry

Не так давно обнаружились проблемы с очисткой места, которое занимают собранные docker-образы в настроенном нами docker-registry — давайте разберемся! Выяснилось, что в веб-интерфейсе Gitlab на вкладке Registry при нажатии на кнопку «удалить» на самом деле происходит удаление только тэга образа, а сами данные никуда не деваются и продолжают занимать место […]