I am using an expect script to automatically answer prompts in a shell script designed to add Linux systems to active directory. I only have three prompts: location, username, password. I am using Ansible to execute it. The issue when the script executes, it tries to install ~ 49 rpms on the vm, adcli, realmd, etc. Yum begins install the
Tag: linux
What is the true getrusage resolution?
I’m trying to measure getrusage resolution via simple program: And when I run it, I usually get output similar to the following: ema@scv:~/tmp/getrusage$ ./gt u:0.000562 uz:0.000563 cnt:1 ema@scv:~/tmp/getrusage$ ./gt u:0.000553 uz:0.000554 cnt:1 ema@scv:~/tmp/getrusage$ ./gt u:0.000496 uz:0.000497 cnt:1 ema@scv:~/tmp/getrusage$ ./gt u:0.000475 uz:0.000476 cnt:1 Which seems to hint that the resolution of getrusage is around 1 microsecond. I thought it should be
Find and replace match after string in different file from bash script – not working
I have a string stored in a variable called newOccupation in file2.sh. When I run file2.sh, I would like it to replace whatever is after the word “occupation=” with the string stored in newOccupation. So in this case, after running the script, occupation=”Cashier” should be changed to occupation=”Teacher” I tried to replicate something from a very similar thread here Find
Python subprocess is not scalable by default, any simple solution you can recommend to make it scalable?
I have an application which does this: So Python program can start multiple long-lived processes on demand. If I stop main Python program and start again, it knows that sub-program-1.py should be started, because there is a record about status in DB that tells it. So simply it works fine when there is only one replica of Docker container, pod,
Docker delete all images script not working on Ubuntu
I need your help with a command I was using on Windows but on Ubuntu it won’t work for me. With this command I get: Answer Okay so I got it working with: Thanks for your efforts tho, it helped me with other problems 🙂
Writing a small file blocks for 20 ms
I discovered that on my Ubuntu 22 server, attempting to write to a file, often induces around 20ms delay, even when only writing a few bytes. Here is some basic code that demonstrates the problem: And here is the output: It seems more likely to happen if there is a bit of delay between attempts, and also more likely to
How to fix The terminal process “/usr/sbin/nologin” failed to launch (exit code: 1) error in VSCode [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
Add an index column to a csv using awk
How can I add an index to a csv file using awk? For example lets assume I have a file data.txt I would like to add another column, which is the index. Basically I would like an output of I was trying to use awk ‘{for (i=1; i<=NF; i++) print $i}’ but it does not seem to be working right.
Writing into a device file prints “Invalid argument”
I am currently working on a device driver where I want to write a sentence to that driver and display it in the kernel. Reading an internal buffer and calling the driver with cat works perfectly fine. However, if I try to write to the device driver it returns the following message: I have the following code for my device
Failure of bash script called via command substitution does not stop parent script
I have a bash script (exp1.sh) which invokes another bash script exp2.sh. I want the first script to fail fast when second script exits with error. (The second script actually reads rows from database to stdout, in case of database connectivity error it returns nonzero exit code.) I expect the set -e option causes premature termination of first script exp1.sh.