Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
12
Newest
 Excavator
Impact
~7k people reached

May
29
comment How to limit CPU consumtion of a process group with standard GNU/Linux tools?
… And if nothing else is using CPU time, they still are gobbling up all the 100%. But mentioning nice in this context surely is worth the effort.
May
29
comment How to limit CPU consumtion of a process group with standard GNU/Linux tools?
Processes sometimes react weirdly if stopped and continued. Especially if they are terminal-interactive. So this might not work with every program, and a corresponding warning should be included in the answer.
Feb
23
comment Monitoring a file until a string is found
As I wrote: With this solution the tail runs one line longer than necessary (without halting termination of the grep and thus the main command) and at least in my cases this is not a problem. I'm hard pressed to think of a scenario in which this is more than an academic issue.
Feb
23
comment bash Segfault by infinite recursion
Thank you @hastur, that was enlightening about the history of the "bug". The question remains whether this is a security issue. Probably too chaotic behaviour to exploit it, I guess.
Feb
18
comment Monitoring a file until a string is found
Actually, I now go for the even simpler grep -q -m 1 trigger <(tail -f log) proposed elsewhere and live with the fact that the tail runs one line longer in the background than it needs to.
Feb
17
comment Monitoring a file until a string is found
@ZaSter: The tail dies only at the next line. Try this: date > log; tail -f log | grep -m 1 trigger and then in another shell: echo trigger >> log and you will see the output trigger in the first shell, but no termination of the command. Then try: date >> log in the second shell and the command in the first shell will terminate. But sometimes this is too late; we want to terminate as soon as the trigger line appeared, not when the line after the trigger line is complete.
Feb
17
comment Monitoring a file until a string is found
@mems, any additional line in the log file will do. The tail will read it, try to output it and then receive a SIGPIPE which will terminate it. So, in principle you are right; the tail might run indefinitely if nothing gets written to the log file ever again. In practice this might be a very neat solution for a lot of people.
Feb
17
comment Monitoring a file until a string is found
This polling has two main drawbacks: 1. It wastes computation time by going through the log again and again. Consider a /path/to/the.file which is 1.4GB large; then it is clear that this is a problem. 2. It waits longer than necessary when the log entry has appeared, in the worst case 10s.
Feb
17
comment Monitoring a file until a string is found
Another idea: Your fifo solution can be straightened, I think, by passing the output of the tail -f through the fifo and grepping on it: mkfifo f; tail -f log > f & tailpid=$! ; grep -m 1 trigger f; kill $tailpid; rm f.
Feb
17
comment Monitoring a file until a string is found
You solution (like others, I won't blame you) will miss things already written to the log file before your monitoring started. The tail -f will only output the last ten lines, and then all the following. To improve this, you can add the option -n 10000 to the tail so the last 10000 lines are given out as well.
Jul
2
comment Thunderbird Search Results — How to find out the folder
I had to switch to a "list of results" to go this way but then it worked just fine, thanks!
Jan
22
comment Timezone setting in Linux
Try date +"%R p %Z" to see if it's an AM/PM issue and which time zone the date command assumes.
Jan
22
comment Timezone setting in Linux
Maybe it is. Depends on the answer.
Jan
22
comment Timezone setting in Linux
I think it's clear enough. OP has India standard time set, and it's 17:29 in India which means it's 11:59 UTC. then OP changes just the time zone by that cp command; the UTC isn't affected (as we can see), but the localized time now is 5:59 GMT+6 although it should be 17:59 GMT+6.
Oct
17
comment Removing files on ZFS does not free disc-space
Yeah thanks, that seems to state this clearly. I will still have a test on removing the snapshots. If this also does not help, I will come back ;-)
Oct
17
comment Removing files on ZFS does not free disc-space
No, of course not. I would like to keep those, of course, and just because I think that this might be connected I won't remove them just to check the idea. I also find it weird that the snapshots should be part of the file system. They are on the disk, of course, but why should they be reported as filling the FS space? But if this is so with certainty, then I'd like to know anyway ;-)
May
27
comment unable to send mail from server
Probably a problem with the smtp server which is supposed to process your send-request. Any info about how that is configured?
May
21
comment How to send an `xmessage` as root remotely to regular user logged in with 'x' session?
Hmm, that's tricky because you cannot really know what the user's Desktop will do with your approaching window. Is it possible to have a daemon running on the user's X session which you can contact to display something? That would be a cleaner approach than simply throwing a window on his screen. Such a daemon can be written in a way so that it also would work on text consoles etc. Also, using wall you can ask the user to run a specific command to give you the feedback you would like to get from him.
Mar
8
comment How to mount an old encrypted disk on Ubuntu
I hope there is a workaround using cryptsetup (8) or the kernel module cryptoloop; documentation of those sometimes mention a support for an obsolete loop_fish2.
Mar
8
comment How to mount an old encrypted disk on Ubuntu
That would mean to set up an old SuSE from around 2007 or so (I'm not sure anymore from when this was, could be some years more or less). That doesn't sound easy. I hoped to be able to mount that thing on a modern ubuntu.