(_____(_____________(#)~~~~~~

  • 1 Post
  • 28 Comments
Joined 3 years ago
cake
Cake day: April 11th, 2022

help-circle







  • This reads like it was written by some LLM.

    Enable journaling only if needed:

    tune2fs -O has_journal /dev/sdX

    Don’t ever disable journaling if you value your data.

    Disk Scheduler Optimization

    Change the I/O scheduler for SSDs:

    echo noop > /sys/block/sda/queue/scheduler

    For HDDs:

    echo cfq > /sys/block/sda/queue/scheduler

    Neither of these schedulers exist anymore unless you’re running a really ancient Kernel. The “modern” equivalents are none and bfq. Also this even doesn’t touch on the many tunables that bfq brings.

    Also changing them like they suggest isn’t permanent. You’re supposed to set them either via udev rules or some init script.

    SSD Optimization

    Enable TRIM:

    fstrim -v /

    Optimize mount settings:

    mount -o discard,defaults /dev/sdX /mnt

    None of this changes any settings like they imply.

    Optimized PostgreSQL shared_buffers and work_mem.

    Switched to SSDs, improving query times by 60%.

    No shit. Who would’ve thought that throwing more/better hardware at stuff will make things faster.





  • The current “web” is utter trash. It’s so complex that compiling any browser that supports at least most web standards from source takes a lot more time and memory than compiling the entire Linux Kernel or even the mesa userspace drivers. The only way to “fix” the web is to throw it in the dumpster and start over. A web browser should only be a document viewer that can load and display interactive documents from a remote location and nothing more.

    Web search is shit anyway

    Yeah. It’s getting less and less usable even with FOSS frontends. I’m working on my own web search off and on. I’m so sick of wrangling with search engines just to get useful results for my query.



  • COW filesystems like BTRFS/ZFS with btrbk/sanoid are great for this. Only the initial copy may take a while, but after that it only takes the delta between the source and the destination to synchronize. On my main Server I have the OS on a single drive with BTRFS and all the actual data lives on a 4 disk zpool in raidz2. I have cron jobs set up to do hourly snapshots on both and I keep about a week worth of history. The BTRFS one gets synced to an external drive every 24 hours, while the zpool gets synced to another external 4 disk zpool on a weekly basis.





  • Interesting feature, I had no idea. I just verified this with gcc and indeed the return register is always set to 0 before returning unless otherwise specified.

    spoiler
    int main(void)
    {
        int foo = 10;
    }
    

    produces:

    push   %rbp
    mov    %rsp,%rbp
    movl   $0xa,-0x4(%rbp) # Move 10 to stack variable
    mov    $0x0,%eax       # Return 0
    pop    %rbp
    ret
    
    int main(void)
    {
        int foo = 10;
        return foo;
    }
    

    produces:

    push   %rbp
    mov    %rsp,%rbp
    movl   $0xa,-0x4(%rbp) # Move 10 to stack variable
    mov    -0x4(%rbp),%eax # Return foo
    pop    %rbp
    ret