go[channels]: hot config reload with os signal

Imagine a scenario where you have a monolithic application which uses a config file to store information about log directories, cert dirs and other service information. As an example to it following config file (- it is taken and modified from Haaukins project which I work on- ) can be considered: host: http: myapplication.mrturkmen.com port: insecure: 8080 secure: 8081 tls: enabled: false certfile: "/home/mrturkmen/certs/cert.crt" certkey: "/home/mrturkmen/certs/cert.key" cafile: "/home/mrturkmen/certs/ca.crt" files: ova-directory: "/home/mrturkmen/ova" users-file: "/home/mrturkmen/configs/users.yml" exercises-file: "/home/mrturkmen/configs/exercises.yml" frontends-file: "/home/mrturkmen/configs/frontends.yml" prodmode: true vpn-service: grpc: "vpnservice.mrturkmen.com:4000" auth-key: random-auth-key sign-key: random-sign-key tls: enabled: true certfile: "/home/mrturkmen/certs/cert.crt" certkey: "/home/mrturkmen/certs/cert.key" cafile: "/home/mrturkmen/certs/ca.crt" In this config file we have some set of keys which are defined to be used inside the application, however let’s say we would like to update some values from the config file. Then in normal cases (-if no hot reload kind of function implemented- ), user needs to restart entire application. It means application will have some down time, it may be less or more however it is not good way of doing it, in particular to update only a value from config file. ...

April 18, 2021 · 3 min · mrturkmen

packer: build custom images on cloud and local

THE REPOSITORY: https://github.com/merkez/ubuntu-packer In this blog post, provisioning and customizing images using packer will be shown with a template repository. If you are asking or wondering what is Packer, the official definition is : Packer is a free and open source tool for creating golden images for multiple platforms from a single source configuration. (From Official Website). This post includes provisioning of ubuntu image on AWS and local. Build Custom Ubuntu 20.04 LTS on Local In an ideal repository of Packer template, it would be nice to have a skeleton where it includes uploads, http, scripts folders along packer configuration file with a readme. Overall, the structure of folder might look like this : ...

April 17, 2021 · 8 min · mrturkmen

fail2ban: block ssh bruteforce attacks

fail2ban A while ago, I was checking servers’ logs to see any suspicious activities going on from outside. I noticed that the servers both staging/testing and production servers are receiving a lot of brute force SSH attacks from variety of countries which are shown in table below. List of IP Addresses ( who are doing SSH Brute Forcing ) ** Information on the table gathered from: [ https://www.maxmind.com/en/geoip-demo ] ...

February 24, 2021 · 3 min · mrturkmen

ansible: deploy easily in simple steps

In this post, deployment process of an application with Ansible will be explained. Traditionally applications can be deployed in different ways, quite similar approach to deploy applications like in Ansible is executing bash script which has ssh commands. To give an example, Travis continuous integration has a feature where a bash script can be defined to deploy application and through given instructions within bash script, application can be successfully deployed. ...

December 12, 2020 · 6 min · mrturkmen

ansible: introductory handwritten notes

While watching video tutorial about Ansible, I took some notes and created following PDF file. INTRODUCTION TO ANSIBLE HANDWRITTEN NOTES

December 5, 2020 · 1 min · mrturkmen

youtubeto: download and save playlists to releases on Github

In some moments, Youtube algorithm is working perfect, but sometimes it shows a video from ten years ago from nowhere. For the moments where it shows and suggests videos/playlists to us, we might want to save the list of playlist and watch in some other time. It could be on a plane, train, bus, whenever you are planning to spent some time. However, taking the URL of a playlist and saving it to your cute note program might not be sufficient enough. There is a high chance that it will be forgotten or missed, therefore, I thought that it would be nice to have an automated way of saving playlists on somewhere and download them when I need. (- in particular, when there is no or limited internet connection -). ...

November 24, 2020 · 9 min · mrturkmen

auto-latex: generate and handle latex through github actions

In this post, I will be describing to setup a workflow to build and release your Latex files through Github actions. First of all, keep in mind that this post is not about what is Latex and how to use it. It is extremely nice to integrate daily development tools such as CI/CD to your preparation of paper, without any hassle. Why is that because it is cool to track of what has been changed on a paper over time. In fact, having a couple of people who are responsible in different parts of paper, sometimes blocks others. Therefore, having such a workflow will increase productivity for everyone in a group. Whenever pull request created to main branch, it will be easy to check typos, logic errors and missing points by others. ...

October 26, 2020 · 3 min · mrturkmen

evans: universal gRPC client demonstration

In this post, I am going to write demo for a tool which I have just met, it is called Evans. It is basically universal gRPC client. What it means ? Basically when you have gRPC server and would like to test gRPC calls without creating client, you can test server side calls with Evans. It is known that gRPC is very common communication method between microservices, it can be used for internal and external communication. I do not have intention to explain what gRPC is in this post since it is not the purpose. If required documentation of gRPC can be investigated. ...

August 8, 2020 · 6 min · mrturkmen

haproxy-with-nginx: setting them up for k8s cluster

In recent post, which is Setup Highly Available Kubernetes Cluster with HAProxy , a highly available Kubernetes cluster is created. However, once I started to dig in and deploy some stuff to cluster, I realized that I am not able to connect any deployed application or services. For instance, when an web application is deployed using HAProxy load balancer (endpoint), and check from kubectl (on client side), its status is running. However, that application could not be reached from outside world although I re-patch an external IP address by following command ...

July 10, 2020 · 9 min · mrturkmen

haproxy: setting it up for highly available k8s cluster

The main purpose of this blog post a simple walkthrough of setting up Kubernetes cluster with external HAProxy which will be the endpoint where our kubectl client communicates over. Node specifications for this setup is given as shown in the table below. Keep in mind that all of them has access to each other with password and without password. The environment which Kubernetes cluster will stay is running on OpenStack. It means that once a configuration (ssh keys, hosts, and etc) is done for example master 1 then all other nodes could be initialized through snapshot of master 1. To be able to setup such a Kubernetes cluster easily, I will be using KubeSpray which is a repository where it has all required configuration and playbooks for setting up necessary cluster. ...

July 5, 2020 · 9 min · mrturkmen