Letsencrypt — easy way

Now you can install certbot-nginx and it will do everything for you.

And then

If it does not work, try this sudo certbot -d example.com -d www.example.com and then select nginx in a prompt. https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-7

Install postgresql 11 on CentOs7

Just what to do, no discussion.

Postgres in docker: random «unique violation» errors

While running postgres in docker (for development, of course), from time to time I just run into errors like «Duplicate Key Value Violates Unique Constraint». I found the solution (thanks to this answer, for sure — https://stackoverflow.com/a/47089825/801426): if you have a table called «[table]», just do this

Gitlab-ci: build go app with docker as a docker image

Preparations [TO BE UPDATED LATER] My gitlab-ci.yml

My Dockerfile

Pulling from your private registry Create deploy token as described here. After that, you can do this:

Useful links: https://dev.to/hypnoglow/how-to-make-friends-with-golang-docker-and-gitlab-ci-4bil https://docs.gitlab.com/ee/ci/docker/using_docker_build.html https://medium.com/@tonistiigi/advanced-multi-stage-build-patterns-6f741b852fae https://docs.gitlab.com/ee/ci/yaml/ (full description of gitlab-ci.yml) https://about.gitlab.com/blog/2017/11/27/go-tools-and-gitlab-how-to-do-continuous-integration-like-a-boss/ https://gitlab.com/hypnoglow/example-go-docker-gitlab/blob/master/.gitlab-ci.yml Somewhat useful: https://blog.lwolf.org/post/how-to-build-tiny-golang-docker-images-with-gitlab-ci/ https://angristan.xyz/build-push-docker-images-gitlab-ci/ https://docs.gitlab.com/ee/user/packages/container_registry/#use-images-from-gitlab-container-registry https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-centos-7 (it says to do sudo usermod -aG docker …

Read more

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