Curl : connection refused
Make sure you have a service started and listening on the port. netstat -ln | grep 8080 and sudo netstat -tulpn
Make sure you have a service started and listening on the port. netstat -ln | grep 8080 and sudo netstat -tulpn
If you fork with the purpose of calling an exec function, you can use fcntl with FD_CLOEXEC to have the file descriptor closed once you exec: int fd = open(…); fcntl(fd, F_SETFD, FD_CLOEXEC); Such a file descriptor will survive a fork but not functions of the exec family.
Escape the .: sed ‘s/foo\./foo_/g’ file.php Example: ~$ cat test.txt foo.bar ~$ sed ‘s/foo\./foo_/g’ test.txt foo_bar
Update (Sep. 17, 2017): NVIDIA recently published an article detailing how to use OpenGL on headless systems, which is a very similar use case as the question describes. In summary: Link to libOpenGL.so and libEGL.so instead of libGL.so. (Your linker options should therefore be -lOpenGL -lEGL Call eglGetDisplay, then eglInitialize to initialize EGL. Call eglChooseConfig … Read more
Make file executable: chmod +x file Find location of perl: which perl This should return something like /bin/perl sometimes /usr/local/bin Then in the first line of your script add: #!”path”/perl with path from above e.g. #!/bin/perl Then you can execute the file ./file There may be some issues with the PATH, so you may want … Read more
When you source the file, the assignments will be set but the variables are not exported unless the allexport option has been set. If you want all the variables to be exported, it is much simpler to use allexport and source the file than it is to read the file and use export explicitly. In … Read more
It is both complicated and differs from Unix to Unix variant. In Linux, for example, a system called Futex (Short for Fast Userspace Mutex) is used. In this system an atomic increment and test operation is performed on the mutex variable in user space. If the result of the operation indicates that there was no … Read more
To have more control over the device numbers and the device creation, you could do the following steps (instead of register_chrdev()): Call alloc_chrdev_region() to get a major number and a range of minor numbers to work with. Create a device class for your devices with class_create(). For each device, call cdev_init() and cdev_add() to add … Read more
When you call a function, a new “namespace” is allocated on the stack. That’s how functions can have local variables. As functions call functions, which in turn call functions, we keep allocating more and more space on the stack to maintain this deep hierarchy of namespaces. To curb programs using massive amounts of stack space, … Read more
Both Debian and Ubuntu ship with pam_umask. This allows you to configure umask in /etc/login.defs and have them apply system-wide, regardless of how a user logs in. To enable it, you may need to add a line to /etc/pam.d/common-session reading session optional pam_umask.so or it may already be enabled. Then edit /etc/login.defs and change the … Read more