Category "linux"

copy files from folder based on csv file list

I want to copy certain files from a folder based on a list stored in a .csv file. Previously I used rsync to do this using rsync -a /source/directory --files-fr

Duplicate camera stream not working with custom frame width and height

I have been able to duplicated my webcam stream on ubuntu with gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video2 t.

Duplicate camera stream not working with custom frame width and height

I have been able to duplicated my webcam stream on ubuntu with gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video2 t.

How to create an alias composed of many commands?

Commands are: git checkout master git remote add upstream [email protected]:minio/console.git git fetch upstream git checkout master git rebase upstream/master Wh

"sleep 5" doesn't delay script for five seconds [closed]

When I use the sleep command and execute the script the sleep doesn't work. The code just gets executed without stopping for the expected 5 se

Splitting a file based on number of records and file size

I have a file which contains 100 records... Each record has different size, like some are 1 KB while some are 1 MB. I want to split the file based upon number o

Raspberry pi 64 bit Os showing Unable to locate package libjasper-dev. how to fix this?

I am using a raspberry pi 4. And I installed a 64-bit (not 32-bit) Raspberry Pi OS. When I tried to install libjasper-dev using the command 'sudo apt-get instal

run script when chrony steps clock

I need to start a certain service after system clock was correctly stepped by crony. System time is maintained by chrony (chronyd (chrony) version 3.5 (+CMDMON

vscode ssh develop Go cannot stop at breakpoint when code under /home/{username}/ floder

I have the remote develop problem. I want to ask for some advices to solve this problem. when my code under ~/ floder, debug cannot stop at breakpoints: when

Loading some packages with Rstudio server does not work, while it works with R server

I am using Rstudio server on a remote server and I have some packages already installed. When I try to load libraries like raster or terra using Rstudio server,

Check log file for error only for last 10 mins

I've a log file with below text, [2022-05-05T22:25:58,523] Text/debug data I want to fetch log data for errors in only last 10 mins to configure in cron. How t

bash: No such file or directory when file is clearly present

I have a shell script located at "/home/pi/scripts/take-snapshot.sh" but when ever I try to execute it I get a error that the file is not present. the following

How can I put a prefix on every information outputed from GDB?

I would like to put a prefix, like "GDB> ", on every output from gdb to distinguish it from the output of my program. Is that possible? An example: test.c #i

Compile and run assembly on macbook

I'm taking a course on computer structure and I'm lost. I was given the following file: Hello.s: #This is a simple "Hello World!" program .section .rodat

Persian (Arabic) Support for Visual Studio Code

Visual Studio Code does not seem to display Persian or Arabic scripts nicely in the terminal window. I can confirm that on Linux, but not sure about macOS or Wi

bash oneliner search for files and dump name and content into new file

as title says I need to write a bash oneliner that finds all txt files and, for each, writes name and content into another file. So far I wrote: find . -name "*

How do I create a child process with clone and use waitpid to wait until its done?

The code below is wrong for at least 2 reasons. I'll be rewriting this in assembly so I'll need the solution to be only linux system calls. What I'd like to do

Changing the broadway 2.0 tab name (GTK+3.0)

When running Broadway back-end, the default tab name is "broadway 2.0". I wish to change this to something more meaningful but I'm running into a couple of dead

Bash script: read 30000 records from file and run multiple process in parallel

txt with more than 30000 records. All records are one for line and is an IP like this: 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6 1

sed replacing first occurence of characters in each line of file only if they are first 2 characters

Is it possible using sed to replace the first occurrence of a character or substring in line of file only if it is the first 2 characters in the line? For examp