I am developing a simple shell program, a command line interpreter and I wanted to read input from the file line by line, so I used getline() function. At the first time, the program works correctly, however, when it reaches the end of the file, instead of terminating, it starts to read a file from the start …
Tag: linux
Is it possible to threshold the maximum GPU usage per user?
We have Ubuntu 18.04 installed machine with an RTX 2080 Ti GPU with about 3-4 users using it remotely. Is it possible to give a maximum threshold GPU usage per user (say 60%) so any other could use the rest? We are running tensorflow deep learning models if it helps to suggest an alternative. Answer My apolog…
Redirect output from terminal to libreoffice excel file
I am running a code on a particular core and am monitoring the cache misses in that particular core every second when my code is running. I can redirect that output to a .txt file. I wanted to know if it is possible to redirect the output to a libreoffice excel file which will allow me to generate a graph
Using $() in docker commands doesn’t seem to work
I want to stop all running docker containers with the command sudo docker stop $(docker ps -a -q). But when I run it, docker outputs Just running docker ps -a -q outputs the Docker IDs, but when I combine it with a Docker command, it doesn’t work. Thank you. Answer I didn’t realize that the sudo i…
Matlab’s fwrite: What happens to skipped bytes?
Suppose I have the following code: Then this would open an earlier specified file, skip the first 10 bytes and write 1 into the following two. But what happens to the first 10 bytes, assuming the opened file did not exist before? If I were to access one, what would I end up getting and why? Answer From the PO…
How can i get memory usage by a process in freeRTOS
As we all know, we can get RAM currently used by a process in Linux using commands like ps, top and vmstat or reading the pseudo-filesystem /proc. But how can i get the same information in freeRTOS where we could not use commands and there exist no file system. Answer First there’s no process context in…
Is it possible to disable spectre/meltdown/related patches on coreos?
Is it possible to disable Spectre and Meltdown patches on later builds of CoreOS? At my company we are running an entirely internal Kubernetes computer cluster, and are looking to get the performance back. On a normal linux system, you could boot with the kernel boot parameters: But adding: To /usr/share/oem/…
Errors occurs while the final step of gcc make
I build gcc for arm from scratch. In the final step of building gcc occur errors. I’m counting on your help. make Update Solution: bogdan@bogdan-VirtualBox:~/xtools/build2/final-gcc-2$ $gcc_src/configure –build=$buildmach –target=$targetmach –prefix=$installdir CC=gcc –with-sysro…
how to customize ssh log?
Goals of my ask: Implement a fail2ban which ban user. (For this I have a solution) Work environment: I connect to my machines with ssh-key protect with a password When a user type a wrong password for his ssh-key thrice I want to ban it for prevent attack Fail2ban parsed logs in /var/log/messages. Actually I …
Thread Program on Linux (Posix Thread)
I want to modify the multithread program on the Linux operating system using this Pthread API. I want to change that program into a program that has 2 threads that work together to add a number. But i don’t know how to change it, Thanks again for any help that can be offered. I am sorry,because I’…