• 40 Posts
  • 924 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle
  • Yeah. Lot of people also use Ai generated code… so…

    I have tested if clippy would warn me with a simple example (generates 6.7gb memory usage, be careful not to crash your computer if you add another 0…), while I watch with a system monitor (in KDE):

    use std::thread;
    use std::time;
    
    fn main() {
        let mut vec = Vec::new(); // Create an empty Vector.
    
        for number in 0..900000000 {
            let bign: i64 = number * number;
            vec.push(bign);
        }
    
        thread::sleep(time::Duration::from_secs(10));
    }
    

    I used the pedantic option of clippy and the only thing it complained was about the notation of the number…:

    $ cargo clippy -- -W clippy::pedantic
    warning: long literal lacking separators
    --> src/main.rs:7:22
    |
    7 |     for number in 0..900000000 {
    |                      ^^^^^^^^^ help: consider: `900_000_000`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal
    = note: `-W clippy::unreadable-literal` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::unreadable_literal)]`
    
    warning: `notright` (bin "notright") generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
    





  • Good point. I was always wondering how secure this is, as it works with copies of the files in my environment. Because I’m in my personal environment, doing sudoedit /etc/fstab does not let me edit other files from root while in that file. That means if any of the plugins from Vim tries to, they can’t edit arbitrary files, right? (If you don’t trust the plugin, then don’t use, but that’s another topic.) Little side note, just learned that sudoedit ~/.bashrc does not allow me to edit files in my home too.







  • I also have a 32gb RAM (30.5 GiB) and a swappiness value of 10. My entire swap is full and my RAM is only filled up to about 3.8 GiB. However my swap is just 512mb small (its not a typo, it’s half a GB). You should not worry too much, even if the swap is in use, because those parts are probably like “parked” ram area that is not in use for a while now and waiting “to be waken up”. And the performance penalty is not that big, if the swap is on a fast NVME SSD. In old days on old slow spinning hard drives, the penalty for using swap was huge (plus the Kernel and rest of operating system was not fine tuned as today).

    Some related commands to check:

    grep -H swappiness /etc/sysctl.d/*.conf
    
    swapon --show
    
    free
    
    cat /proc/meminfo
    

    Here is an interesting article: https://chrisdown.name/2018/01/02/in-defence-of-swap.html






  • Before my switch, i used Ubuntu exclusively for 13 years in row. I always heard of problems (and not at least because of the PPA repositories) when upgrading from one major version to the next, be it a LTS or not. I never did that and always installed fresh because of these stories. Mostly 4 years in between, or sometimes 2.

    Its entirely possible that most problems happened because of packages from PPA that the user did not change for the new upgrade. Because PPA repositories were often designed for a specific version of Ubuntu. So its not entirely the fault of the apt package manager in that case.



  • I don’t think this is true. The package manager is there for a reason to prevent that. If you have more updates to install at a time, then the chances are the same as if you would have installed the problematic update one at a time. Just read the manual intervention information from Arch and see if there is something to do, then it won’t bork. If people don’t know what they are doing and do not read the additional information (that is required to do so on Arch), well yes, then you could end up borking your machine. But not because so many updates are installed at a time. The package manager and operating system and their maintainer designed it in a way that you can install ton of updates at a time without borking. This is fine.