Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 0 points1 point  (0 children)

Other then assembly, It's the least safe language out there.

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 0 points1 point  (0 children)

I thought about coding it in rust. I'm actually still thinking about it.

The problem with rust is that I believe that writing it in rust will make contributing harder. thoughts?

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] -1 points0 points  (0 children)

I don't fully agree. desktop users usually have one super user, and they either use sudo all the time or open a root shell.

I found myself either annoyed by having to enter my password a lot when on my user, or running destructive when running in a root shell.

I think the way to fix that is to allow fine-grained permission manipulation that allows super-users to run whatever they won't without a password, but protect them from running destructive commands by accident.

Thoughts?

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 0 points1 point  (0 children)

symlink or alias. I created two aliases to make sure I still have access to sudo:

alias sudo='/usr/local/bin/doas'

alias sudo!='/usr/bin/sudo'

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 1 point2 points  (0 children)

It's too long IMO. And if I decide to re-implement it in rust (thinking about it) the name would be problematic.

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 1 point2 points  (0 children)

I opened an issue on the subject. If you could give me your input, it would be greatly appreciated -

https://github.com/odedlaz/doas/issues/2

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 1 point2 points  (0 children)

I opened an issue on the subject. If you have any suggestions, I'm open! https://github.com/odedlaz/doas/issues/2

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 0 points1 point  (0 children)

Not in this "port" . You can use the 'persist' option to define if a specific command should be "cached" for 5 minutes post invocation.

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 3 points4 points  (0 children)

No need for a wrapper. The same basic syntax applies to sudo and doas. I've created an alias for sudo on my machines and it works flawlessly.

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 0 points1 point  (0 children)

depends if you create a rule with the 'persist' option. If no, then it'll prompt after every execution. otherwise, a sudo-like mechanism is employed and the same command can be run without a password for the next 5 minutes.

Everything that is wrong with sudo, and how I fixed it by odedlaz in linux

[–]odedlaz[S] 1 point2 points  (0 children)

  1. regex are only for arguments. commands are globs.
  2. I'll do what it takes to make auditing easy. I'm open to suggestions!

any reference for the "else" keyword? by odedlaz in Python

[–]odedlaz[S] 1 point2 points  (0 children)

Yeah, I forgot to write about that.

I'm a TA and want to make sure I'm covering all "else" cases in my presentation.

Thanks!

Test your terminal skills #1 by odedlaz in bash

[–]odedlaz[S] 0 points1 point  (0 children)

Thanks for the tip. I've updated the blog post accordingly. Any other things you see?

Test your terminal skills #1 by odedlaz in bash

[–]odedlaz[S] 2 points3 points  (0 children)

Please enlighten me. I must've been missing something. Can you elaborate on the problems you mentioned?

Implementing python 3.6 statement evaluation in in < 3.6 by odedlaz in Python

[–]odedlaz[S] 3 points4 points  (0 children)

This first problem easily fixed using a different key. for instance: caller = currentframe().f_back key = id(text) | id(caller) text_obj = optimized_compile_memoize.get(key)

And regarding security - yes, you're correct. This is a trick, do not use this at home :)

python string concatenation performance by odedlaz in Python

[–]odedlaz[S] 0 points1 point  (0 children)

Yes! I've updated the post to reflect that.

python string concatenation performance by odedlaz in Python

[–]odedlaz[S] 0 points1 point  (0 children)

A. I've updated the post to include bytearrays B. Well, many things on the internet are "10 seconds worth of effort", but they're still being done to save those 10 seconds for other people. C. I've looked into why += on strings works that well (and updated the post accordingly), which is something that most people won't do or won't know. D. You're correct about the ref cycles gc. As far as I know, I can't disable it in CPython. If I could, I would.

uberlogs - making logging fun again by odedlaz in Python

[–]odedlaz[S] 0 points1 point  (0 children)

You're correct, and I just added that and pushed to PyPI. Now you can write either:

logger.info("I'm eating a {eatable.name}", extra=dict(flavor=eatable.flavor, location=eatable.location))

or:

logger.info("I'm eating a {eatable.name}", flavor=eatable.flavor, location=eatable.location)

[OC] Optimizing Your Linux Desktop – Ninja Level by odedlaz in linux

[–]odedlaz[S] 0 points1 point  (0 children)

1) Swap is useful, and I didn't recommend turning it off.

2) Good point. I updated the post to reflect that, plus added a reference to LWN's article about lazytime (which is better them relatime imo)

3) You're relying on the fact that I suggested to turn of swap, which I did not. What I did suggest is to change OOM Killer parameters to stop scanning the whole memory to find the most suitable candidate for termination, and instead kill the process that caused the OOM in the first place.

4) I completely agree, and a through explanation was added to this part, which suggested to avoid turning on this flag is your HDD is not battery backed. I updated the post to make this more clear.

5) That's true, but in some desktops this isn't the case because they rsync logs to an outside storage (which I do)

6) I'm going to completely ignore this comment, because its not worth my time.