I want to ask, how I can remove some string with command in linux? and the output: Answer try: Making field separator as | then substituting the starting zeros with NULL of 111th field as per your requirements, mentioning 1 will print the newly edited line(if any zeros were replaced with NULL), setting Output…
Tag: linux
Is there any drawback to using functions instead of aliases?
Bash functions are more versatile than aliases. For example, they accept parameters. Is there any drawback to going full function style and completely drop aliases, even for simple cases? I can imagine that maybe functions are more resource intensive, but have no data to back that up. Any other reason to keep…
How to make parent process invoke wait when child exits with parent unblocked in Linux?
Here is an example, waitpid system call will block parent process until child process exits: What I want to achieve is parent process won’t be blocked, this can be done by using signal, so I changed my code: But another problem comes, if child exit before signal(SIGCHLD, handler), child will be a zombie…
With hypervisor, How to surveillance the time when target process is created or terminated
I would like to make my hypervisor on linux for detecting and surveillance target process like a malware. To achieve this, the hypervisor need to detect processes that is created or terminated or task switched. On intel CPU, I knew that cr3 register indicate those roles. for example, when cr3 register value i…
Reading user input as an integer
I wrote an Assembly program (x86_64 Linux NASM) that prints an integer to console, based in the algorithm suggested my the comments in this post, which is basically this: All works just fine under the following script: After compiling it, the number 567 gets printed on the screen (console). But if I try to do…
OBIEE 12.2.1.2 – Interface customizations
I am facing problems with interface customizations in the latest OBIEE release. Is it possible to “hide” the Mobile, VA and BiPublisher options – marked red in the appendix. (Privileges in Administration and roles in EM are configured – users can not access Mobile, BiPub however the bu…
Wrapping python+keras+tensorflow ‘as a service’ to receive prediction requests from PHP?
I run a python script in order to load keras, tensorflow and the keras model. Then I can start making predictions, but this takes a few seconds to load everything. I can loop inside the python script and get good performance predicting in batches, but I want to have also good performance with via independent …
How to save changes from two variables?
I need to write a bash script, which checks if a new user logged in within 5 seconds, and if so, print it’s details: name, username, …… I already have the following code, which checks if a new user have logged in: Answer If I understand the question correctly, you want to find the difference…
Concatenate float with a string inside the arguments
Right off the bat, no this is not a duplicate. I have been searching for hours to do this but it might be simple as I started coding a few weeks ago. How do I concatenate a string with a float inside the arguments? I want to be able to do this, but it is not working: Yes, this is
pthread mutex does not work correctly on macOS
Currently I am learning POSIX threads on Linux. The following example is counting how many 3(int) there are in an integer array, which returns a correct answer on CentOS 6.5 but a wrong one on macOS 10.12.4. The answer should be 64 * 1024 * 1024 / 2 = 67,108,864 / 2 = 33,554,432. But the answer on macOS is