development

## consul-vault: Fun with CLI

consul-vaulttools have a graphical and command line interfaces. I found CLI faster for development. So I’m sharing how to setup and use consul. Steps Set consul and vault path. export VAULT_ADDR=https://xxxx export CONSUL_HTTP_ADDR=xxxx Login to vault vault login -method=github -path=github Install consul-template. Run the template. consul-template -vault-renew-token=false -template “./config.tmpl:/tmp/out.json” -log-level debug You can also access […]

development

## Codility: Solution of Max Mushroom Picking Problem in Python

You are given a non-empty, zero-indexed array A of n (1 ¬ n ¬ 100 000) integers a0, a1, . . . , an−1 (0 ¬ ai ¬ 1 000). This array represents number of mushrooms growing on the consecutive spots along a road. You are also given integers k and m (0 ¬ k, […]

development

## Codility: Maxed Counters Problem

Problem You are given N counters, initially set to 0, and you have two possible operations on them: > – _increase(X)_ − counter X is increased by 1, > – _max counter_ − all counters are set to the maximum value of any counter. A non-empty array A of M integers is given. This array […]

## Codeforces Problem: Azamon Web Services: Solution in Python

Problem Given two string, find if using max one swap of characters, the first string is lexicographically smaller than the other string. Solution The logic is as follows: Create an index map of each character in the string A. Compare String A & String B, character-by-character. If characters are the same, move to the next […]

development

## Assertion failed: (!STR_EMBED_P(shared)), function str_new_frozen, file string.c, line 1075.

Solution If you workflow has Docker container, please stop the containers. Check with \$docker ps and verify that all containers are in exited state. Set the right Ruby version. Find out from the project repo Makefile, build scripts. Update the bundler to same version as of Ruby. Reference https://bugs.ruby-lang.org/issues/11946 https://github.com/rbenv/rbenv https://philna.sh/blog/2017/03/22/always-install-bundler-alongside-ruby-with-rbenv/