Set Permanently ulimit -n / open files in Arch

sudo nano /etc/sysctl.conf
fs.file-max = 65535
fs.inotify.max_user_watches = 524288
sudo sysctl -p
sudo nano /etc/security/limits.conf
# add following lines to it
* soft     nproc          65535    
* hard     nproc          65535   
* soft     nofile         65535   
* hard     nofile         65535
root soft     nproc          65535    
root hard     nproc          65535   
root soft     nofile         65535   
root hard     nofile         65535
sudo nano /etc/pam.d/common-session
# add this line to it
session required pam_limits.so

 

Installing a package in Go

To install a package, open your terminal or command prompt and run the following command:

go get [package path]

For example, to install the popular Chi router package, you would type:

go get github.com/go-chi/chi/v5

After you run this command, Go automatically downloads the package and its dependencies and adds them to your go.mod file, which tracks your project’s dependencies.

Dependency Management

Since Go version 1.11, the official way to manage dependencies is with Go Modules. When you install a package with go get, Go automatically updates your project’s go.mod and go.sum files.

  • go.mod: Lists your project’s direct and indirect dependencies with their specific versions.
  • go.sum: Contains cryptographic checksums of the module dependencies to ensure their integrity.

If you are inside a Go module (a directory with a go.mod file), go get updates that module. If you are not in a module, go get simply installs the package into a global cache. However, it’s best practice to always work within a Go module. You can initialize a new module with go mod init [module path].

Using the LTS kernel in EndeavourOS

sudo pacman -Syu linux-lts linux-lts-headers

Kernel Management Tool (AKM): EndeavourOS also has a kernel management tool called akm (Arch Kernel Manager) in its repositories. You can install it with sudo pacman -S akm and use it as a graphical interface to easily install and manage different kernels.

Image to PDF with OCR on Fedora Linux

sudo dnf install ocrmypdf tesseract tesseract-langpack-eng tesseract-langpack-fas ImageMagick

Convert to PDF, enhance clarity (e.g., for OCR), add filters:

magick 01.jpeg \
  -resize 200% \
  -colorspace Gray \
  -sharpen 0x1 \
  -contrast-stretch 0 \
  -threshold 50% \
  cleaned.pdf

Or for OCR preprocessing (especially with Tesseract):

magick 01.jpeg \
  -resize 300% \
  -colorspace Gray \
  -normalize \
  -sharpen 0x1 \
  cleaned.pdf

Then apply OCR:

ocrmypdf -l eng+fas cleaned.pdf output.pdf

 

Completely Disable WerFault.exe (Windows Error Reporting) on Windows

Method 1: Disable via Group Policy (Recommended for Windows Pro/Enterprise)

  1. Press Win + R, type gpedit.msc, and press Enter.

  2. Navigate to:

    Computer ConfigurationAdministrative TemplatesWindows ComponentsWindows Error Reporting
  3. Double-click “Disable Windows Error Reporting”

  4. Set it to Enabled

  5. Click ApplyOK

This disables WER across the system and prevents WerFault.exe from launching.


Method 2: Disable via Windows Registry (All Editions)

  1. Press Win + R, type regedit, and press Enter.

  2. Navigate to:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting

    If the Windows Error Reporting key doesn’t exist, right-click Microsoft\Windows, choose New → Key, and name it Windows Error Reporting.

  3. Inside Windows Error Reporting, do one of the following:

    • Right-click in the right pane → New → DWORD (32-bit) Value

    • Name it: Disabled

    • Set its value to: 1

  4. Restart your PC for changes to take effect.


Optional: Disable WER Service

While disabling WER via policy or registry prevents it from activating, you can also disable its background service as an extra step:

  1. Press Win + R, type services.msc, and press Enter.

  2. Find: Windows Error Reporting Service

  3. Right-click → Properties

  4. Set Startup type to Disabled

  5. Click Stop (if it’s running), then Apply and OK

Optimize Kernel Configuration for Fedora

sudo nano /etc/sysctl.d/99-custom.conf
vm.swappiness=10
vm.dirty_ratio=15
vm.dirty_background_ratio=5
kernel.sched_migration_cost_ns=5000000
sudo sysctl --system
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mitigations=off noibrs noibpb nospec_store_bypass_disable nopti zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=25"
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo systemctl enable --now fstrim.timer
sudo journalctl --vacuum-size=100M