I am using command like sendmail -bv example@othesite.com to verify some email address to confirm the address is valid or not before sending actual email to people. it works for most sites I tested. But sometimes, I am using the sendmail for some website that will give me all pass no matter what the address n…
How to grep a group of files within a specific time range
I’m trying to write a script used on a buffer box that does full packet capture of network traffic. As it’s for a fairly big network we split the captures into 100MB segments. At times of high network traffic oftentimes over a one minute period we will have multiple pcaps which cover that period. …
What can kill a Java process on Linux other than OOM?
I have two virtual servers for hosting my web app. They are identical, running Debian 6 with 1.5GB of RAM. I configure the OS and Tomcat using a script from a fresh install, so I know they are identical. My webapp runs in Tomcat and I set 850M heap and 100M perm size. My app regularly dies on one of
How to run nohup and write its pid file in a single bash statement
I want to run my script in background and then write its pid file. I am using nohup to do this. This is what i came up with, But this gives a syntax error. The following doesn’t give syntax error but the problem is echo $! doesn’t write the correct pid since nohup is run in a sub shell Any
ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known [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 …
How to receive a file using sendfile?
send a file with sendfile is easy: but how to receive a file using sendfile? since I don’t know the length of the file, should I send the file length first? There seems to be two ways of doing this: send the filestat.len first use a loop in the receive end: Which one is better? Should I handle the buffe…
Epoll_wait returning events on closed file descriptor
I’m working with a multithreaded embedded application in which epoll is used for IO in one of the threads. I’m relying on a particular feature of epoll that specifies that closing a file descriptor automatically removes it from the epoll set (Question/Answer 6 in man 7 epoll). In this case, the fi…
how to identify names of the partitions
From below partitions how know which partitions is boot and which one is system. Is there any different command I need to execute to read the partitions names. with df command Answer You can use df command. This will display something like that: The second option would be to read the /proc/self/mountinfo file…
Disabling disk cache in linux
In a class project my teacher told us to make some code evaluations (C language) and to do so we need to disable the disk caching during the tests. Currently I’m using Ubuntu 12.04, how can I do this? Thanks. Answer You need root access to do this. You can run hdparm -W 0 /dev/sda command to disable wri…
Extract the Linux serial number without sudo
It is possible to extract the Linux serial number without using sudo? I know it is possible to do in Windows: wmic bios get serialnumber and in macOS: system_profiler | grep “r (system)”. Both of them do not require root privileges. In Linux this can be used: sudo dmidecode -s system-serial-number…