Maksym Prokopov personal blog
Idea is a something worth sharing

How to increase Kubernetes PVC size for AWS EBS

12.05.2020

It’s quite simple to increase PVC size since K8s 1.11

kubectl describe pvc and find your storage class.

Name: jenkins
Namespace: jenkins
StorageClass: jenkins-gp2
Status: Bound
Volume: pvc-473e3dbf-b759-11e9-9cbc-02a7fb0b6cca
Labels: app.kubernetes.io/component=jenkins-master
app.kubernetes.io/instance=jenkins
app.kubernetes.io/managed-by=Tiller
app.kubernetes.io/name=jenkins
helm.sh/chart=jenkins-1.3.6
Annotations: pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/aws-ebs
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 16Gi
Access Modes: RWO
VolumeMode: Filesystem
Mounted By: jenkins-6b5c9bcbbb-gr2l5
Events:

kubectl edit storageclass jenkins-gp2 add the following to your storage class

allowVolumeExpansion: true

kubectl edit pvc jenkins

Read More…

My new modern web site stack

12.04.2020

In the age of Kubernetes and all this fancy stuff, I decided to make something really simple and as static as possible. The modern, cutting-edge tech stack.

This is a story about https://it-premium.com.ua reincarnation featured with responsiveness and saving all the functionality it had before. Though it wasn’t a simple, but very interesting journey.

Here are the specs I wanted to preserve:

The old stack

At first, it was a Ruby on Rails 4.2 application and it used the following gems:

Read More…

My recent tasks

03.03.2020
Read More…

Applescript instantly open Zoom link from the iCal calendar

26.02.2020

This is really my little timesaver because you know, a lot of meetings happen when you work remotely.
Works best with Alfred 4 using mapped hotkey.

tell application "Calendar"
	tell calendar "[email protected]"
		set itemLocation to location of first event where its start date ≤ (current date) + 10 * minutes and end date ≥ (current date)
		if itemLocation contains "zoom.us" then tell application "Finder" to open location itemLocation
	end tell
end tell

Read More…

Applescript instantly open Zoom link from the iCal calendar

02.02.2020

This is really my little timesaver because you know, a lot of meetings happen when you work remotely.

Read More…

The bad thing about Rails is that by default it suggests using own messy design patterns like fat…

15.09.2019

The bad thing about Rails is that by default it suggests using own messy design patterns like fat models. I mean all these callbacks in AR, observers and everything that is good for a simple blog but fails for a big application.

You have to use a very little part of Rails to apply DDD concepts.

Два древних языка, которые нужно изучить программисту

01.08.2019

Почему нужно проинвестировать время в изучение двух древних языков Lisp и SmallTalk?

Я уверен, что это сделает вас на шаг ближе к стадиям развития специалист и эксперт.

Nikita Prokopov сделал отличный talk о стадиях компетентности программиста. Идея в том, что каждый программист на своем пути развития проходит пять стадий развития:

Read More…

Два древних языка, которые нужно изучить программисту

08.01.2019

Почему нужно проинвестировать время в изучение двух древних языков Lisp и SmallTalk?

Я уверен, что это сделает вас на шаг ближе к стадиям развития специалист и эксперт.

Nikita Prokopov сделал отличный talk о стадиях компетентности программиста. Идея в том, что каждый программист на своем пути развития проходит пять стадий развития:

Никита ближе к концу доклада на примере собственного опыта сравнивает два языка: Java и Clojure и выдвигает предположение о том, что Java хорош для новичков, а Clojure это глоток свежего воздуха для уставших опытных программистов.

Read More…

How to improve ruby code with dup and tap methods

06.06.2018

Here is a piece of my old code, but it’s definitely could be improved.

def to_params
  h = ticket_params
    h[:activity] = extract_activity if extract_activity
    h[:event] = extract_event if extract_event
    h.delete(:state_event)
    h.delete(:activities_attributes)
  h
end

As you can see here, ‘h’ variable name is quite uncommunicative. Could it be refactored?

Let’s see, h=ticket_params. We call this because we don’t want to modify ticket_params. Is there any method which creates a copy?

It turns out we have dup method which creates a copy of an object, this is exactly what we wanted. Then, we have tap method, which allows us to dive in object internals and return then itself. Here is whole new piece of code after refactoring.

Read More…

Введение в Prolog

29.05.2018

Хочу такой туториал, с которым все понятно, куда коней запрягать. А его нет. Напишу тогда свой.

Итак, Пролог это не обычный язык программирования. Самый лучший пример использования это решение логической задачи типа

5 разных человек в 5 разных домах разного цвета, курят 5 разных марок сигарет, выращивают 5 разных видов животных, пьют 5 разных видов напитков. Вопрос: кто выращивает рыбок?

Подсказки:

Для решения задач такого типа очень подходит Prolog.
Язык оперирует всего тремя понятиями, это Факт (Fact), Правило (Rule) и Запрос (Query).

Read More…