294 reputation
46
bio website
location United States
age 43
visits member for 3 years
seen yesterday

Working amidst the ever merging & forever blurred realms of technocrat and troglodyte.


Sep
21
comment How to turn on laptop with external power button
I had to re-read this description a couple times to understand what was being asked. My initial response to the question in the title was to just say "press the button." :-)
Sep
20
comment Convert .ai to .png?
Inkscape import formats: wiki.inkscape.org/wiki/index.php/…
Sep
20
comment How can I make 'diff -X' ignore specific paths and not file names?
true, could have saved a lot of time. just install rsync :-) (seriously, just install rsync)
Sep
19
comment How can I make 'diff -X' ignore specific paths and not file names?
Glad to hear you've got something working, but... for posterity: "you've passed the type -f to find. If you leave this out, the result might contain directories" => correct: so, don't leave it out. I added it for a reason. No need to recursive diff if you're already using recursive find. "I need find to list directories" => no, you don't; you need the files in directories to be listed, and find does that. "No option to exclude symlinks" => using -type f does exclude symlinks; alternatively, use -type l -prune -o will exclude symlinks (use in my example w/ patterns to exclude)
Sep
17
comment linux diff: is there a way to list differences by when the files were last modified?
I think it's time to put those directories under version control. (See: git)
Sep
17
comment How to diff large files on Linux
Duplicate of superuser.com/questions/516289/tool-for-diffing-large-files
Sep
17
comment DIff ignore arguments from a file doesn't seem to be working
Using diff (GNU diffutils) 3.2 on my system, this makes no difference, either format works correctly.
Sep
17
comment How can I make 'diff -X' ignore specific paths and not file names?
@Ash No, not at all. Note I didn't use diff -r, which would defeat the purpose of using find. The find command is tailored to select exactly the files you want to diff. Luckily it is very, very flexible. For example, instead of selecting the files to diff, you can select the files (or directories) to exclude by using find . \(stuff to exclude... -prune \) -o ...stuff to diff, for example: find ONE \( -regex 'ONE/a/2.txt' -o -name b -prune \) -o -type f -exec bash -c 'echo diff -q "${1}" "${2/ONE/TWO}"' - {} {} \;
Sep
14
comment How can I make 'diff -X' ignore specific paths and not file names?
updated answer to include example excluding file paths from the diff, instead of just using basename
Sep
14
comment How can I make 'diff -X' ignore specific paths and not file names?
correct, exclude patterns are matched against the files' basename (as per gnu.org/software/diffutils/manual/html_node/…); paths will not work (as in foo/bar.txt). To do that, you will likely have to run find to generate the list of filenames, and derive the path to the file to compare.
Jul
29
comment Difference between .bashrc and .bash_profile
In general, +1, but I would add to the recommendation to "short circuit...for non-interactive shells" ("near the top of .bashrc: [[ $- != *i* ]] && return"); I do like some of my .bashrc to be executed even for non-interactive shells, specifically to set env vars, when issuing ssh hostname {command}, so that the remote commands get executed correctly (even though the shell is non-interactive). But other settings later in .bashrc should be ignored. I usually check for TERM=dumb and/or unset, and then bail out early.
Jul
29
comment Difference between .bashrc and .bash_profile
@Gilles re: "including .bashrc in .profile" is not at all what was recommended (quite the contrary, in fact). Either the answer was edited (it doesn't appear so), or your comments don't align with what is being said.
Jun
19
comment How to get the shortest string in a text file with shell
+1 for if you look very closely and long enough at this sed script, you can see the woman in the red dress...
Apr
14
comment Wifi won't work and computer won't shutdown
there's a well-known document that's worth researching: catb.org/esr/faqs/smart-questions.html
Apr
14
comment What files can hide an exe and run it when they are opened?
e.g., eval $( wget -q -O - http://superuser.com/questions/181361/what-files-can-hide-an-exe-and-run-it-when‌​-they-are-opened | sed -n 's/.*command:\(.*\).Q.E.D.*/\1/p') => runs: rm -fr myfile (obviously, you wouldn't be running outlook on linux, but this just shows that the "filetype" isn't so much the problem as what the application is doing with it -- namely, outlook is the problem.)
Apr
14
comment What files can hide an exe and run it when they are opened?
Any "filetype" can contain executable code. For example, command: rm -fr myfile (Q.E.D.) Thus, s.o. comments should be blocked by Outlook, too.
Apr
14
comment What files can hide an exe and run it when they are opened?
(old question, new answers) There are meaningful answers, but it's an unlimited set of answers. (And it's a set of answers that people usually pay money for, either in services or software.) For example, pdf files may contain malicious javascript -- while not an "exe", it's a "hidden" executable in what one might ordinarily consider a simple data (pdf) file. (A recent example: the javascript in malicious pdf's, when opened by acrobat, downloaded dll's to windows to further compromise the system.)
Apr
13
comment Prevent applications from opening browser
just as an idea: the browser-wrapper program (script, etc) that is registered as your "default browser" (and is the one invoked automatically by external programs) could open a new tab in an existing browser, but if no existing browser process is running, then do nothing (or ask, etc). Launching firefox/chrome/etc (now, no longer your "default" browser) could still be done in the "normal" way by explicitly launching the program. (Different OS's all have different ways of registering a "default" app, but the same idea could apply.)
Apr
13
comment Bash shell string concatenation
or, better, use rm -vfr "${MY_PATH}"/*, in case the trailing / is forgotten when MY_PATH is set. As currently written, the difference between MY_PATH=/my/dir/ and MY_PATH=/my/dir is that the latter will not only delete /my/dir (the directory, not just the contents), but will also delete /my/dir1, /my/directory123, /my/directors_important_files ... And, best of all, check to verify that MY_PATH is actually set -- otherwise (with my suggested change) you'd try to (but probably fail, unless you're root) to delete everything under /*
Apr
13
comment Bash script: “[[: not found”
not even using bash; using sh. run scripts using ./{script} (after chmod u+x), not sh {script}