When you accessing block of memory (f.e. in real case using mmap) correct pointer for sem_t have to by multiple of 4. If it is not, then sem_init() still doesn’t return -1 (error value), but sem_t isn’t valid. Why it is working like this? Below code that is showing behaviour of semaphores. Answer …
Generating SCTP traffic in linux?
I want to simulate a network with two multihoomed SCTP hosts. After I have enabled SCTP in my Linux Kernel, what would be the next step towards setting up a network? Is this possible to do so using only one computer with virtual machines? What programs should I use for generating SCTP traffic? Thanks in advan…
How does the dynamic loader load libs with correct arch version
For the aarch64 based system, if I provide both arm and arm64 version of library libtest.so in different path, and added the paths into /etc/ld.so.conf. I want to know if a application depends on this library, how does the loader find out the correct version of libtest.so ? Basically since both paths are pres…
BASH: echo -e does not work with Unicode Cyrillic
I recently switched to another working machive and faced a problem when I work with Cyrillic. My Bash script gets new messages from an application and works with them. However the messages are mostly written in Cyrillic and I get results like “u043fu0440u0438u0432u0456u0442” On my old system that …
Linux or unix find: shortcut for matching partial name
What I usually type: what I want to type (for example. mnemonic = “all”): or I was just thinking there could be a shortcut like in the style of find . -iname “blah” or rgrep instead of grep -r Even though, like the grep example, it only saves a couple of characters, they are shifted ch…
Select() to read in sockets
I have a client server client connection where the server reads the message sent by the client every 1 second but I do not want the server to keep on waiting for a message for too long. I tried using the select() function but the server continues waiting for some message to read. Could anyone tell me what I a…
linux bash script log output
Im having trouble getting output into my log file in my script. Backup runs successfully but the logfile is empty. WHen I run the script I get “Warning: Using a password on the command line interface can be insecure.” so at least that should be in a log file. (I am using a .key file) Answer Thats …
Regex Pattern matching refinement
I have a json that is returned to a variable, I’m trying to only grab values of from the json. I’m only limited to grep, sed, and awk returns me the result and honestly the only part I want is Answer With jq, you could use ‘.results[0] | .path’ filter. You may play around with this too…
Sort on specific part of filename in shell script
I have a list of files which I want to delete except 2 of the most recent ones. The files are named as “filename_dd_mm” for example “filename_19_05”. If I do It sorts them according to the day. What I want is to sort them by month first and then the day. Can someone please guide me to …
PC bootstrap process step by step
The bootstrapping process is a bit confusing, I hope I understand it correctly. I will try to describe my understandings and hopefully can be corrected. As this is an extremely important and I want to dive into the small details. BIOS: It sets up an interrupt descriptor table and initializes various devices. …