Skip to content

u/aioeu

In this archive from Jun 2018 to Dec 2026

0
posts
2k
comments
0
media
8.7k
score

I'm not aware of any CLI to do that, but if you want to drive the D-Bus interface manually, you could use something like:

busctl call org.freedesktop.UDisks2 \
  /org/freedesktop/UDisks2/block_devices/sdx1 \
  org.freedesktop.UDisks2.Block Format \
  sa{sv} 'ext4' 1 'label' s 'Some Disk Label'

The sa{sv} arguments are:

  • the filesystem type;
  • the number of options;
  • the list of options, each specified as a string, a type, and a value.

See this documentation for details.

3 points

The kernel doesn't expose Bluetooth controllers as device nodes. They are managed through AF_BLUETOOTH network sockets.

The BlueZ daemon runs as root. It exposes services on the system D-Bus bus. Access to those services is governed by your D-Bus config. The upstream config simply provides access to all users, however your distribution may change this. The BlueZ daemon doesn't perform any access control of its own.

Bits of AF_BLUETOOTH can be used by unprivileged users, and I think bluetoothctl will talk AF_BLUETOOTH directly with the kernel where possible. But anything that's that related to configuring the Bluetooth hardware goes through the daemon.

1 points

But no, it's extremely unlikely that someone can just pop on and use your GPU in a default distro configuration.

Well, any application you run can use your GPU. It's no different from "using memory (to store data)" or "using the hard drive (to store files)". It's a hardware resource that's made available to applications so that they can use it. Applications can, and do, create various kinds of objects as GPU resources. These objects can generate output to be composited with the rest of the screen content through standard Wayland protocols and X extensions.

But if you're already of the mindset that most applications are inherently malicious, then you might want to consider ways to prevent them using this hardware. Frankly, I think this is all just ridiculous paranoia... but that seems to be where the OP is right now.

3 points

Protip on +, however it's possible that find will return so many values that the total size of your argument is bigger than the shell can take in a single command.

No it won't.

-exec doesn't run its commands through the shell. Furthermore, -exec knows exactly how many arguments are supported when executing a command.

In other words, -exec can split the arguments up into separate concerns in exactly the same way the xargs does.

7 points

why does "-exec" need ";" at all?

You can have further predicates and operations after the -exec operation. find is not limited to "predicates plus a single operation"; any number of producers and operations can be mixed arbitrarily.

So there needs to be done token to indicate where the -exec operation ends. ; or + is that token (depending on how you use it).

Regarding the backslash, that's just to get that torn through your shell. You could other firms of writing instead of you like, e.g. -exec ... ';'.

9 points

In Wayland apps need to use the global shortcuts system

Perhaps a better way to put this is "under Wayland, the policy is defined by the compositor".

A compositor could allow applications to capture all input. In fact, a limited form of this exists precisely to support keyboard grabbing under XWayland.

But the important thing here is that this is now all under control of the compositor. The compositor can decide whether a particular application can grab the keyboard. It can decide which events actually get sent to that application. It can ensure the user is properly notified that this has occurred.

None of this was possible under X. If an X application asked to grab the keyboard, and the keyboard wasn't already grabbed, X would simply let that first application have it, no questions asked. An X compositor had no way to intercept that decision.

Wayland's "every frame is perfect" tagline is nice, but "policy is not baked into the protocol" is in my opinion far more important.

1 points

Do you want this string to be loaded into memory when the plugin is loaded, or are you simply going to look at the offline object file? That might guide how you choose the section it should live in.

Regardless, I wouldn't use .comment for this. A .note section might be more appropriate. See the Notes section of the elf(5) man page. You will want to supply your own vendor name as the "name" of the note, and within that you can allocate a "descriptor" ID to specify that the note contains the plugin category. The note data would contain that category string.

2 points

The question that comes to mind is "why do you need a different directory"?

You never need to manipulate any of the XML files in that directory yourself. They are manipulated by libvirt itself. For example, when you "define" a domain you can use any source XML file you like, from whatever location you want. It's libvirt that writes out the XML file under /etc/libvirt.

Similarly, when you enable or disable autostart on a domain, it's libvirt, not the user, that adds or removes a symlink to the domain XML under /etc/libvirt.

All of this means this directory is tied intimately into how libvirt works. If you wanted to use a different directory, you would need to patch the location in the libvirt source code.

3 points

If you are increasing the size, you need to enlarge the LV first, then the filesystem inside it. Most filesystem resize tools can be told to enlarge the filesystem to the current size of the backing device — i.e. you don't have to give the size to it as well.

If you are decreasing the size, you need to do things in the opposite order: shrink the filesystem first, then the LV around it. I usually play things safe by "over-shrinking" the filesystem, shrinking the LV, then enlarging the filesystem to match the LV size.

There is an fsadm utility that can be used to resize both the LV and the filesystem in one go, at least for common filesystems, but (mostly out of habit) I usually do the individual steps manually.

2 points

There are usually utilities to apply those settings manually.

For instance, X display resolution and arrangement can be set up with xrandr — or even statically in your Xorg configuration file.

Where a DE has an advantage is that it will have a daemon running that can react to events. For instance, when you plug in a new display it can determine what changes would be applied (perhaps because it remembered how you had attached things the last time this set of displays were present).

You'd probably have to do all that manually if you're not running a full DE.

3 points

Just use df.

Determining disk usage by adding up the sizes of files is never going to be correct. It doesn't take into account that space can be shared between files (through reflinks and multiple links to files), that space is allocated pay the end of files, and you also need to be careful not to count files twice (bind mounts can make your filesystem topology non-trivial).

Asking the filesystem "how much space are you using?" avoids all of those problems. That's what df does.

5 points

So the 64gb is just straight up wrong?

Not necessarily. If you read those files, you may very well read 64 GiB of data out of them.

Alternatively, even when it is not possible to continually read data, it may be possible to seek to any of those 64 GiB offsets and read some data. Sometimes the "size" of the file only represents the possible offsets a file description can have.

And I should not take that into account when assessing how much storage is being used up?

You should ignore everything about non-disk-backed filesystems if you're wanting to count the space used on disk.

1 points

The lack of any delays in that loop bothers me. So you really think chewing up 100% CPU while waiting is the best approach?

It might be just simpler writing it as:

until docker exec -it test-db pg_isready -h localhost -p 5432 &>/dev/null; do
    sleep 1
done

I don't think this necessarily has anything to do with the problem at hand, but it certainly looks like this might be easier to debug.

2 points

The characters used to signal "end of file", "interrupt", "quit", "suspend", "literal next" and so on are handled by the terminal line discipline in your kernel, not by your terminal emulator. You can change them in a particular terminal with the stty utility. They cannot be arbitrary key combinations; they have to be actual.single characters (when you got C-c your terminal sends ASCII code 3, for instance).

5 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.