Author Archives: bullgare

Automark messages as read in all folders, except inbox

Well, you can do it with Google Apps Scripts. It is a nice google automation thing to use for multiple purposes. Here is how you can do this — https://www.androidpolice.com/2018/03/31/automatically-mark-archived-emails-read-gmail-inbox/. I decided not to touch the Spam folder together with Inbox.

Free weather APIs

https://openweathermap.org/api — old, odd, but works https://www.weatherbit.io/api https://developer.accuweather.com/accuweather-forecast-api/apis to be discovered https://darksky.net/dev/docs to be discovered http://api.weather2020.com/ to be discovered, looks abandoned https://www.aerisweather.com/support/docs/api/ works, but keys are for valid for 3 months only https://www.wunderground.com/api died (https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api)

How to split disk pool on synology nas

I have a Synology NAS DS 218+. When I bought it, I decided to make a RAID1 pool from two disks. But after time passed, I realized that I don’t have enough space to store all files. And I decided to make two separate disks instead of one RAID1. RAID0 is worse for me comparing …

Read more

Another cool article on using PostgreSQL+pgBouncer with go

Extremely interesting and very practical talk about problems occurring with go+pgBouncer (in Russian, sorry). https://habr.com/ru/company/oleg-bunin/blog/461935/ And a video on that: https://www.youtube.com/watch?v=Uojy57I-xP0

Remove auto-restarting process on mac

I got problems with a process which descrbibed itself on my mac as /Library/PrivilegedHelperTools/com.alibaba.security.aliedr. It was launched with root privileges and was started by the system after sudo pkill -f com.alibaba.security.aliedr. Renaming a file in the dir and rebooting did not help. What did help is this article — https://www.macworld.com/article/2047747/take-control-of-startup-and-login-items.html. I’ve found it and renamed …

Read more

env-file parser for Goland

You can use env-file parser for running and debugging your app in Jetbrains’ products like Goland. It’s pretty simple and works. https://github.com/Ashald/EnvFile

Linux. History of system usage

There is a way to monitor your system usage and log to a file easily — with atop command. On my Ubuntu it can be installed with

It can be started as a top command — it’s output almost the same. But the most interesting feature is that it starts a daemon that logs …

Read more

Style guide for golang project file structure

Highly recommended. It has a couple of odds like not explaining about /test dir (I assume, they wanted to say to put there only e2e and other integrational tests, not unit-test as the latter should be kept together with the code itself in files like …_test.go). But it’s awesome in general. https://github.com/golang-standards/project-layout

Golang patterns. Worker pool

Further reading: https://gobyexample.com/worker-pools

PgBouncer and prepared statements

In our system, we use connection pooler called PgBouncer as a proxy to PostgreSQL server. PgBouncer has two main modes Session pooling mode This mode is less performant (it’s a default mode). When a client connects, a server connection will be assigned to it for the whole duration it stays connected. So it does not …

Read more