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…
Tag: linux
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…
print the count of files for each sub folder iterativly
I have the following folder structure: Similarly, Now, each folder from 00 to 23 has many files inside, which I would like to count. If I run this simple command: ls /A/B/C/D/E/00 | wc -l I can get the count of files in each of these sub directories. I want to automate this or get it iteratively. Also, the fi…
Docker-Compose: Service xxx depends on service xxx which is undefined
I’m having this error: ERROR: Service ‘db’ depends on service ‘apache’ which is undefined. Why is it saying that apache is undefined? I check the indentation. Should be the right one. Answer No, it’s not defined. You have overwritten one services with the other one. You sho…