I am trying to use a Linux DMA driver. Currently, when I send the transaction out and begin waiting, my request times out. I believe this has to do with the way I am setting up my buffers when I am performing DMA Mapping. In Xilinx’s DMA driver, they take special care to look at memory alignment. In par…
Tag: linux
How to comment out a string in xml file in shell
On above mention code i am trying to comment out all the line with pattern custom/Application in it sed command i use that is not working Answer This should work sed -e ‘/custom/Application/s/(^.*$)/<!–1–>/’ est.xml > new.xml
C# .net Core – Get file size on disk – Cross platform solution
Is there a way to have a common logic to retrieve the file size on disk regardless of the underlying operating system ? The following code works for windows but obviously doesn’t for Linux. Alternatively, I’m looking for a similar implementation that would work on Linux. Can anyone point me in the…
setsockopt usage in Linux and Solaris [Invalid argument in Solaris]
I’m trying to use setsockopt() on both Linux and Solaris in my ftp program. Linux uses a long for optvalue as a parameter, but Solaris uses a char instead. The program works fine in Linux, but reports “Invalid argument” in Solaris when creating the socket. Answer There are 2 issues appearing…
copy file with spaces in to hdfs
I have a file with name DT2516%_date_cdfs 05-feb-2017.csv .I need to copy it into hdfs . I am using the following command. Hadoop fs -put DT2516%_date_cdfs 05-feb-2017.csv /tmp/ Error: put : Unexpected URISyntaxException How do I copy such files? Answer Here is what you can do
Paramiko return code127 against command that actually exist
During automating SSH routine using paramiko to linux pc, I am encountering an issue where for the existing command, I am not able to execute it successfully as “command not found” 127 response code is received on command execution. I have tried all sort of ways exec_command(), crosschecking manua…
No activity on server with logging every 5 seconds
Recently I have notices that log files on my server grow faster than I was expecting. After a quick look I have realized that it is wtmp what aggressively is taking my disk space. Using utmpdump command (see below) I found out that every 5 seconds new 3 or 4 logs are recorded. There is no load on the server:
Detect if presence of a character in a string with Lua
I can have two types of string: nxs_flo_dev.nexus orfpdesk. I want to test if there is a . in the string. If there is a . I divide the string otherwise I do not do anything. Is there a function to do that? Because .contains() doesn’t work. Answer Use match again. Remember to escape the dot with %.: If y…
Why driver need to map DMA buffers when dma-engine is in device?
DMA buffers are memory mapped by the driver. For example, in pci-skeleton.c, which uses rtl8319 we have: But DMA engine can reside in soc or in device. **Is it that dma buffers should be allocated even if DMA engine is in device ? Why ? ** rtl8139cp datasheet (I think the dma is part of the device, but not su…
grep string after first occurrence of numbers
How do I get a string after the first occurrence of a number? For example, I have a file with multiple lines: I want to get the following output: Thank you. Answer Imagine the following two input files : A quick solution with awk would be : This line substitutes the first string of anything that does not cont…