I am tailing a log file and want to make it more readable. The current output is something like this: I want the output to be more like this: It would be great if sed could be used to insert the spaces. The spaces need to be every 8 characters — it will always be in binary data after the
Using sed with regex to match varying lines
I’m having some issues used sed to match a regex pattern. An example would be with the following lines: spring-core-4.0.0 should be spring-core-4.1.0 spring-web-4.0.0 should be spring-web-4.1.0 I want the regex to match any characters in between spring and the version number. I’m not sure if I nee…
Running jre keytool results in the Permission Denied error
I have a script running the command: Got the error: Checked all permission on the directories and keytool – all are executable. I am at RHEL-7 Answer A lot of Distributions do not allow files to be executed from within the /tmp directory. Either move the jre out of /tmp (why is it even in there?) or make it e…
Makefile, add headers located in parent directory (Not allowed to move inside!)
prog.c myheader1.h myheader2.h Looking for solution on how to add a header from parent directory I found this question. But it didn’t work for me and I am still getting error of not finding the header file. No rule to make target ‘myheader1.h’, needed by ‘prog.o’. Stop. makefile …
Qt 5.10 QGraphicsView cannot scale QGraphicsScene to fullscreen
I am experimenting with Qt 5.10 QMultimedia on Ubuntu 16.04 to play Gstreamer recorded videos. The meat of the application is shown below. I cannot seem to get the video to scale to the full Qt screen after I call showMaximized(). The small video shown in the middle of the screen is shown below ( I want it to…
How we can use correctly pipe in Linux?
I have a project, the goal it is to extract phone numbers of a data.txt file, so I did a program. Like that : My problem is when I want to use this program and to execute on my terminal I had to use pipe for my terminal command. I tried many different commands on my terminal and the last
Timing/Clocks in the Linux Kernel
I am writing a device driver and want to benchmark a few pieces of code to get a feel for where I could be experiencing some bottlenecks. As a result, I want to time a few segments of code. In userspace, I’m used to using clock_gettime() with CLOCK_MONOTONIC. Looking at the kernel sources (note that I a…
Linux C program: How to find the library to which a function belongs
Say at runtime, I want to find out where a function “printf” is defined. How would I do this? My first attempt was to print out the address of “printf” and compare it against the virtual address mapping of the process: my program: output: However, this says the function is defined in m…
problem using ffmpeg drawtext for rtl languge
i use this command to write on a video: it work fine when i don’t have numbers and symbols(!,?,$ and …) in first and end of my text. my lang is right to left and this commmand not support rtl. what i must do to solve this problem ? Answer First of all, the issue isn’t really rtl or FFMPEG
A function that can be stored on memory
suppose we have two python programs. calculate.py and show_results.py. When calculate.py program runs on terminal, it returns a variable (let’s say a list called result) to the computer memory. And when we run show_results.py on terminal, it prints the result from the programs before. Suppose the result…