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


Jan
17
comment What are the practical implications, if any, of using software which processes are not the descendants of the window manager?
@strugee Looks like the comment system ate your backticks on `foo` notation! In scripts I use $(foo) notation as you suggested, however on the command-line I'm used to using backticks and (if your shell supports it, which it is likely to) the two notations are equivalent except in the case of multiply-nested backticks which require escaping the inner backticks-- definitely a place where $(foo) notation is better, but in practice that rarely happens, and when it does it is often easier to read when you mix the two notations. For example: echo `ls -lad "$(find /tmp -maxdepth 1)"`
Dec
31
comment How can I solve this ssh-agent problem?
If you're seeing the odd behavior with the Ctrl+Alt+t that you set in the Keyboard Shortcuts then I think you're probably experiencing a bug in mdm/MATE. What version of Mint are you running?
Dec
29
comment How can I solve this ssh-agent problem?
well, presuming you use gnome (and I think Mint does by default, so unless you've changed it from the default?) then I think not having your mate-terminal inheriting from gnome-session is the problem. two questions: 1) what is the output of pgrep -fl gnome-session and; 2) what action do you take to actually invoke your terminal? from a menu? from a hot-key binding? or ????
Dec
28
comment Wireless networking with CentOS
Suggesting that people manually edit /etc/network/interfaces by hand for their wifi is not very helpful since it is fraught with peril, not to mention being cumbersome since you have to manually change it every time you move to a new SSID or if you want it to be dynamic you have to set up your supplicant by yourself which is not the simplest thing to get right. Just use NetworkManager and click "Available to all users" and the problem is solved.
Dec
28
comment How can I solve this ssh-agent problem?
Most desktop Linux systems (Mint included) handle ssh-agent properly upon login right out of the box and it is usually roll-your-own things like this that break it. If for some reason your system doesn't handle ssh-agent, don't do it by hand. Instead use keychain which is well-designed to handle this and related problems. It also works for BSD (Mac) and other non-Linux systems.
Mar
6
comment List only bind mounts
@Gilles I deleted my errant comment to remove confusion. You're right, it is indeed POSIX-compliant. Also now I understand the reason we are seeing different behavior of mount and /etc/mtab. You are using Debian stable which has the older version of util-linux-ng; I am using Debian testing which has a newer version that no longer seems to have the same /etc/mtab behavior, which is maybe why @rozcietrzewiacz did not see bind in in /etc/mtab if his distribution is also using a newer version?
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
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
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
comment How can I do a “copy if changed” operation?
Or better yet, for this specific case use ccache.
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
30
comment How can I do a “copy if changed” operation?
-1 because this is overly-complicated, non-portable (-J is bsd-specific; with GNU xargs it is -I), and does not work correctly if the same set of files do not exist in both locations already (if I touch x/boo then grep gives me Only in ./x: boo which causes errors in the pipeline). Use a tool built for the job, like rsync --checksum.