458 reputation
39
bio website localhost
location San Francisco, CA
age 39
visits member for 3 years
seen Oct 13 at 20:09

Research Computing Architect at the University of California, Berkeley


Mar
6
comment List only bind mounts
@Gilles What mount --version are you using that records any bind information in /etc/mtab? I am using version 2.20.1 and I looked at the latest sources and in neither case do I see bind information recorded anywhere that would allow you to grep for bind. On the other hand, what I suggested in my answer does in fact list bind mounts created with --bind as well as using the bind option.
Mar
6
comment List only bind mounts
@Gilles Actually, you can do this simply using findmnt | fgrep [ as explained here.
Mar
6
comment Can't use exclamation mark (!) in bash?
Turning off history expansion altogether is the best advice I've heard all day! History expansion is dangerous and byzantine when there are much better alternatives (incremental history search with Ctrl-R) that let you preview & edit your command so you don't blindly fire away with command !-14 that you though was at !-12 that, oops, happened to be rm -rf *. Be safe. Disable history expansion! Eschew the !!
Feb
1
comment Converting multiple image files from JPEG to PDF format
@IlmariKaronen I agree that a Makefile is overkill, but it is nice to have a way to reconvert only the subset of modified files on subsequent runs. I've updated my answer with a way to do that just with find so you don't have to resort to a Makefile.
Feb
1
revised Converting multiple image files from JPEG to PDF format
added 987 characters in body
Feb
1
comment How can I do a “copy if changed” operation?
If you want to use your Windows-based editor you can do that quite easily with Shared Folders if you install Guest Additions... but hey, if Cygwin suits you, then who am I to say any different? It just seems a shame to have to jump through weird hoops like this... and compilation in general would be faster in a VM, too.
Feb
1
comment How can I do a “copy if changed” operation?
Cygwin is all kinds of problematic, so that doesn't surprise me. I am curious, though, what keeps you tied to Cygwin? Seems to me it would be easier to spin up a Linux VM with VirtualBox and do the primary development there, but then test it on Cygwin when you need to... you can still have Cygwin as a target platform (though with VM tech what it is, I don't see why Cygwin is still around anymore), but develop elsewhere.
Jan
31
revised Converting multiple image files from JPEG to PDF format
re-added info about arg list too long and zsh recursive globbing
Jan
31
revised Converting multiple image files from JPEG to PDF format
added comment about - and -iname
Jan
31
revised Converting multiple image files from JPEG to PDF format
removed unnecessary --
Jan
31
comment Converting multiple image files from JPEG to PDF format
@enzotib Also with find you do not have problems with filenames that begin with -, so there is no need for adding ./ like you must with the shell for loop.
Jan
31
comment Converting multiple image files from JPEG to PDF format
@enzotib ah, thanks for pointing that out. I was not aware that it behaved differently in a for loop. I have removed my erroneous comment, but that was not the only reason I down-voted. The mogrify command as cjm suggests is much simpler and find is more versatile since it can handle directory hierarchies (you can do recursive globbing with **/*.jpg in zsh, but that is shell-specific, whereas find is not) and it is easy to make find case-insensitive with -iname instead of -name, which is harder to do and shell-specific for globbing.
Jan
31
comment How can I do a “copy if changed” operation?
No, I was not suggesting that you copy all the files, rather you can just autogenerate your .c files in-place (remove the copy step and write to them directly). And then just use ccache. I don't know what you mean by starting hundreds of ccache processes... it is just a light-weight wrapper around gcc that is quite fast and will speed up re-building other parts of your project, too. Have you tried using it? I would like to see a comparison of the timing between using your copy-method vs ccache. You could, in fact, combine the two methods to get the benefits of both.
Jan
31
answered What is in the output of “getent ahosts”?
Jan
31
comment How can I do a “copy if changed” operation?
Or better yet, for this specific case use ccache.
Jan
31
awarded  Commentator
Jan
31
comment How can I do a “copy if changed” operation?
@user2436 +1 for rsync --checksum as a good general way to accomplish this, but in this particular case it would be better to use ccache.
Jan
31
comment How can I do a “copy if changed” operation?
@hesse if you want to show the unique files you can use diff, but if you want to see just what has changed then use rsync -avnc or the long way rsync --archive --verbose --dry-run --checksum.
Jan
31
comment How can I do a “copy if changed” operation?
@brooks-moses this is really a job suited for ccache!
Jan
31
answered How can I do a “copy if changed” operation?