I’m trying to use the raw clone system call to avoid having to refactor the pid 0 code into a function. Linux requires stacks to by 16 bytes, additionally, libc reserves 16 bits presumably to store ptid and ctid. The code below creates an aligned stack then exits from the child. After waiting for the ch…
Generate a report using awk
I have /etc/fstab entries on 100 servers and i’m trying to write a awk script to identify following. What i need is, first my awk script need to print the domain name, then it should print tools incorrectly mounted on store and is not valid, but kdump01 mounted correctly on kdump , ops mounted correctly…
How to include dependencies information when creating shared libraries in linux?
I’m writing a shared library based on libpthread.so. To build it, I use the following command: But when linking files that use libfoo.so, I have to specify the option -lpthread -lfoo not just -lfoo. In addition, ldd libfoo.so doesn’t show anything about libpthread.so. So, is there any way so that …
How to add a member to task_struct to bypass “compiletime_assert”
I need to add members to task_struct in Linux kernel 4.8.0. However, when I did it and tried to build the kernel, the error message shows: How to get rid of such errors and build my kernel successfully? Answer The assertion you’re encountering is triggered by a macro (CHECK_MEMBER_AT_END_OF) that checks…
Understanding Linux write performance
I’ve been doing some benchmarking to try and understand write performance on Linux, and I don’t understand the results I got (I’m using ext4 on Ubuntu 17.04, though I’m more interested in understanding ext4 if anything, than I am in comparing filesystems). Specifically, I understand th…
How to stop a shell script correctly?
I’ve written a small bash script to start a program every 3 seconds. This script is executed on startup and it saves its PID into a pidfile: The problem is, I can’t terminate the shell script by calling start_gps-read.sh stop. There it should read the pidfile and stop the inital process (from star…
How do I run a Python Qt file in Ubuntu?
Here’s the sample code that I want to run: The file is saved as sample.py. The following command isn’t working: Answer You need to start the Qt event loop by calling app.exec_() once you have initialised the widgets and called show() on your main window.
Apache executes MATLAB binary on CentOS 7 with SELinux
I am trying to trigger the run of a pre compiled MATLAB program on a CentOS 7 server form within an Apache context. The system allowes the user to upload some files. Then some sanity checks are performed. Then the MATLAB program is called and it performes some MATLAB magic. I installed the MATLAB environment …
Command works in terminal but not as alias in profile.d
I have a problem regarding an alias file in /etc/profile.d/. This isn’t anything important. I’m just interested why it isn’t working as expected. So basically I have the file 00-alias.sh at the path mentioned above and I wanted to make a shortcut which reads a specific line of a file. So thi…
How to grep two IP addresses and increase the value of the last number?
I’m pretty new to Linux and writing scripts etc. I have this task where I need to find an IP-address from a database and then grep a bunch of files with this IP and the next one to see, if they have any presence there. Currently I have to first write: and then And I have to manually change the