Author Archives: bullgare
mounterbank for mocking and stubbing http services (rest+graphql+grpc)
http://www.mbtest.org/docs/api/stubs can be used to stub http(s)/tcp/smtp protocols. And has community plugins for grpc, graphql, websockets. You can configure it with imposters.ejs like below:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ "port": 80, "protocol": "http", "defaultResponse": { "statusCode": 404, "headers": {} }, "stubs": [ <% include stubs/service1.json %>, <% include stubs/service2.json %>, <% include stubs/service3.json %> ] } |
docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 |
version: "3.5" services: mountebank: container_name: mountebank image: jkris/mountebank:latest volumes: - ./:/mountebank ports: - "15050:80" command: --configfile /mountebank/imposters.ejs --allowInjection |
HTTP Toolkit — another alternative to Charles Proxy for http calls interception
https://httptoolkit.com/ It has a free version which does something similar to Charles Proxy, so you can hack into the middle of any request/response according to the rules specified.
YouType to show flag icon for current locale on MacOS
It has reacher functionality, but I use it only to show a flag for my current locale in a tray. https://github.com/freefelt/YouType
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 …
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:
1 2 3 4 5 6 7 8 9 10 |
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Create a new foo."; parameters: { headers: { name: "My-Custom-Header"; description: "Some custom header description"; required: true; }; }; }; |
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 …
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.