Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Hello I am running Plesk 10.4.4 with Qmail and noticed that one of my customers was spammed with an invalid address to which qmail kept trying to reply to. This unfortunately caused a major pile up (over 100 emails) in the system with some retries being held up for over 7 days and any new emails trying to go out would take up to 2 hours even if the addresses are correct.
Is there any way to tell qmail to not keep retrying and delete anything from queue that is over 2 hours old?
echo "7200" > /var/qmail/control/queuelifetime
/etc/init.d/qmail restart
7200 - it's 2 hours * 60 minutes * 60 seconds
But I think that 2 hours may be not enough, 1 or 2 days is OK for me.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have a simple C program that will be running on my raspberry Pi. I am planning on taking data from sensors with an interval of 10-15 mins. Should I sleep()
the C program for this period in a loop then have it take the readings so on. Or should I not have a loop at all and have a command in cron tab to run the C program after every 15 mins or so. What are the advantages/disadvantages of sleep() in this case or is there a better approach this ?
Is data available in same machine where C program is running?
If not same, better to
1) have a small C collect data from sensor
2) have a cron task that runs every 15 min, and that invokes your C program
3) This way if network connection breaks between your C program and sensor where data available will not be a problem.
Also this approach helps you if any memory leak is there, also that would not be a problem.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I want a script that i can run in the background of a game that will press a for 3 secs, then release and press d for 3 secs.
I'm not that familiar with how scripting works so I figured I'd ask for help.
It doesn't need to have a key press to start, cuz i can just double click it on my desktop to start it. i just need it to run the above loop until i stop script.
Is there any way to do this?
?
A crude example
Loop
{
Send {a down}
Sleep 3000
Send {a up}
Send {d down}
Sleep 3000
Send {d up}
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can you create C program that waits for user input for a specific number of seconds? After the time limit, the program closes, with or without input. Sample code please, using fork() and sleep(). Sorry I'm new at this.
Whoa. Sorry guys. This is not my post. Seems like someone used my account. And I can't delete it.
If you just want to sit the program down and wait... Make a loop checking for the input, use save the start time of the clock in a variable. Update the end time. Check in the loop if the time (here 5 seconds) has expired.
begin_t = clock();
// do-loop
/* read user input*/
end_t = clock();
// while( end_t - begin_t < 5 * CLOCKS_PER_SEC )
In my opinion usng fork() and sleep() is not the best way to achieve such a result. It's much better to use select() call which allows to wait for data with a timeout.
See the unix manual page on select() for some exemplary code.
The correct way to do this is to select STDIN for reading and set the timeout for however long you want. Select will either return STDIN as available for reading or return nothing, which indicates a timeout.
http://linux.die.net/man/2/select
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
see i have one audio track whose sample rate is 44100 then what does it mean ?
what is the duration of one frame of audio? How can i get it in c?
Does frame and sample both are different term for audio?
A sample of audio is similar to a frame of video, it's a capture of the sound level at a particular time point, in the same way as a frame of video is a capture of the light pattern. A frame rate of 44,100 is 44,100 samples per SECOND, or 44.1 kHz. So a sample duration is 1/44,100 seconds = 2.26e-5 seconds.
We can hear sounds in the approximate range 20 Hz to 20 kHz, so the sample rate needs to be very high to capture that information accurately enough to reproduce it without too many artifacts.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have a doubt regarding time division multipluxing.
In GSM we are using time division multiplexing.
In time division multiplxing, there is timeslots foreach signel. But while using GSM mobiles, we are getting a continues flow of data, but actually we are not transmitting it continuesly rite??
How do we get continues signal even if transmission is done using TDM.
The simple answer is that you're not receiving a continuous flow of data. What you are receiving is short bursts of data close enough together that they seem to form a continuous stream.
In case you care, the specific numbers for GSM are that it starts with 4.615 ms frames, each of which is divided into 8 timeslots of .577 ms. So, a particular mobile handset receives data for .577 ms, then waits for ~4 ms, then receives data for another .577 ms, and so on. There's a delay of 3 time slots between receiving and transmitting, so it receives data, then ~1.8 ms later, it gets to transmit for .577 ms.
The timing is close enough together that even if (for example) the signal gets weak and/or there's interference for a few ms, and a particular hand-set misses receiving data for one time slot won't necessarily be audible. When the signal is lost for about 20 ms, most people can start to perceive it as actual signal loss. Losses shorter than that will result in lower sound fidelity, but not necessarily as actual loss of signal.
It's also worth noting that most of the newer (3G, 4G, LTE) systems work entirely differently, being based on CDMA instead of TDMA.