Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

01 September 2025

How to extract texts from an image on ubuntu?

To extract English texts - 
$ sudo apt install tesseract-ocr
$ tesseract your_image_name.png extracted_text.txt 

 

To extract Simplified Chinese texts -

$ sudo apt install tesseract-ocr tesseract-ocr-chi-sim

$ tesseract your_image.tiff output_text.txt -l chi_sim

 

To extract Traditional Chinese texts -

$ sudo apt install tesseract-ocr tesseract-ocr-chi-tra

$ tesseract your_image.tiff output_text.txt -l chi_tra

 

To extract multiple languages, e.g. English and Simplified Chinese, and Traditional Chinese texts -

$ tesseract your_image.tiff output_text.txt -l eng+chi_sim+chi_tra

09 May 2024

How to create a virtual environment with preinstalled packages as in requirements.txt

https://stackoverflow.com/questions/41427500/creating-a-virtualenv-with-preinstalled-packages-as-in-requirements-txt

$ git clone <repo>

$ cd <repo>

$ sudo apt install python3-venv (if you don't already have virtualenv installed)

$ python3 -m venv venv/ to create your new environment (called 'venv/' here)

$ source venv/bin/activate to enter the virtual environment

$ pip install -r requirements.txt to install the requirements in the current environment

08 November 2023

How to install .deb files on Ubuntu?

$ sudo dpkg -i xxx.deb

if you still faces issues with dependencies execute the following command to install the required dependencies.

$ sudo apt-get install -f

 

18 September 2023

3 Easy Ways to Download YouTube Videos in Ubuntu and Other Linux Distributions 3. Command line tool for downloading YouTube videos

https://itsfoss.com/download-youtube-videos-ubuntu/


1. Download YouTube Videos using Firefox Add-on ‘Video DownloadHelper’

2. GUI applications to download YouTube videos on Linux

3. Command line tool for downloading YouTube videos

17 September 2023

How to copy from vim to system clipboard on ubuntu?

https://superuser.com/questions/1559544/how-to-copy-from-vim-to-clipboard-on-ubuntu-20-04


You need to make sure clipboard is activated (which is probably not the case).

Run : vim --version | grep 'clipboard'

if you get "-clipboard" then you would have to install vim again with the "clipboard" functionality.

You can do it it by installing "vim-gtk3" or "gvim".

Solution

sudo apt-get install vim-gtk3 -y

With that, you will be able to copy into clipboard by typing (including the plus) "+y

How to delete content in the system clipboard on ubuntu?

Install xsel -

$ sudo apt install xsel

 

Run 

$ xsel -bc

16 September 2023

Copy text from pictures on Linux with Textsnatcher

https://www.addictivetips.com/ubuntu-linux-tips/copy-text-from-pictures-on-linux-with-textsnatcher/

$ sudo apt install flatpak

$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

$sudo flatpak install flathub com.github.rajsolai.textsnatcher


Step 1: With Textsnatcher open, find the “Snatch Now!” button and click on it with the mouse. After selecting this button, Textsnatcher should open up the default screenshot tool for your Linux desktop.

Note: if you use Gnome or a Gnome-based desktop environment, it will launch the Gnome screenshot tool.

Step 2: With the screenshot tool open, find the “Select an area to grab” option and click on it with the mouse. When you select this button, the screenshot tool will allow you to take a screenshot of a selected area on the desktop.

Step 3: After you’ve selected the “select an area to grab” option, your mouse cursor will become a cross icon. Click and drag over the area you wish to extract text from.

Step 4: Once you’ve selected an area on the desktop with the cursor, the screenshot tool will take a picture. It will open up a dialog box that says, “Share this screenshot with TextSnatcher?”

Select the “Share” button to share the screenshot to Textsnatcher so that it can extract the text contents of the image.

Step 5: With the screenshot exported to Textsnatcher, you should see a message that says “Checkout Clipboard.” From here, go to a text editor (or any other text field) and press Ctrl + V hotkey to paste the text.

02 May 2023

How to install Google Chrome browser on Ubuntu 22.04?

https://linuxhint.com/install-google-chrome-on-ubuntu-22-04/


$ sudo apt update

$ sudo apt install wget

$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

$ sudo dpkg -i google-chrome-stable_current_amd64.deb

 To run Google Chrome,

$ google-chrome


23 March 2023

How to install Python, pip, and venv on Ubuntu 22.04?

Method 1. Simpler Method

$ sudo apt update

$ sudo apt install python3
$ sudo apt install python3-pip
$ sudo apt install python3-venv
 
 
Method 2. Install the Latest Version