Skip to content

Tag: linux

Calling pppd within C program blocks the thread

I have a script which I call from within the C program. I do this before I start the threads as I need the ppp link up before these threads start. I do the below: I tried calling the script within a thread-1 like below: On the success of the script, I get below: After the above, no code beyond

For key and value in file json [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question FILE json I want to make a loop for and get the key and value Answer loooo…

How to make a “same response” server with bash?

I’m trying to set up a simple server that returns always the same response. Based on this question I’ve tried to use but on the client it shows only once. If I use the UDP option (-u), it works as intended. So I’m guessing it’s EOF’s fault. Is there a way to make it work as a rep…

How do I extract data from df ~ onto my website?

I am creating a pie chart which shows how much disk space is available/used on my linux box. However, I am unsure how to parse the data onto a microservice url. Help will greatly be appreciated. Here is what I have at the moment: Router: Controller: Answer You might try the approach below, we create a row obj…

yum check error when install package from source code

my server is centos 6.10, i install curl, libssh2, openssl, c-ares, python-urlgrabber from source code, and all these package run without any problems, but when i use camand yum check, i got error message: gnupg2-2.0.14-9.el6_10.x86_64 has missing requires of libcurl.so.4() rpm-4.8.0-59.el6.x86_64 has missing…

Doing an awk command for a conditional statement

I’m doing a bash script using the Awk command to format a file with some user info, and at the beginning of the script, I want it to say “if the value in column 1 is not in the format abc123, skip that line. It doesn’t seem to be working though. I had this previously: but of course that woul…

Multithreaded word count in C

I know I said I would try to figure it out on my own and I really did, and then I looked elsewhere first before posting here again but then I just ended up with this mess: How best should I fix this? Specifically these errors and warnings: I think the part for counting words from the buffer is okay,

gcc-7: error: unrecognized command line option ‘-m64’

I’m trying to compile C code on a Jetson Nano and I get this error during compiling. I tried removing any occurrence of ‘m -64’ but it seems like its added automatically. This is the cmd where it fails: /usr/bin/gcc-7 -Wall -Wextra -Wconversion -pedantic -Wshadow -m64 -Wfatal-errors -O0 -g -…