I am updating makefile of the project where I need to perform different steps based on the customer or manufacturing build, I have written simple makefile as follows and with that I am seeing unexpected output, could someone help figure out issue with makefile. I am getting following output of the makefile Th…
Access the word in the file with grep
I have a conf file and I use grep to access the data in this file but not a very useful method for me. How can I just get the main word by search-term? I using: Print: I want: (without “export: “) How can I do that? Answer If you’re using GNU grep you can use PCRE and a lookbehind:
DMA Engine Timeout and DMA Memory Mapping
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…
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…