I have a file called “demo” that has names in our DNS. I’m trying to loop through each line and replace the “names” with “names and ip address” (as a way of verifying dns queries) So far I have this but no luck on sed or awk command. Help appreciated. Thanks. demo …
Get list of files whose creation date is greater than some date linux
I have these files in Hadoop and want the list of all files whose creation date is greater than 2016-11-21. I tried the command below but it’s printing all the files. How to get only the one’s which satisfy the condition Answer Pass the input date as a variable into awk expression(via -v option): …
bash pipefail still running w/ set -e after command in process substitution fails
script.sh: Why does echo “Script still running…” end up being executed? I thought the combination of set -e and set -o pipefail should mean that false gets propagated out to the main script and terminates at foo=… but instead foo is assigned “pipeline still running”… …
How to speed up python scripts on OpenWrt (embedded Linux) (missing pyc)
On OpenWrt it is possible to run Python code (mini Python to be exact) but even a simple “Hello World” Python script takes 6-8 seconds to run. From my investigations it seams that all Python modules are kept in py source code, and are compiles in memory on each run. Due to being some 20 or more mo…
VS2017 Linux C++ threads issue
I have been testing the VS2017 Linux C++ with remote debugger on Linux Ubuntu. I have created a few example projects for C++ and everything has been working great until I got to threading examples. I cannot seem to get the threads to compile as I keep getting “undefined reference to `pthread_create’R…
make using autotools gives undefined reference errors while custom Makefile works fine
I’m trying to convert the build mechanism of ccextractor (Open source closed caption extractor) from custom Makefile to Autotools generated Makefile. Current Makefile looks like this: Building through above Makefile works fine. My Makefile.am looks like this: If I run make after autoreconf -i on above f…
How to see system call that executed in current time by process?
Linux utility “strace” show the list of syscall that started after run of strace. How I can see syscall that run in current moment by process? before start of strace. Answer proc offers some information about what the kernel is currently doing “for” a process /proc/${pid}/syscall /proc…
Stream data for users
I want to build a server that could stream data from multiple endpoints simultaneously for analytics purposes. Scenario: users registered on our platform will provide credentials of their IoT device. E.g https://stream.example.com/user1 & https://stream.example.com/user2 Our responsibility is to monitor t…
Because one line of unrelated code, the speed difference so much
Why use the precompiler to add a line of code, the speed change is so great? ubuntu@host:~/test_intersection$ g++ -std=c++11 -O3 -DLINUX main1.cpp -o main1 ubuntu@host:~/test_intersection$ ./main1 duration: 62080 microseconds,set a size: 2998917 set b size: 3000000 set result size: 2087 ubuntu@host:~/test_int…
Using gnu make with a makefile, why is my .o file not deleted?
I have a simple makefile that works correctly with gnu make, except the object file named ‘txt.o’ is not removed, using ‘rm tst.o’. Here is the text from the makefile. Anyone know why the rm command here is not removing the ‘tst.o’ file? Thanks, Matt Answer What command did…