RSSAmplifier

Blog

m. tarık yurt

Recent content on m. tarık yurt

mtyurt.netRSS feed ↗35 posts

Latest posts

Developer salaries may increase with AI

Now I believe that the current hype around AI and LLMs may cause an increase in average salary in the software industry. Being part of the startup ecosystem from the very first day, I always carried the doubt of not having a job for a while, but not for very long. After I reached a point where I proved myself to myself, I didn’t have much of a doubt about job security, excluding catastrophic…

Living with LLMs: Personal Remarks and the 80-20 Rule

I intend this blogpost to be some kind of public ranting, about how I experienced LLM-based Gen-AI so far and how I am involved. I don’t claim to do any predictions in the end. My objective is not to cover everything, just dictate my thoughts so I can have space for the new ones. It is October of 2024. We have OpenAI leading the way with ChatGPT. In my opinion, Anthropic is runner-up with…

An AWS Horror Story: Organization Migration

Recently we have moved 8 accounts under a new organization. It was full of ups and downs; there was hope, there was recklessness, there was fear, happiness, adrenaline rush, and feel of failure. It all started as the same old story: with a spark of an idea, maybe a blogpost, maybe a podcast session, or a solution engineer mentioning it every email. Why did we do it? The new hype, a.

How do I take feedback

Feedback culture is an essential part of Bayzat’s lifecycle. Our culture rises on feedback. It is one of the critical aspects of this organization that keeps me going and engaged. I love it. It feels so natural that I cannot think of a sustainable work environment that doesn’t promote a feedback culture. There is no one type of feedback for sure. I received good, bad, critical,…

Why We Chose AWS ECS and What We Learned

As Bayzat SRE team, we have migrated our infrastructure to AWS ECS approx. 1.5 years ago. This blog post explains why we decided to migrate to container orchestration, how we chose AWS ECS amongst the alternatives, what we are happy about, and what we lack so far. What did we migrate from? We have a mostly monolithic architecture, consisting of one big JVM app, some Lambda functions, and a…

Interacting with Opsgenie On-call Users in Slack Directly

tl;dr: Go is cool, Opsgenie and Slack has nice APIs we can use to patch things together. Intro We are using Opsgenie for two primary purposes: responding to/managing operational alerts internal support system using on-call schedules The first one is the whole purpose alert management systems exist and make money. The second one is an adaptation for us to ease internal-support responsibility of our…

Terraform to manage application lifecycle

This blogpost is an experience report of migrating deployment logic to Terraform. Previously, we were using Terraform in a hybrid way to manage some building blocks, database, EC2 instances, etc., and using some custom deployments to provision these resources. Now, we are using Terraform to manage the full application lifecycle. Here are some advantages/disadvantages I can summarize. Architecture…

Getting Information from ECS Events

In Bayzat, we are using AWS ECS Fargate to manage production and development workflows. In our automation hustles, we are leveraging ECS events to get information about state changes of tasks and services. AWS documents explain how to get started handling ECS events clearly. In this blogpost, I’ll talk about how we use the events, what kind of information we can get out of them, and what we…

Good and Bad Parts of Ansible after 2 Years of Usage

I have been using Ansible for 2.5 years now, professionally. I read a blogpost about Ansible alternatives, which made me re-evaluate why I use Ansible. So I wanted to make a list of pros/cons for future reference, to not forget why I like and dislike Ansible. Image by mohamed Hassan These are coming from a software engineer who now works as an SRE. Everything you’ll read is opinionated. How…

git: Preserving merge commits while rebasing with --rebase-merges option

This blogpost investigates the advantages of --rebase-merges option in rebase command. This option is introduced in git 2.18. TL;DR: Use git rebase -r if you want to preserve the merge commits. – Git has two different methods to sync branches: rebase and merge. Rebase offers a cleaner way to maintain the repository, while merge offers a one-click solution. Rebase is powerful, but it comes…

Multipage PDF to JPEG Image Conversion in Python

There is an easy-to-use wonderful library called pdf2image which converts PDF files into JPEG or PNG images as requested. It works quite fine, but it generates multiple files for multi-page PDF files and I needed a single image containing all files in a PDF file, merged vertically, so pdf2image does not satisfy all my needs. Then I found pillow to manipulate/process image files, from there I can…

Monitoring Supervisord Processes in Slack with Go

TL;DR: supervisord has event listener mechanism for status changes and other things It is a little messy I have abstracted the communication protocol via a small library: https://github.com/mtyurt/supervisor-event-handler I have implemented a small tool to send status change messages to Slack: https://github.com/mtyurt/supervisor-event-to-slack which can be improved for customized workflows /…

Setup Google Authentication in Nginx with Ansible

TL;DR : Using Google authentication in nginx is a thing, In this blog post I explain how it can be built from source code in an amazonlinux container and share the ansible configuration to set it up. Also I show how Google authentication can be used beyond Hello world with a few examples. Motivation User management is a problem. Especially if you are trying to accomplish a simple task but it…

macOS: See Next Meeting in Touch Bar

In this blogpost, I will show how you can display the next meeting you have in Calendar app with BetterTouchTool. In the end you will have a widget like this: Requirements BetterTouchTool: It enables us to add buttons and widgets to the touchbar. icalBuddy: This command line tool finds & returns calendar events. I use homebrew, so I installed these tools with following commands: brew cask install…

Serverless Blog with Hugo and AWS

I have migrated my blog to Hugo from Ghost. Now it’s a static site, deployed and served from S3 with CloudFront. In this blogpost, I’ll talk about the migration process, good and cumbersome parts. Motivation 1. Price I was settled with Ghost before. The platfrom is simple, easy to start especially with DigitalOcean image. I could use a $5 minimal instance to host my blog, even set up…

git: fixup commit in a nutshell

One basic rule of keeping the repository clean is keeping commits meaningful. I have shared a [blogpost][1] & [20-minute-long-video][2] how you can do it via rebase features, in this blogpost I will summarize how to do it via fixup commit. In my feature branch, I have prepared two commits, two logically well-separated commits. While testing afterwards, I have figured that something was wrong with…

go: Using environment variables in configuration files

In this blog post, I will explain how to expand environment variables in a configuration file. If you are looking for the solution, you can jump directly to the solution section. Reason Sometimes, your Go application needs to share some configuration with other applications, especially secrets like API keys. We do like DRY principle. In modern times and at a medium to large scale, this problem is…

git: mergetool outputs 'No files need merging' while git rerere enabled

When rerere (reuse recorded resolution) is enabled in git, it records how you resolve conflicts and applies recorded resolutions upon same conflicts. I was trying different merge tools and using the same repository to try these tools. After resolving the conflict with one tool, changing my default tool, and reproducing the conflict scenario, git told me there are no files to merge. It took me some…

Post-talk: "The feel of infinite cloud databases: AWS DynamoDB"

In Serverless Turkey meetup, I was fortunate enough to give a [talk] (https://www.meetup.com/Serverless-Turkey/events/243384906/) about DynamoDB on October 4th, 2017. It was nice to polish my knowledge about the subject. I won’t write a detailed blogpost about the content about the talk, but I will share my slides and some resources I have benefited. I hope we can see more of these talks in…

git: Using Advanced Rebase Features for a Clean Repository

Recently I have prepared a video about advanced rebased features and how we can use them to make our git repository clean. The video explains basic usages along with advanced features, in this blog post I will refine the rationale behind the clean repository. Git is a very powerful tool. It can be used to solve hard problems encountered during the development. However, we tend to use a small…

Jackson - Case insensitive deserialization

Jackson is a well-known library for JSON utilities. It has a wide area of features. One of them is case insensitive deserialization for field names. It’s available since 2.5.0. In this post, I’ll give an example of such case. Here is a sample POJO class: public class CarInfo { private String model; private String year; //getter, setter, constructor } And here are two JSON messages…

Docker: How to increase number of open files limit

The default limit for open files is 1024 in Docker containers. In Unix systems, you can increase the limit by following command: $ ulimit -n 90000 which sets the limit to 90000. However, Docker does not let you increase limits by default (assuming the container based on Unix, not Windows). To increase the open file limit in Docker, there are two options. 1. Argument to docker run or docker create…

Generating random numbers in Go

I’m spending some time with Go on my free time. While its abilities fascinate me and expand my vision, I feel some back-steps time to time in the standard library. Here is how to generate a random number in Go properly: r := rand.New(rand.NewSource(time.Now().UnixNano())) fmt.Println(r.Int()) It’s the same way we did it in C. It’s not readable for a foreign eye, I expected a more…

Hosting two websites from server with nginx

nginx is a web server used by many web sites, you can follow the link for further information. In this post, I’ll briefly talk about how to serve two sites from the same port. Why? Prices, of course. I had two small websites to serve, which can fit into a small setup easily, why open to separate servers for that?. After setting up two separate websites, I saw the exception Address already in…

Bash script to notify Slack channel for merged branches

Repository health becomes an issue for large projects. If you use feature branches, you’ll have a waste of merged-unused-branches. I have prepared a bash script to find these branches and the authors of last commit of those branches. Then I have sent a summary to a channel in Slack. Here is the script (also in gist): #!/bin/bash -ex sendSlackMsg(){ curl -X POST --data-urlencode…

AWS ECR setup to access from other accounts

AWS ECR (Elastic Container Registry) is a managed Docker hub with customizable permissions. It’s easy to setup with a single account and AWS’s documentation is pretty good enough even if you have no experience with Docker, at all. This blogpost focuses on using a central ECR with multiple accounts with complex IAM permissions. First thing is first First thing to accomplish is locating…

Example bash script to notify a Slack channel about sum of all Groovy code lines in a project

In our current project we have been converting Groovy code to Java. To remind the team about remaining Groovy code lines count, I have set up a bash script using Unix magic and Slack incoming webhooks. Here it goes: $ cat groovyLineCount.sh #!/bin/sh cd /path/to/repo # assuming the repo is cloned to this dir git checkout master && git pull counts=$(find . -name *.groovy -exec wc -l {} \; | awk -F…

Mockito - Mocking/verifying an object parameter without equals() method

Mockito is a powerful mock/stub library for unit tests in Java. This blogpost is written assuming the reader is comfortable with using Mockito. While using Mockito in my unit tests, I have come across a problem regarding classes from third party libraries. This class has no equals() method implemented and I had to keep it in a method’s parameters. Let’s assume it’s something like…

Spring - How to handle "IOException: Broken pipe"

An IOException wrapped in a ClientAbortException is thrown when a client closes the connection while its request is still being processed in the server. It is a little tricky to handle it in Spring MVC framework and I will explain how to do it in this post. Why is it tricky? We can handle exceptions in methods annotated with @ExceptionHandler. The first thought is after handling the exception, we…

Spring - Custom deserialization of JSON requests

Spring uses Jackson library to convert JSON requests to Java objects. I’ll talk about customizing JSON request mapping in this post. Take following JSON as an example request: { "name":"Ali", "birth":1912, "alive":true } Suppose we have following POJO and controller: public class Person { private String name; private int birth; private boolean alive; //getters,setters } public class…

Spring - Expiring all Sessions of a User

Recently, I faced a problem where I had to expire all sessions of a user in Spring MVC. There are answered stackoverflow questions but either they were answered in xml config or they did not cover all aspects. Here is how I managed to do it: Following class is the configuration class and I’ll explain it step by step: @Configuration public class SecurityConfig extends…

Spring - Modify response headers after controller processing

While dealing with Spring MVC, I had the wonderful opportunity of dealing with servlet filters. One thing we needed to accomplish was adding a header after the controller does the processing. It can be done in the controller method, right? But we needed to apply this modification to every incoming request. So, let’s start by implementing a new interceptor: public class DummyInterceptor…

Spring - How to insert a filter before SpringSecurityFilterChain

Running code before SpringSecurityFilterChain was a problem we faced while implementing a huge project in Spring. For example, our logger filter would not log security redirections (like redirecting to auth/login). After a little digging, I found out following bean registration code: @Bean public FilterRegistrationBean registerCorsFilter(CORSFilter filter) { FilterRegistrationBean reg = new…

Getting Started

Hello, stranger. This is the first post of this blog. I will try to post mostly software engineering related articles. This is supposed to be a journal for the author as well as a resource for the reader. Let’s see where it goes.

About me

About me 🦋 Hello there! My name is Tarık Yurt, I’m a software engineer and manager for some time now. I have interest in various areas revolving around the similar goals: Currently interested in the relationship between software development and software operations. Trying to understand the problems in-between, how to utilize tools to fix these problems, and spread the reasoning. 💂‍♂️…