Skip to content

u/Nomto

In this archive from Jul 2015 to Nov 2020

3
posts
64
comments
1
media
234
score

I use elvish as my default shell, I think it has nicer interactive behavior than bash. For example ctrl-r is much easier to navigate, and there is a similar navigator for frequently used directories which saves me a lot of time. There are also many other differences in the scripting language itself that make it easier to write robust scripts (for example, no automatic whitespace splitting).

If I ever need to distribute a script to people I'll do it in posix shell, but there are plenty of things that I create only for myself, and for that I'd rather use a better language.

7 points

What's the point of cache=yes, you would only need caching for network streams, for local files the OS is already doing the job. Most of your stuff seems like personal preference, except maybe profile=gpu-hq which is definitely a good one to have.

1 points

You can either run it from the commandline with mpv --hwdec=no your_video.mp4, or put the line

hwdec=no

inside your ~/.config/mpv/mpv.conf to make it persistent.

But normally hardware decoding is disabled by default so I don't think it will change anything.

3 points

You would put it inside your user configuration, on linux it's in ~/.config/mpv/.

~/.config/mpv/mpv.conf controls things such as which scalers are used for the video, what is the default volume, screenshot configuration, basically all behavior. There are many options that you can change, but generally the default ones are good. ~/.config/mpv/input.conf controls anything related to user input: shortcuts, mouse buttons, etc. The file I linked is the one containing the default shortcuts that are "baked" into the mpv executable, but you can override them if you want.

You can find lots of mpv documentation in the user manual. It's very extensive, but it can be a little hard to find what you want.

1 points

And Scrollwheel scrolls through the timeline, not volume in MPV. That's probably changeable too, if you were really motivated. But I don't know if that can be done in a config file, or would require changing source code and recompiling.

It's actually very easy, the default behavior is picked up from here, and you can just override it locally by adding

WHEEL_UP     add volume 2
WHEEL_DOWN   add volume -2

into your input.conf.

3 points

The cache should only be in effect when playing non-local files (for example via http, youtube-dl or sftp).

video quality is said to better than VLC because the codecs are newer

It has little to do with codecs, both VLC and mpv use ffmpeg for decoding so the output of the decoder should be mostly the same. However mpv shines when it comes to controlling the postprocessing of the video, you can chose between multiple scalers, run your own shaders, do temporal interpolation of frames, apply debanding...

Funnily enough, it also has some friendlier defaults than VLC: for example the default longer seeks (>5s) are coarse (=fast), while the shorter ones are precise (=slower).

2 points

It's not that I must, it's that sometimes it's a pain that some software I use is stuck to a fixed version. To be more specific, here are some issues which I faced:

  • Ubuntu 18.04 ships an older version of ncurses which only supports up to 3 mouse buttons, meaning that mouse wheel up is not supported (but down is). Recompiling myself is not an option since I would also have to recompile every terminal program that uses it.
  • It also ships an older clang (slower, less standard-compliance) which I use for compilation. I can compile this myself but it gets pretty messy with libc and openmp.
  • Mesa drivers are also older unless I want to fuck around with PPAs with are notoriously insecure
  • Worst of all, the DE (gnome) is stuck to an older versions that has some atrocious bugs and performance snags, both of which have been improved.
  • gdb has made some nice usability improvements recently, and I would like to benefit from them without (you guessed it) recompiling it myself.

It's just very frustrating to encounter these issues which I know to be fixed upstream.

Honestly the fixed release model is a relic of the past which is worse for the user, and also puts more work on the maintainers.

2 points

We develop a cross platform application, and while we officially only support Ubuntu (+ offer an AppImage), I use OpenSuse Tumbleweed because I'm tired of Ubuntu's old packages.

5 points

whereas a homegrown solution would at worse have security leaks

Somehow people have gotten the idea that doing anything with cryptography requires you to be a wizard.

Yes, designing a safe crypto algorithm is very hard and you probably should not do that.
Yes, implementing an existing crypto algorithm is hard, and you should be careful about doing that.
However, using an existing (tried and trusted) crypto library is not necessarily hard, and doing this allows you to gain a much better understanding of what is actually going on. This is what I've done and I'm very happy with the results

doing what pass did anyway

It's not hard to do better than pass, storing each password as a separate file with the name in clear is a pretty bad metadata leak. Requiring another software on top to plug that hole is just lazy design. It's also pretty easy to beat it when it comes to complexity, since gpg is easily the most complex cryptography library/tool.

1 points

This is a good reminder not to rely on any one point of failure.

This is an important point, and honestly I'm not sure if I would recommend pass anymore. gpg is a complex (and rather unfriendly) piece of software, and doing proper key management is hard. If you combine it with another crypto software, tomb, you're multiplying the complexity and potential failures.

I've personally moved away from it, in favor of storing my passwords in a single, symmetrically-encrypted file and using a simpler crypto implementation than gpg. I have some scripts to fetch the password from a given website. Yes it's a homegrown solution which may have its own vulnerabilities, but I'm much more confident that I understand what's going on and the simplicity makes it several times more easy to troubleshoot.

1 points

In a strictly technical it's of course possible, but it's not exactly realistic to maintain a load of patches for what is at best an annoyance to me.

Thanks for the insights, even though I'm not really left convinced that the current way of handling mounts is all that good. Too bad I guess.

1 points

Yeah I guess there's really no way to do this with the way mount/unmount works. Some programs abstract the directory creation to some degree (systemd-mount for example) but it seems like there is no way to do that for deletion.

What I don't really understand is why mounting was made to operate on top of an existing directory, instead of a new directory managed (i.e. deleted on unmount) by the mounted system. It seems like it would be cleaner to me.

1 points

The advantage of open source drivers are not only with security. Open-source drivers generally play nicer with the rest of the stack (see EGLstreams vs GBM debacle) and integrate better with the rest of the system (no need to download them from a website, just get them from the package manager). If you're a developer, it also makes it possible to debug what's happening in the driver.

You might consider these minor, but they're a nice bonus to have.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.