2,475 reputation
513
bio website
location
age
visits member for 2 years, 7 months
seen 11 hours ago

Aug
17
comment Can't run executable file on Ubuntu, terminal expects sudo, or gives errors like “Invalid or incomplete multibyte or wide character”
It certainly shouldn't be like your first suggestion; that would try to compile a file called test (the intended output) and store the result in a file called test.cpp (the intended input).
Aug
17
comment Domain name resolution tool not specific to DNS
@bowlofred gethostbyname() does not produce the same result because it is a backward compatibility interface that only works for IPv4. getaddrinfo() is what you want to use here.
Aug
16
awarded  Enlightened
Aug
16
awarded  Nice Answer
Aug
11
comment How can I start a cronjob 1 hour later each day?
@kasperd I don't know, I suppose you might be right about different CPUs reporting different time. As for ntpd, it does try hard to only slew the clock, not jump it, specifically to avoid this kind of problem, but you're right, it (or ntpdate) sometimes can jump the time backwards. As for cron miscalculating its sleep delay, I'm pretty sure that would be considered a bug! Still, point taken, and a workaround would be to schedule the job 30 minutes past the hour which is less likely to cause the problem... Or add ±1800 in the arithmetic expression before taking the reamainder mod 3600.
Aug
11
comment How can I start a cronjob 1 hour later each day?
@kasperd I thought about that, but I reasoned that cron will never start the job before the appointed time, always on time or slightly after (in practice, always slightly after, because cron's computations take some small amount of time).
Aug
10
awarded  Enlightened
Aug
10
awarded  Nice Answer
Aug
10
comment How can I start a cronjob 1 hour later each day?
There are 2 problems with using at for this purpose: (1) if the job fails to execute correctly even once, it also probably fails to reschedule itself and then not just the next execution but all future executions are effectively cancelled until a human notices, and (2) since the job takes some non-zero time to run, using the naive now + 25 hours means it will run a few seconds (or more) later each time, anf this lag will build up over time, making it eventualy run at completely the wrong time.
Aug
10
comment How can I start a cronjob 1 hour later each day?
@birch I never knew that! I guess I never before tried to include a % in a crontab. Thanks for the correction, I have edited the answer.
Aug
10
revised How can I start a cronjob 1 hour later each day?
'%'s need to be escaped with a backslash in the crontab. – birch
Aug
10
revised How can I start a cronjob 1 hour later each day?
added 251 characters in body
Aug
10
answered How can I start a cronjob 1 hour later each day?
Aug
10
answered Is a page contiguous in the virtual address space or physical memory or both?
Aug
9
comment Can overwritten files be recovered?
Your answer makes the assumption that a block-based non-copy-on-write filesystem such as ext4 or xfs is in use. With copy on write filesystems such as zfs and btrfs you are in fact never "changing the block contents"; those filesystems always use brand new blocks to contain new data. Also, log-based filesystems like jffs2 also always write new data to new locations (not "blocks", those filesystems are not block-based). That being said, this doesn't mean it's easy to find where the old data live and to do it before the space is recycled. So your answer, which is no, is still correct
Aug
9
comment Can overwritten files be recovered?
I just want to point out that your first example (mv) is akin to deleting old_file, not overwriting it, so methods (if any exist) for recovering deleted files, as opposed to overwritten files, would apply in that case. Your other two examples do indeed overwrite an existing old_file and existing_file, respectively.
Aug
9
answered Howto Judge if a System authenticate with password only or through PAM
Aug
6
comment Standard Terminal Font Aspect Ratio
That's a really good question! Now if you add CJK (east asian) characters to the mix, those are exactly twice the width of normal characters in monospaced fonts suitable for terminal use. So by your calculation the aspect ratio for those characters would be 2:2.5. Yet I've heard that 漢字 are technically supposed to be perfectly square!
Aug
6
comment Exit status on core dump
@user871199 No, because most signals, like for example SIGTERM, do not cause a core dump. But if you check for just those signals listed in the answer, then yes, chances are good the process dumped core. So for example, if $? is 131, indicating SIGQUIT, it dumped core. Couple this with a test to check whether core dumps are enabled at all (with ulimit) and you have a fairly reliable guess. There is a flag bit in the raw status value as reported to the shell by the kernel which allows you to determine with certainty whether a core dump occurred, but that bit is not reflected in $?.
Aug
5
comment Can strace/ptrace cause a program to crash?
I could see how maybe tracing a GUI program from a terminal running under the same GUI (same X11 display) could trigger a deadlock of some kind, but tracing a GUI program from elsewhere, or tracing it with the trace output redirected to a file shouldn't be able to cause that.