How to create a python virtual environment for a project in Linux

Python interpreters can be installed globally system-wide or as a virtual environment within a project folder. The advantage of within a virtual environment is isolation of the packages from system-wide use and execution. To set up a virtual environment for a project, open a terminal window and enter the following commands: $ sudo apt-get install … Continue reading How to create a python virtual environment for a project in Linux

How to convert PNG images in a directory to JPG using Python

To convert several PNG images to JPG images, the convert command in Linux was not good enough and gave errors. It seems it could not process the large volume of PNG files. Therefore, the image files were converted from PNG to JPG using Python using the following code. Before using the code, Python 3 gave … Continue reading How to convert PNG images in a directory to JPG using Python

How to replace line feeds in a text file with Python

The below Python code will replace line feeds in a text file with space or replace consecutive line feeds with one line feed. I named this replacelf.py. # file outtext in the current directory file_path = r"./outtext" # Note that the file has to be opened in binary mode. with open(file_path, "rb") as open_file: #read … Continue reading How to replace line feeds in a text file with Python

How to sort and rename files in Python on Linux and use tesseract OCR to extract text to a file

In order to convert a series of images with text as an image in them to text files, the best tool is tesseract. It is quite old, but very reliable when it comes to looking for and extracting text from images. After saving some screen shots as jpg files, it was found their names contained … Continue reading How to sort and rename files in Python on Linux and use tesseract OCR to extract text to a file

How to get dark theme in Geany Code Editor on LinuxMint, Debian, Xubuntu Linux

Even though a dark theme is chosen for the desktop in XFCE, geany will display it's toolbars and window elements in dark mode, but the code displays with a white background. To make it a dark background, go to Edit -> Preferences -> Editor -> Display and check the box that says "Invert syntax highlighting … Continue reading How to get dark theme in Geany Code Editor on LinuxMint, Debian, Xubuntu Linux

There’s something about data backups – what’s the big deal!

It’s been almost 12 years since using the 128 MB Transcend USB hard drive for data backups. On the other hand there’s also a 128 KB Transcend USB pen drive from 2006 that still works quite well today plus a Kingston 1 GB USB pen drive. In 12 years, storage device and storage media technology … Continue reading There’s something about data backups – what’s the big deal!

How to read MS Access database using mdbtools in Linux

To read MS Access databases, in our case DBName.mdb in Linux, use mdbtools. To install mdbtools, open a terminal window and enter the following command:$ sudo apt install mdbtools <enter> To query the database:$ mdb-queries DBName.mdb <enter> To list it's tables:$ mdb-tables DBName.mdb <enter> To view help on mdb-export to export tables to a txt … Continue reading How to read MS Access database using mdbtools in Linux

How to override default navbar link colors of Bootstrap 5 to custom color

How much ever I tried to change the color of the navbar links in Bootstrap 5, it never did the change. To do the change, the following had to be done in the CSS stylesheet file. .nav-link { color: #dfb97c !important; } !important allows the default color given by Bootstrap 5 to be overridden by … Continue reading How to override default navbar link colors of Bootstrap 5 to custom color

How to fix issue if autocomplete or intellisense does not work in vscode for express.js

If the below line is used in the javascript code:const express = require(express); then autocomplete / intellisense will not work. It will not display the relevant methods as shown in the image below. This is the correct code to use:const express = require("express"); The quotation marks make the difference and the following image shows the … Continue reading How to fix issue if autocomplete or intellisense does not work in vscode for express.js