Skip to content

shmat() Permission denied even i have read access

In my simple code: I already have read access, but I got “shmat: Permission denied”. Do I have permission to write? Answer From man shmat: If SHM_RDONLY is specified in shmflg, the segment is attached for reading and the process must have read permission for the segment. Otherwise the segment is a…

Too many open files raised by supervisord?

I use wrk to test web API service managed by supervisor on ubuntu 16.04. have error “too many open files”, but i have set system config still have error “too many open files” I found supervisord is belongs to root and cat /proc/PID/limits so, add root limit settings to limits.conf like…

Spliting large scm files into individual commands

I have a very large scm file that is over 3 million lines long. I am ‘cat’ing it through a telnet port to a virtual server. I need to split the code into its individual lines and feed it into the server. It should send one line and wait a few milliseconds before sending the next line. Ex: … …

How can I delete a specific text in a text file

I have a text file : and I want to delete 192.168.47.1 line I tried but output is : I tried sed ‘s/192.168.47.1//g’ but again output is : I searched on google but but I am not able to find the right one. Answer The problem is that your pattern matches 3 lines in your data. You need to end

Who can send to a socket bound to INADDR_LOOPBACK?

I’m somewhat new to socket programming, and am confused about the concept of binding a socket to the address INADDR_LOOPBACK, or 127.0.0.1. If I’m writing server code to listen for messages on a specific port, and I bind a socket to an address as in the following code exerpt… …my quest…