Author Archives: bullgare

Fast and simple mock server app by swagger file

I’ve tried Mockoon for mocking by swagger/OpenAPI spec file, and it works pretty good. It autogenerates the response based on swagger format, and you are able to update any response field the way you want, save your changes and run the mock server with one click on the port you specify. It is a separate …

Read more

How to install multiple versions of go on mac m1

For instance, I want to try a new beta, go1.18beta2 (I check if it’s available on the download page). And I already have a regular go1.17, that I want to use as a default one. To do so, I need to do this:

Then I can check if it’s okay — go1.18beta2 version #go …

Read more

Types of load tests

Load test types explained by k6. Smoke tests Verify that your system can handle minimal load, without any problems. Like 1 rps for 1 minute. Load tests Assess system performance in terms of concurrent users or requests per second. If you want to make sure that you can handle 500 rps, you can gradually increase …

Read more

LSM-tree for write-intensive storages

LSM, or Log-structured Merge-Tree is used to improve the performance for write-intensive storages. 1. Writes are merged in memory using red-black tree, then flushed to disk sorted — SSTable or Sorted Strings Table. 2. For reads, we use Sparse Index to speed up the seeks, and Bloom Filter to speed up the non-present keys checks. …

Read more

Go memory hints

Below hints are related to very hot places of CPU/memory bound programs. And in regular (i/o bound) programs do not make much sense. Stack vs heap Go’s compiler goal is to allocate on the stack as much as possible. As it will reduce the amount of data that needs to be cleaned by the Garbage …

Read more

Create SQS queues on localstack container start

Put this file to your filesystem as ←anyname.sh→:

For instance, ./localstack_bootstrap/sqs_bootstrap.sh. Don’t forget to run chmod +x ./localstack_bootstrap/sqs_bootstrap.sh. Add this line to your docker-compose.yml: — ./localstack_bootstrap:/docker-entrypoint-initaws.d/. So it could look like this:

Then your queues can be reached by URLs http://localhost:4566/000000000000/queue1 and http://localhost:4566/000000000000/queue2. Further reading: https://docs.aws.amazon.com/cli/latest/reference/sqs/create-queue.html https://joerg-pfruender.github.io/software/docker/microservices/testing/2020/01/25/Localstack_in_Docker.html

Postgresql index naming convention

Use the table name as the prefix. Use the following suffixes: _pkey for a Primary Key constraint _key for a Unique constraint _excl for an Exclusion constraint _idx for any other kind of index _fkey for a Foreign key _check for a Check constraint https://stackoverflow.com/a/4108266/801426 Also implicitly mentioned here — https://www.postgresql.org/docs/current/sql-altertable.html

Heroes 3 on MacOS with M1 Apple Silicon

Initial installation 1. You need Parallels Desktop with M1 support — https://www.parallels.com/ru/products/desktop/trial/ 2. Also you need an insider account on Microsoft web site to download win 11 for arm — https://insider.windows.com/ru-ru/ 3. Then you need to download Win 11 for arm — https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewARM64 4. Download Heroes 3 Hota on the internet (many links are there). …

Read more

FreeCAD to generate gcode

You should switch Workbench to «Mesh Design», then select your shape in the left bar, and go to Menu→Meshes→Create Mesh from the shape. More details on parameters — https://www.xsim.info/articles/FreeCAD/en-US/HowTo/Create-surface-meshes-from-solids.html

DMDE to recover HDD disks

https://dmde.com/download.html