Hi there 馃憢

Welcome to Code Genos Computers, Programming and Development Blog

Pass Docker Env Variables to Vite Containerized Vue.js on Docker Run

Environment variables can only be used in Vue.js applications at build time and the variables are hardcoded in javascript files during build. When you build docker image for the Vue.js application, you use the same image for test and production environments. But the Vue.js application config values can be different in test and production environments. For example: api url configuration value. Since the variables are different in those environments you must pass the configuration values for test and production environments at docker run:...

September 13, 2023 路 4 min 路 768 words 路 CodeGenos

How to Transfer Files with Scp Tool on Linux

The other day I needed to copy files from my local machine to my Raspberry Pi with DietPi without desktop installed. My only method of accessing the Raspberry Pi was via ssh. I wanted to transfer files in the simplest way on terminal. I searched how to make this work and found the scp tool. In this article i鈥檒l show you how to transfer files and folders using scp command-line tool....

September 8, 2023 路 3 min 路 631 words 路 CodeGenos

Typescript: Extend Array type with sum count avg min max Aggregates

In this article i鈥檒l show you how to implement sum, count, avg, min and max aggregate functions that applies to all Array instances in typescript. First we will learn how to extend Array type: Extend Array prototype In javascript, you can extend an existing class by adding a new function to its prototype without modifying its source code. To add new function to Array type, you basically set the new function to Array....

September 3, 2023 路 4 min 路 770 words 路 CodeGenos

How to Reduce Node.js Docker Image Size?

I had a web application which is written in Node.js and I wanted to dockerize it. So went to the Node.js official site and found Dockerizing a Node.js web app article. I created the Dockerfile as it says in the article. Then I built the docker image with docker build, the created image size was 1.09GB Dockerfile which produce 1.09GB docker image FROM node:18 # Create app directory WORKDIR /usr/src/app # Install app dependencies # A wildcard is used to ensure both package....

August 30, 2023 路 4 min 路 646 words 路 CodeGenos

Build Multi Platform Docker Images with Buildx

Intro I developed a node.js application and i wanted to run it on Raspberry Pi as docker container. So I built a Docker image using docker build on my machine (Lubuntu 23.04 x64) and pushed it to the Docker registry. Then I logged into Raspberry Pi and pulled the image from docker registry and run the docker container. But it failed to run with exit code 139. Problem Traditionally, when you build a Docker image using docker build, it builds the image for the architecture of the machine you鈥檙e running the docker build command on....

August 27, 2023 路 4 min 路 670 words 路 CodeGenos

Managing Multiple Github Accounts with Git Credential Manager

If you have more than one github account and want to contribute your projects from one computer, you can manage accounts using git credential manager. Step 1 Install git credential manager. (You can read install instructions) For debian users, download the latest .deb package, and run the following: sudo dpkg -i <path-to-package> Step 2 Configure git credential manager: git-credential-manager configure Output Configuring component 'Git Credential Manager'... Configuring component 'Azure Repos provider'....

August 13, 2023 路 3 min 路 585 words 路 CodeGenos

How to Fix Touchpad Tap to Click Problem via Xorg Config on Ubuntu

Problem Touchpad tap-to-click was not working when i first installed Ubuntu linux. I will show you how to fix this problem. Check input devices One way to check which devices are managed by libinput is the xorg logfile. To view the devices, run the follwing command: grep -e "Using input driver 'libinput'" /var/log/xorg.conf.d/Xorg.0.log [ 181.523] (II) Using input driver 'libinput' for 'Video Bus' [ 181.604] (II) Using input driver 'libinput' for 'Integrated Camera: Integrated C' [ 181....

August 11, 2023 路 2 min 路 410 words 路 CodeGenos

Firefox Executable File not Found in $PATH for Flatpak on Linux

Intro When an application is installed via apt package management tool, you can start running the application when you type the application name in terminal, for example firefox. But when you install the application with Flatpak utility you must run the Flatpak application using this command: flatpak run org.mozilla.firefox Problem But when i want to authenticate my command-line sessions with GitHub using Github CLI Tool command gh auth login with HTTPS protocol and Login with a web browser options, i get this error:...

August 8, 2023 路 4 min 路 736 words 路 CodeGenos