Posts

Code Challenge – Armstrong Number

C

A Narcissistic Number (or Armstrong Number) is a positive number which is the sum of its own digits, each raised to the power of the number of digits in a given base. In this Kata, we will restrict ourselves to decimal (base 10). For example, take 153 (3 digits), which is narcissistic: 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153 and 1652 (4 digits), which isn’t: 1^4 + 6^4 + 5^4 + 2^4 = 1...

Code Challenge – Reverse String

C

Write a function that takes in a string of one or more words, and returns the same string, but with all words that have five or more letters reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is present. Examples: "Hey fellow warriors" --> "Hey wollef sroirraw" "This is a test --> "This...

How to manage multiple SSH key for Multiple Github Account

H

Recently I got a problem when trying to manage between my personal GitHub account and my GitHub work account. I usually use ssh to clone the remote GitHub repository and when the first time I tried to clone the repository from my work account, it’s still tried to pull using my personal ssh key instead of my work ssh key, even I already set it up. Here’s what I tried to do to fix it :...

VSCode WSL2 Exec format error

V

As the title say, I got this error today when trying to open VSCode from WSL2 terminal How do I fix it? First I remove vscode server installation folder on my home directory rm -rf ~/.vscode-server Logout from the wsl and then I turn off the WSL from windows terminal logout wsl --shutdown After that I start the WSL again and re run the code command code . Installing VS Code Server for x64...

Fix Error failed to solve with frontend dockerfile.v0 in WSL2

F

I got following error when trying to create a docker images in WSL2 failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: fork/exec /usr/bin/docker-credential-desktop.exe: exec format error, out: ` And to fix it, I need to export following environment variables in my terminal export DOCKER_BUILDKIT=0 export...