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…
Tag: linux
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…
how to create a linux shell alias to give to g++ compiler the path of the file to compile?
What I want to do it’s to create an alias for the sentence below: Because I have to compile single files frequently. To do it, I’m trying creating a txt file with the output file name and the path of the file to compile. So I have a txt, called tocompile.txt, file that contains: then, I assign to …
Create CSV file using file name and file contents in Linux
I have a folder with over 400K txt files. With names like Each file has different content I want to grab file name and file content and put in CSV. Something like: I know how to grab all the files in a directory in CSV using: How can I also grab the contents of the file? Answer find * is