Yeah, my bad. I should have linked to the previous post: https://discuss.tchncs.de/post/32637183 (not entirely sure what’s the etiquette for linking to posts on Lemmy is).
Yeah, my bad. I should have linked to the previous post: https://discuss.tchncs.de/post/32637183 (not entirely sure what’s the etiquette for linking to posts on Lemmy is).
Yeah, it’s a bit philosophical.
bind -x '"\C-j":"echo a"'
in bash and Ctrl+J will do something different.stty
options which can change that though.Yes. So is Ctrl+J actually. Ctrl+J corresponds to line feed (LF) and Ctrl+M corresponds to carriage return (CR) ASCII characters. They are typically treated the same way.
Yes, I agree. But the dispute is what ‘sends EOF’ actually means. The article I respond to claims Ctrl+D doesn’t send EOF but is like Enter except that new line character is not sent. This is, in some sense true, but as I explain also misleading.
You could pass $1
and $got
through $(realpath -P -- ...)
to make sure all the path are in canonical form. Though now that I’m thinking about it, stat
is probably a better option anyway:
want=/path/to/target/dir
pattern=$(stat -c^%d:%i: -- "$want")
find "$HOME" -type l -exec stat -Lc%d:%i:%n {} + | grep "$pattern"
You want ++OK, actually not exactly. readlink -f
rather than ls -l
.readlink
won’t print path to the symlink so it’s not as straightforward.++
Also, you want +
in find ... -exec ... +
rather than ;
.
At this point I feel committed to making readlink work. ;) Here’s the script you want:
#!/bin/sh
want=$1
shift
readlink -f -- "$@" | while read got; do
if [ "$got" = "$want" ]; then
echo "$1"
fi
shift
done
and execute it as:
find ~ -type l -exec /bin/sh /path/to/the/script /path/to/target/dir {} +
I’ve Pulse 14 with plain Debian installation and so far didn’t notice any issues. Though admittedly, I’m not a heavy laptop user. Your mileage may vary I guess.
I used Claws Mail at some point in the past. Now notmuch+Emacs.
Why do you think it would affect performance?
You cannot write setuid scripts. It must be a binary.
The thread linked by the OP is Jarkko Sakkinen (kernel maintainer) seemingly saying “show your work, your patch is full of nonsense” in a patch submitted for review to the Linux kernel.
That’s not what he’s saying. He’s saying: ‘You’re using terms which aren’t that familiar to everyone. Could you explain them?’
If you have an SVG image you can either embed it directly on the website, or link it using img
tag. Whatever the case, there’s no need to export it to PNG.
And yes, that will likely result in a smaller website and furthermore images which can scale smoothly.
Another interesting part is that HTML5 supports embedding SVG. That is, you can put SVG code directly in your HTML5 document and it’s going to render correctly. You can also style it through your website’s CSS file and manipulate the elements via JavaScript.
Though as others pointed out, it’s technically not HTML but XML. For
example, you have to close all the elements and quote all the
attribute values. But when you embed it inside a HTML document, those
rules get relaxed to adhere with HTML. (I.e., you cannot write
<circle r=5>
in SVG (it must be <circle r="5" />
) but you can when
you embed it in HTML).
Which is why I haven’t wrote ‘EOF character’, ‘EOT’ or ‘EOT character’. Neither have I claimed that \x4
character is interpreted by the shell as end of file.
Edit: Actually, I did say ‘EOF character’ originally (though I still haven’t claimed that it sends EOF character to the program). I’ve updated the comment to clear things up more.
Having to type sudo
already acts as a molly-guard. Whatever OP wants to do I won’t stop them, but they are doing something strange.
Sure, though I advise against it. The following C program can do that:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv) {
if (argc < 2) {
fprintf(stderr, "usage: %s <command> <args>...", argv[0]);
return EXIT_FAILURE;
}
printf("Executing");
for (int i = 1; i < argc; ++i) {
printf(" %s", argv[i]);
}
puts("\nPress ^C to abort.");
sleep(5);
if (setuid(0)) {
perror("setuid");
return EXIT_FAILURE;
}
execvp(argv[1], argv + 1);
perror(argv[1]);
return EXIT_FAILURE;
}
As seen in:
$ gcc -O2 -o delay-su delay-su.c
$ sudo chown root:sudo delay-su
$ sudo chmod 4750 delay-su
$ ./delay-su id
$ id -u
1000
$ ./delay-su id -u
Executing id -u
^C to abort
0
This will allow anyone in group sudo
to execute any command as root.
You may change the group to something else to control who exactly can
run the program (you cannot change the user of the program).
If there’s some specific command you want to run, it’s better to
hard-code it or configure sudo
to allow execution of that command
without password.
It’s not. You keep insisting that ^D doesn’t send EOF and yet:
$ stty -a | grep eof
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
$ man stty |grep -A1 eof |head -n2
eof CHAR
CHAR will send an end of file (terminate the input)
^D (which is an ASCII EOT character) signals EOF. The thing is that in C every line of a text file must be terminated by a new-line. And so, when you end a file with ^D without a return, you get funky results.
If you go with adding a passphrase to the drive keep in mind that if it’s a unique one you may end up forgetting it since you won’t normally be using it. Even if you set it to the same passphrase as root partition, if you ever change passphrase for root you might forget to change home passphrase.
I would probably just make a physical copy of the key file. It’s just 32 bytes (no, larger key file doesn’t make things any more secure) so you can hexdump -C
it and copy the key on a piece of paper.
I meant what’s the link to use since the same Lemmy post can be viewed through different instances and on each it has a different URL. It’s a bit user-hostile that the link gets you out of your instance (unless you’re on the same instance as author of the post).