I define a struct type as follows: where I have a pointer named obs_data: then I want to assign each object of the obs_data as follows: in the above, event is a struct from the inotify that captures the events associated with changes to a file or directory in Linux. when I run the above chunk of code in my
Tag: linux
Sh script not running using cron while running using terminal manually
I have a script .sh that works when executed manually but not working through cron : There are other .sh which runs perfectly with cron. I don’t know why this one doesn’t work. I compared the env output from the terminal and from cron and both are similar beside the user which has higher privilege…
Difference between `–privileged` and `–cap-add=all` in docker
Background: I am running a docker container which needs to load/remove a kernel module which makes USB devices attached to a remote server available on the host which I then want to make available in the container. It works when running the container with —-privileged and bind mounts for /lib/modules and /dev…
Wait Until Previous Command Completes
I have written a bash script on my MacMini to execute anytime a file has completed downloading. After the file download is complete, the mac mounts my NAS, renames the file, and then copies the file from the mac to the NAS, deletes the file from the mac and then unmounts the NAS. My issue is, sometimes, the N…
How can I run a .desktop file which starts a script file, but hides the terminal?
I wrote a .desktop file which should start an .sh file. It works good but opens a terminal with the logs of the started application. When I close the terminal also the application gets closed. The application is the webstorm IDE. Here is my .desktop file. Is there a way to hide the terminal and only start the…
What does “cat -” mean? Linux operators
I’ve created a file called fruits consisting of strawberry, kiwi, and banana. I wanted to find strawberry using the | pipe. While learning, I understand that not all commands support |, and we need to use cat -. How do we use this command? I’ve tried cat – | grep strawberry or cat – fr…
how to mount a local volume for my docker?
i am newbie to the Linux and docker. I am using the below command to run the docker: where; /home/pyman/PEYMAN is my local directory and 21bbc6c8f7ed is the image ID. after running this command, the workspace root changes to root@0ce2ee24bac0:/workspace# then I type jupyter notebook and run it, and it provide…
Redirect bash script output in editor without saving file
I have a script that outputs a few lines and I want to have it open in an editor on my system (nano, vim, whatever) to be ready to edit. However I don’t want to save it to a temporary file or variable but directly in the editor (I think I need to bring the out somehow into the editor’s
How to run Ubuntu utils from USB?
How can I extract OS utils/commands like “ps,who,lsof,netstat…” and run it from my USB? I need to extract these tools from clean OS linux and run it on infected computer. I tried just copy these tools from /bin but it is not working. Answer You need static linked binaries without external li…
Date: Invalid Date Linux/Raspberry pi os [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 y…