• 2 Posts
  • 84 Comments
Joined 1 year ago
cake
Cake day: June 5th, 2023

help-circle

  • Yes. You can use lvresize to reduce the size of your logical volumes.

    You first need to shrink the filesystems using e.g. resize2fs (exact command depends on filesystem). See the manpage for details, but for shrinking the filesystem it needs to be unmounted, so you’ll need to do this from a live usb or something.

    After that you can use lvresize to resize the logical volumes. Pro tip: You can shrink the filesystem to e.g. 20 GiB, but shrink the partition to 30 GiB, just to make sure you’re not cutting off the filesystem due to some slight error or inexactness, and then afterwards run resize2fs again to resize the filesystem back to fill the whole partition, which it does by default if you don’t specify any size.

    Also note, since you have LVM-on-LUKS, when you boot into a live cd, you will need to first use cryptsetup to decrypt your partition, and then run vgscan to make lvm find the unecrypted partition.


  • extension design and strong content filters make AdBlock for Firefox a solid choice for people who don’t necessarily despise all ads

    Do these people exist and if so, have they been checked for brainworms?

    The rest is also stupid, ublock origin can and does block trackers, and can be made to block more stuff if you want. It’s strictly better in every way than the competition, which lets through more stuff, and/or sells your info. The article would be very short though if they just said that.


  • I think what’s going on there is that your suspend thingy looks at the “idle time” (kept track of by the X server or (I assume) wayland compositor) to know when to do its thing. This idle time gets reset whenever you use the keyboard or mouse, but not when you use a controller, because games talk directly to the kernel for controller input, not X. This used to be a serious annoyance because screensavers/lockscreens/dpms kept enabling themselves while playing with a game controller.

    Steam “fixed” this some years back, by interfering with this idle time in some way, so your screensaver/dpms/lock wouldn’t start. But, annoyingly, steam does this all the time, not just while playing a game.

    Bug report:

    https://github.com/ValveSoftware/steam-for-linux/issues/5607



  • A lot of distros, I think, are started more due to political/social/psychological reasons, and not fundamental technical reasons, and that’s why a lot of them are so similar. Those reasons can be good and legit, but sometimes they are probably wrongheaded (but understandable), like an unwillingness to engage with upstream because that’s tedious and frustrating, whereas the technical work of creating another distro with oneself in charge may be more fun.

    Also, of course, once a distro is big enough, with a sizable community of developers and users, there’s a strong incentive to keep it going, even if it’s very similar to another distro. Maybe there used to more of difference in the past, but you’re not going to convince a whole community to just shut down and join some other project. And business-run distros will keep going as long as the company is making money there is some business reason to keep doing them.


  • While this is generally true, there are sometimes exceptions to this, especially during the freeze.

    Even unstable slows down during the freeze, as the usual way to get stuff into testing is through unstable, and packagers, especially of large collections or important dependencies, opt not to disturb the freeze by dumping a bunch of bleeding edge stuff in there. Consequently you also get more new stuff in unstable shortly after a new Debian release.


  • I use tlp.

    I also have a battery info using i3status in the status bar, and a script I named battery-check, which warns me via a dunst popup and a beep when the battery gets low:

    #!/bin/sh
    set -eu
    
    bat=/sys/class/power_supply/BAT0
    
    if [ ! -d "$bat" ]; then
        exit 1;
    fi
    
    status=$(cat "$bat/status")
    energy_now=$(cat "$bat/energy_now")
    energy_full=$(cat "$bat/energy_full")
    
    battery_percent=$(( ${energy_now}00 / ${energy_full} ))
    
    if [ "$status" != "Charging" -a "$battery_percent" -le 15 ]; then
        dunstify -t 8000 -u critical "Battery at ${battery_percent}%"
        play -q -n -c1 synth 2 sine 600
    fi
    

    I run this from my ~/.config/sway/config like so:

    exec sh -c 'while true; do sleep 180; battery-check || break; done'
    

  • I don’t think the problem is with GRUB.

    There are various different ways in which USB keyboards can encode keypresses. I’ve seen some BIOSes that just cannot deal with some keyboards due to this. The USB keyboard driver that will be in use during GRUB should be the BIOS/UEFI driver. So I would try updating the mainboard firmware/EFI or try a different keyboard maybe? Or disable the GRUB password if that’s an option.


  • The US has the Foreign Agents Registration Act, which is actually stricter. The “Russian law” shit is just framing. Countries have a right to know who’s meddling in their shit, in fact meddling is illegal under international law. The fact that they feel this threatened by a mere transparency law speaks volumes.

    How would you like it if some politicans from other countries (let’s pretend it’s Russia since you seem very concerned about them) came to your capital and threatened “severe consequences” for even daring to want to monitor foreign influence. These protestors are basically demanding to surrender all sovereignty to EU/US/billionaire funded NGOs.

    Imagine living in country where core government functions, like writing laws, regulation, and social services are provided by NGOs which are beholden to foreign donors. No oversight by any local authority and definitely not beholden to the people. This is about as far from democracy as you can get, this will ruin a place.






  • As others have said, if you quote your variables, they won’t get split on spaces. The Unix shell unfortunately has ton of gotchas like this, and the reason this is not changed is backwards-compatibility. Lots of shell scripts depend on this behavior, e.g. there might be something like:

    flags="-a -l"
    ls $flags
    

    If you quote this (ls "$flags"), ls will see it as one argument, instead of splitting it into two arguments. You could patch the shell to not split arguments by default, and invent some other syntax for when you want this splitting behavior, but that would break a ton of existing shell scripts, and confuse users who are already familiar with the way it works right now. It would also make the shell incompatible with other shells, and violate the POSIX standard.


  • I did it during the gcc 3 transition. I used a very new gcc 3 (maybe even pre-release), which wasn’t at all recommended. A couple of (most?) C++ packages didn’t compile (some change having to do with namespace scope), which meant I had to fix the source of some packages (generally pretty trivial changes, usually having to prepend namespace:: to identifiers). Overall this problem was pretty rare, like it affected less than 1% of C++ files, but with things like Qt or Phoenix (or whatever Firefox was called back then), with thousands of files, I had to fix dozens of things. I guess running into problems made it more interesting and fun actually.

    Did I learn anything? The main thing I learned is about all the different basic packages and what sort of binaries and libraries are included in them and why you need them. Also about some important config files in /etc. And a bit of shell experience, but I dare say I knew most of that stuff already. How much you learn depends a lot on how much you already know.

    Overall what I learned was not very deep knowledge, nor was it a very time-efficient way to learn. But it was a chill learning experience, goal-oriented and motivating. And it made me more comfortable and confident in my ability to figure out and fix stuff.

    Also it’s obviously not practical to keep that up to date, so I switched back to a distro after a couple of months of this.



  • This doesn’t work to avoid thrashing. The kernel may invoke the OOM killer slightly quicker if you have no swap, so I guess that can sort of help, but it doesn’t properly solve the problem.

    On Linux, there’s a thing called the page cache (aka disk cache): Every time (part of) a file gets read to or written from, that (part of) the file gets copied to RAM. The file is then kept there unless that RAM is needed for something more important. It is cached in RAM. But since it is also on disk, the kernel can drop the file from RAM anytime it wants.

    If you’re low on RAM, the kernel therefore evicts all of the disk cache, because it can, because those pages can be reloaded from disk if needed. This means it will drop all the programs you’re running, the binary code. So any program you’re running is constantly interrupted, because its code is not in RAM.

    So it runs a couple of instructions, but oh no! Call to function foo() from glibc, but guess what? That’s on disk. Queue wait for the kernel to load that. Oh now it wants function bar() from zlib, shit! Need to load that. Since loading stuff from disk is about as slow as running like a gazillion instructions, all your programs are like 1000x slower now.

    This happens even with zero swap.

    The correct advice is the one from @RedWeasel@lemmy.world: install/enable systemd-oomd or earlyoom.