Is there any way for a writer to know that a reader has closed its end of a named pipe (or exited), without writing to it? I need to know this because the initial data I write to the pipe is different; the reader is expecting an initial header before the rest of the data comes. Currently, I detect this
Set System date and time using C++ in Linux
I am in the middle of developing a cross platform application that changes the system date and time to a specified value. I have completed the part for Windows. How can I set the system date and time from a C++ program in Linux? I am looking for a function similar to SetSystemTime(SYSTEMTIME &x). As far a…
How do I copy regex matches from a file? Need to get all MAC addresses from log file
I have a linux dhcpd log that I need to get a list of only the MAC addresses. The MAC addresses are formatted like 00:ab:27:d8:dd:dd Using linux command line tools,parse INPUT file for MAC addresses and send to OUTPUT file. Where OUTPUT file is just a list of the MAC addresses, where then duplicate MAC addres…
Gitlab avoid user login via SSH
When I create a user on Gitlab, it creates a regular user on linux and it can login using a regular SSH protocol with same password an user. How can I disable the SSH login using SSH to desired users? All my server is exposed to that users. Thank you Answer Edit the sshd_config file adding this line Read more…
How can my Linux program get a computer-is-about-to-go-to-sleep notification, without modifying any system config files?
I wrote a Linux program that creates some persistent TCP connections, and I would like my program to close() those TCP sockets just before the Linux-computer goes to sleep, so that the remote peer isn’t left with a non-responsive “zombie” TCP connection. According to this answer, one way to …
Downloads hang/fail after ~80kb using NGINX reverse proxy [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Web Server/Web service written in C++ in Linux
The requirement is to have Linux machine without additional installations aka Java, apache tomcat/jboss, that will be able to serve as a web server and to accept web service request (I will have to write some web service in C++ that will serve under this web server). So, the question is if there is some C++ l…
What is a good Inter-Process Communication method between C and PHP in Linux
I actually don’t know whether I am asking a proper question. Let me describe my problem first. End user <-1-> web server (by PHP) <-2-> an internal process (by C or C++) <-3-> an external hardware The 1 should be something like ajax request. The 2 should be something like inter-process…
gtkmm, how to set a tool bar?
I want to have my toolbar at the top of the window, not vertically expanding and I want the entry to expand horizontally. Here a code : main.cc I don’t understand what is the difference between expand and fill, there are two functions, set_hexpand() and set_vexpand() whatever I tried (the last two hours…
Disable OpenGL for Python / Matplotlib
I’m doing a Python course for which I have installed Arch Linux in a VM. When I use Matplotlib.pyplot to plot things (x vs y) I get a bunch of errors. When I turn of 3D support for the VM it simply asks for openGL. My script does create a plot (empty canvas) but without a line. I think it