Author Archives: bullgare

Add new video sticker pack to telegram

If you have an animated gif-file, you can convert it to webm video respecting rules described in the docs (https://core.telegram.org/stickers#video-stickers-and-emoji): For stickers, one side must be exactly 512 pixels in size – the other side can be 512 pixels or less. For emoji, the video must be exactly 100×100 pixels in size Video duration must …

Read more

Docker and Kubernetes basics for developers

Docker Docker containers are much more lightweight compared to classic VMs as they leverage host OS instead of starting their own OS. Containers are using 2 features of Linux-based OS: Namespaces and Cgroups (Control Groups). Namespace Lets you allocate resources in an isolated environment (like a sandbox). On a container start, docker daemon generates a …

Read more

Go’s Concurrency and Channel Internals

Go is implementing CSP (Communicating Sequential Processing): processes are communicating through channels, they can block each other while waiting for read/writes to channels. Actor model makes inter-process communications more explicit and non-blocking. CSP vs Actor explained — https://dev.to/karanpratapsingh/csp-vs-actor-model-for-concurrency-1cpg. Channels requirements goroutine-safe store and pass data across goroutines FIFO can block/unblock goroutines

Protobuf: add header parameters

They finally added it to the grpc-gateway: https://github.com/grpc-ecosystem/grpc-gateway/pull/3010/files#diff-c255ac405628aada46c25a2c9765605e9f823bc523d3739fd3fa71d4bcbf5c99. So, to use it you can just update to the version 2.14.0 or above — https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v2.14.0, and add something like this to your protofile:

Go scheduler details

Scheduler was implemented by Dmitry Vyukov in go 1.1 and lives in runtime/proc.go. Good resources https://www.youtube.com/watch?v=-K11rY57K7k — video by Dmitry Vyukov (slides as pdf) https://www.ardanlabs.com/blog/2018/08/scheduling-in-go-part2.html — nice article by Bill Kennedy in 3 parts. Most of the images below are taken from this article. Main ideas Goroutines are very light weight (~2KB+) and very cheap …

Read more

Golang. Adding a json body to POST request in protofile

It could be a bit tricky, and I failed to find a good example for it.

How to install Outline VPN on a random VPS server

In Ountline Manager, when you add a new server, select an option called «Set up Outline everywhere».

MySQL 5.7 alter table blocking operations

Table 14.12 Online DDL Support for Column Operations

How to reinstall MacOS on M1 MacBook wiping previous admin

I’ve run into an issue when I gave my older MacBook with M1 chip to my wife. Even after reinstalling MacOS with a proper user for her and restoring from Time Machine, her admin account was not really the admin of that laptop. She was unable to create new users (MacOs failed to set a …

Read more

MySQL: generate and insert a range of dummy rows

There are a lot of ways to do this, but the one below is the most straightforward to me.