I have a list of files in a particular directory as shown below: Each file name ends with timestamp in it. Now I need to find one latest file which was modified or created just a minute back in ansible. If there is no file like that then return successfully from the ansible by logging “cannot find any f…
Tag: linux
for loop in bash simply prints n times the command instead of reiterating
I have a input.txt file with over 6000 lines. If a line a has over 10 words then I want it to be split but not at the 10th word but where the first comma character appears. And, if the new line also has more than 10 words, then it should also be split, and keep reiterating this process 7
Blocking USB HID in Linux
I’m programming a kioks device and i want to block all usb devices expect 2 kind of usb.One is my touch screen hid usb and the other one is usb storage devices.Actually i tried write rules under udev.I tried this code : But this one is blocking all usb devices.So i tried to add another rule to unblock s…
How to concatenate a query with knextjs
Im trying to archive this SQL to Knext but i dont know how to do it THIS IS THE ORIGINAL QUERY and is fully functional in postgresql using the console THIS IS HOW IM TRYING TO ARCHIVE with knextjs Expected result: Get: Answer Ok. this is the final and correct answer using the same subquery; thanks to Mikael f…
Ghost – Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
I have been trying for a long time to debug my ghost blog as you can see here. I have made some progress the problem seems to be related to an error on the bootstrap socket of ghost. My config.production.json in my Digital Ocean server is: When running ghost run I get: Update Its running on Ubuntu 18.04.3 LTS…
What is the state of page tables after kexec’ing into an ELF x86_64 binary?
I’m kexec’ing into a binary i wrote compiled to an x86_64 ELF. It runs fine. Since it’s a 64-bit binary, i know the processor must be in 64-bit long mode. Which requires paging to be used, so I know paging must be turned on. My question is, what is the state of these page tables? Is there so…
How to change the permission mode in Linux?
To grant read and write permissions to the owner and to remove execution permission from the group should it be two commands as, or could it be can done in a single command? Answer
Use awk to replace one column value with another column value if the first letter is not a alphabet letter
I have the following csv file: What I want to do is to replace ID colunm’s value with NID value if the first letter in ID is not a alphabet letter. So the output is expected to be This is just a sample. My original data size is much bigger so I have to use awk. The key issue is
Assembly on Raspberry Pi gives the error “command not found” for every command
This is my first time using assembly on a Raspberry Pi. I don’t have sudo access so I can’t try running it that way. Anytime I try to do sudo it just throws an error. When I try to run my program it returns this: and so on for all the lines in the file. I have no idea how
Why is the following shell command working when executed directly in command line, but not working when executed through C program using popen/system?
The command is : ps -c -p | tr -s ” ” | cut -d ” ” -f 2,6-10,13 | grep ‘R’ I am running it through adb shell. Basically, I want a list of processes (and certain parameters) which are currently in the run queue. This is working fine if I run it directly through the shell. Ho…