Set github actions for you repo

If you want to run tests/linters against you golang project, place something like the example below in .github/workflows/somename.yml to your project:

Good article on that — https://github.com/mvdan/github-actions-golang

Postgresql exercises

Basic querying — https://pgexercises.com/questions/basic/. Joins — https://pgexercises.com/questions/joins/. Data modification — https://pgexercises.com/questions/updates/. Aggregations — https://pgexercises.com/questions/aggregates/. That could be useful to refresh your memory. Not really up-to-date, but still pretty useful.

Mac OS — decrease pdf size via Preview app

To decrease the size of the .pdf filled with images, in Preview you can go to Export and set Quartz Filter→Reduce File Size before saving. If the images are too blurry for you, you can add your own profile. 1. Create a directory — /Library/Filters. 2. Add new filter file with unique filter — i.e. …

Read more

Parental control for Linux Mint

Time limiter with UI — Timekpr (https://www.linuxuprising.com/2019/11/timekpr-next-is-linux-parental-control.html) Domain blocker — Mintnanny (https://www.reallinuxuser.com/how-to-setup-parental-control-in-linux-mint/), too simple.

Shell: repeat a task multiple time

All shells (bash/zsh):

will run curl every 3 seconds until you break it. zsh specific:

will repeat it 5 times without any delay

Nullable fields in json generated from protobuf file

Native support With grpc v2 for go, protofile’s optional option is supported, so you don’t need to import proto extensions anymore and use things like google.protobuf.StringValue. my.proto

go mapper

Legacy way with extensions Null for nil value my.proto

go mapper

Which will lead to this json response

Omit a field …

Read more

Using tcpdump for k8s pods

You need wireshark to be installed on your local machine — download (more on this below). If you don’t have tcpdump installed inside the pod, you can install it with

Then, on your local machine:

If you want to see packets in grpc/http2, you can add a rule in Wireshark. For this, click …

Read more

Talk about pros and cons of GraphQL

Pros: Very flexible — clients decide which fields of which entities they need. Documentation and test UI are available by default. Cons: Code looks ugly. N+1 selects problem is hard to solve (most probably — with some ad-hoc). It’s harder to test as you don’t know all the use cases. Not a binary protocol — …

Read more

Datadog in a docker for integration tests and local dev

Run virtual machine Ubuntu/Windows on m1 macos

There is a program called UTM based on QEMU and developed for m1 MacBook virtualization. At least Ubuntu Server is working fine for me. https://mac.getutm.app/guide/. More info on this — https://eshop.macsales.com/blog/72081-utm-virtual-machine-on-m1-mac/