Goals of my ask: Implement a fail2ban which ban user. (For this I have a solution) Work environment: I connect to my machines with ssh-key protect with a password When a user type a wrong password for his ssh-key thrice I want to ban it for prevent attack Fail2ban parsed logs in /var/log/messages. Actually I …
Thread Program on Linux (Posix Thread)
I want to modify the multithread program on the Linux operating system using this Pthread API. I want to change that program into a program that has 2 threads that work together to add a number. But i don’t know how to change it, Thanks again for any help that can be offered. I am sorry,because I’…
How To Use Gregorian Timestamp In Curl String
I’m trying to work with a curl request and the following string: I’ve been working with the documentation quite a bit, so I know that brackets are not needed. Unfortunately, the only information I have is to us “Gregorian Timestamp” which I haven’t found a lot of documentation on…
Install TCP Wrappers in Slackware 14.2
How to install TCP Wrappers using the appropriate package manager? When I run pkgtool, I can see in the list that tcp_wrappers is included tcp_wrappers-7.6-x86_64-1. I want to install it. I tried the command below, with no luck. Whenever I run the command above, it says So I navigated to /var/log/packages, wh…
How To Replace Strings With X to Y Characters
I have data similar to the following: I am looking for a way to replace strings in field 2. If the number does not have 10-11 characters, I would like to replace it with 12223334444 so the output would be: My original thought was to use cut to get the second field and then use grep “[1-9]” or some…
How to detach from process, so that it can be traced by another process?
Program steps: Create child process by fork and call execv inside it Ptrace attach to child process Do something with ptrace Detach from child execute gdb -p child_pid But when gdb starts, it writes that child process is already tracked. How to detach from traced process, so that it can be traced by another p…
What could be the difference between an embedded serial read operation and a Desktop- PC
In an embedded Linux system, I am coding the project which tests serial port in a pyhsically loopback environment. It means I am connecting rx-tx.The peripheral output is RS-232 In order to test the port I am sending 1 byte then I read the sent byte. I repeat this cycle from 0x00 to 0XFF. I am using raw input…
Why do I get different results for finding the peak of memory usage?
In Linux, I am using /usr/bin/time -f %M tool (gnu-time) to get the peak of the memory used for a single process/program. But every time that I run this command, I get a different result. What’s the reason of this difference? How can I get the accurate value for the maximum memory consumed by a process?…
How are external symbols of a shared library resolved in the main program?
I’ve been reading a lot about the semantics of load-time linking of shared libraries and one thing that I’m having trouble understanding is how can the main program make references to functions defined in shared libraries? For example, say I have this code myShared.sh main.c I understand that, sin…
What’s the use of LLVM in Android NDK Toolchains?
What’s the use of LLVM in Android NDK Toolchains? A little recap: I was building my native project with Gradlew on Ubuntu, targeting arm and x86_64 architectures. Seems that LLVM were utilized to call C/C++ compiler of arm-linux-androideabi-4.9 as well as x86_64(?) The following is extracted from armeab…