1,313 reputation
313
bio website
location California
age
visits member for 2 years, 2 months
seen Aug 29 at 3:47

Oct
24
comment Cannot install rsync (unable to create…Input/output error)
My first guess would be a disk I/O error. Check dmesg: dmesg | tail -30
Oct
24
comment A shell script that never dies
Since he wants the script to run every 5 seconds, Cron won't run it often enough. But he could invoke the script every minute and have it check to see if it's already running and exit immediately if it is. That way the script would only be dead for at most a minute before cron starts it up again.
Oct
24
comment A shell script that never dies
If the "do whatever" task hangs, this runs the risk of running out of processes or memory on the machine. And if the script is killed while it's sleeping, it won't have a chance to invoke itself again so it will stop running.
Oct
24
comment Copy of full swap file is empty
Sure, the swap file is just a normal file, so you can copy it or open it and read it just as you described. Try running "strings" on it to quickly scan the entire file to printable strings: sudo strings /mnt/swap -- you just can't be certain where the blocks in the swap file came from.
Oct
24
comment Copy of full swap file is empty
Normally, only the least recently used memory blocks are paged out to the swap file -- unless your computer is very memory constrained, this probably won't include your browser history (which is accessed fairly often by the browser) -- your swap file probably contains blocks allocated by long running daemons that haven't been read in a long time.
Oct
24
comment Copy of full swap file is empty
Why do you need to access data in the swap file? Since you don't really know which blocks were paged out, maybe all zero-filled blocks were paged out (though I'm surprised you don't see any non-zero data at all, like block pointers or other data structures). Accessing the swap file read-only should not be a problem.
Oct
24
comment Running tcpdump, tee and scp
Is it possible that you have one of the commands running in the background or in another terminal window?
Oct
24
comment Running tcpdump, tee and scp
I'm not sure which of the command lines I provided you're using, but none of them should be appending to the file. "tee" will overwrite the output file with each run, and the ">" operator will also overwrite the file. Can you give more details? Are you running on Linux?
Oct
23
answered Running tcpdump, tee and scp
Oct
23
comment Why is wc so slow?
Ahh, but a simple counting of characters, words, and lines is less computationally complex than computing an MD5 checksum. At least, if not for handling multibyte character sets. That's why I was surprised that md5sum ran much faster.
Oct
23
comment rsync most recent x GB
I can't think of any way to do this, but to clarify your question, do you really want the most recently modified 10GB of files copied, or any set of up to 10GB files? I don't believe there's any way to force rsync to give priority to the most recent files. The closest answer I can think of would be to constrain bandwidth to a known value (like 1MB/second) and kill rsync after enough time has elapsed to transfer x GB of data. Not perfect since the bandwidth constraint is a maximum value so you may not transfer as much as you wanted.
Oct
22
comment Is `rm -rf` not atomic?
Your assumption is correct - rm -r is not atomic. If you want to be sure that no more files get created in the directory while the rm -rf is running, you could rename it first, then remove the renamed directory.
Oct
18
comment Why is wc so slow?
@user49468: wc and md5sum may do different things, but both read a file and do a relatively simple computation, one calculates a checksum, one counts bytes, word separators and newlines. Well, I thought it was simple, but hadn't factored in the extra complexity of multibyte character sets. It's more like asking "Why is my car 20 times faster at going to the store than my minivan?" You would expect some difference between the two, but not a 20X difference.
Oct
18
awarded  Nice Answer
Oct
18
awarded  Self-Learner
Oct
18
answered Why is wc so slow?
Oct
18
comment Why is wc so slow?
@slm You did say it counts unique words, your example says “Hello! Greg” results in Hello 1, Greg 1, i.e. counts for each word. And the .Net project you linked to says "One of its main tasks is to go through a set of data and count the number of repetitions of a given word. For instance given the sentence “Hello, yes hello” it would tell you that the word Hello was used twice and that the word yes was used once." While in reality the result of echo "Hello, yes hello" | wc --words, is "3", not "Hello: 2, Yes: 1"
Oct
18
comment Why is wc so slow?
You're describing something different than the standard Unix wc command (at least, not the one that comes with Ubuntu). That wc doesn't count unique words, just words, so "hello hello world" is 3 words, not 2.
Oct
18
asked Why is wc so slow?
Jun
30
comment Using multiple NICs for faster internet?
If both your ethernet and Wifi use the same internet connection, you won't be able to increase the speed by using both at the same time -- you're still limited by your internet connection speed.