This question is inspired by the comments in Why am I getting an “execv(file, args)” error when using execl()?. When we use The second parameter seems redundant for me, can anyone help explain why we need this parameter? Answer In the old good days without graphical monitors and without mice, a text-only cons…
How to resize the block of a column
I have a single column of a file having many blocks and the blocks are separated by the > symbol. I want to resize all blocks to the same highest length by appending zero below them. My file is given below: file.txt and my expected output is given below I am trying to write a script, but it fails: Answer
Convert timestamp to date results in time out of range error
I`m trying to convert a timestamp to an ISO8601 datetime-string. E.g. The timestamp is fairly long, with nanoseconds precision, and when I use the full timestamp it returns the following error: date: time ‘1606982602015489365’ is out of range The expected result should be: 2020-12-03T09:03:22,015489300+01:00 …
As of today omnisharp doesn’t start properly (The “CheckForDuplicateFrameworkReferences” task could not be loaded from the assembly […])
The full error: The “CheckForDuplicateFrameworkReferences” task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/../tools/net472/Microsoft.NET.Build.Tasks.dll. Invalid Image Confirm that the declaration is correct, that the assembly and all its dep…
How to send and execute multiple events in one file stream by writting to “/dev/input/EventX”
I am writting to a specific eventX file in /dev/input/, to trigger “hardware” events. The problem is, the events get executed, only after the file has closed and to trigger new events, the file needs to be reopened. It’s as if all the events are put on a queue and then when the file closes, …
ncurses newterm following openpty
I am trying to figure out how to do the following: create a new pseudo-terminal open a ncurses screen running inside the (slave) pseudo terminal fork A) forward I/O from the terminal the program is running in (bash) to the new (slave) terminal OR B) exit leaving the ncurses program running in the new pty. Can…
Can someone help me to translate this line of code for bash shell?
I have been struggling to understand this line of code, could someone helpe me ? for what I understood the od means will convert the outout for octal format, -An I think it means input base which is no address but why ? and the -N is the length if someone could help to translate this while sintax I would
Trying to find empty files in other user home directory
I want to search for empty files inside the home directory of the user “adam” for example. Now i don’t know the right path for that user, so I need to get it from /etc/passwd with the following command: Output: /home/adam (for example) Then executing this command to find the empty files. Is …
How to print a list of xml elements and their properties in the Powershell REPL console?
Referencing: https://www.red-gate.com/simple-talk/sysadmin/powershell/powershell-data-basics-xml/ and: https://stackoverflow.com/a/65264118/4531180 how is a list of elements and their properties printed? Answer To address the for-display formatting problem: If you look closely at the sample output from your o…
Simple division of labour over threads is not reducing the time taken
I have been trying to improve computation times on a project by splitting the work into tasks/threads and it has not been working out very well. So I decided to make a simple test project to see if I can get it working in a very simple case and this also is not working out as I expected it to.