Category: Linux

OS specific instructions in CMAKE: How to?

Query asked by user I am a beginner to CMAKE. Below is a simple cmake file which works well in mingw environment windows. The problem is clearly with target_link_libraries() function of CMAKE where I am linking libwsock32.a. In windows this works and I get the results. However, as expected, in Linux, the /usr/bin/ld will look […]

How to set app icon for linux revisited and how does xfreerdp do it

Query asked by user I discovered that my appimag-ed application does not show any app icon in the window manager when launched, even though it has the icon inside itself. By the way, e.g., Obsidian app does suffer from this problem. In general, from searching on the Web, it looks like appimage fails with icons. […]

LINUX LISH.H list_for_each infinite loop

Query asked by user I’m trying to implement a list of task_struct and use it as a FIFO. In addition I need a function to go through the list and search for a particular task. My problem is that the list_for_each macro gets stuck in an infinite loop. Here below there is a snippet from […]

Bash script – redirect child script stderr to parent’s stdout

Query asked by user I’m sure I’m missing something simple, but I’m using an executive script to call a few utility scripts and I want to handle all of the output from the utilities via one pipe. My issue is the utilities use stderr to report error conditions, but I can’t capture that for use […]

curl code : stop send http request when it reach specific amount?

Query asked by user target=${1:-http://web1.com} while true # loop forever, until ctrl+c pressed. do for i in $(seq 10) # perfrom the inner command 10 times. do curl $target > /dev/null & # send out a curl request, the & indicates not to wait for the response. done wait # after 100 requests are sent […]

Perf Imprecise Call-Graph Report

Query asked by user Recent Intel processors provide a hardware feature (a.k.a., Precise Event-Based Sampling (PEBS)) to access precise information about the CPU state on some sampled CPU events (e.g., e). Here is an extract from Intel 64 and IA-32 Achitecture’s Software Developer’s Manual: Volume 3: 18.15.7 Processor Event-Based Sampling (PEBS) The debug store (DS) […]

How to find Number of Program Headers of a ELF

Query asked by user I need to find number of program headers of an ELF executable (a.out) without using objdump or readelf. I think it can be done be through hexdump. But i have no idea about it. Please give me a idea on how to calculate it. Thanks Answer we found from sources I […]

How do I extract only timestamp and date at my curl script?

Query asked by user I have this script that tests my connection and writes down status code. I want to extract date stamp and time on the top of it, every time it runs. Something like this: Date and Time result1 result2 result3 Date and Time result1 result2 result3 My script looks like this: while […]