Access a Windows shared folder from Linux Mint
sudo apt update sudo apt install cifs-utils samba
smb://<Windows-IP>/<SharedFolder> smb://192.168.1.10/SharedDocs
Enter Windows username and password if prompted.
sudo apt update sudo apt install cifs-utils samba
smb://<Windows-IP>/<SharedFolder> smb://192.168.1.10/SharedDocs
Enter Windows username and password if prompted.
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
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
sudo nano /etc/security/limits.d/99-openfiles.conf
* soft nofile 65536 * hard nofile 1048576
sudo nano /etc/systemd/system.conf
[Manager] # Set soft:hard limits DefaultLimitNOFILE=65536:1048576 # Or set both soft and hard to the same value # DefaultLimitNOFILE=65536
sudo nano /etc/systemd/user.conf
[Manager] # Set soft:hard limits DefaultLimitNOFILE=65536:1048576 # Or set both soft and hard to the same value # DefaultLimitNOFILE=65536
sudo systemctl daemon-reexec
sysctl fs.file-max
sudo nano /etc/sysctl.d/99-filemax.conf
fs.file-max = <larger_value>
sudo sysctl -p /etc/sysctl.d/99-filemax.conf # Or apply all sysctl settings: sudo sysctl -p
Check current value:
cat /proc/sys/fs/inotify/max_user_watches
Temporarily change the value:
This change will reset after reboot.
sudo sysctl fs.inotify.max_user_watches=524288
Permanently change the value:
Edit or create the config file:
sudo nano /etc/sysctl.d/99-inotify.conf
Add the following line (or update if it already exists):
fs.inotify.max_user_watches=524288
Apply changes:
sudo sysctl -p /etc/sysctl.d/99-inotify.conf
Verify:
cat /proc/sys/fs/inotify/max_user_watches
If you’re using dual-boot Windows alongside a Linux distribution (like Fedora, Ubuntu, etc.), you’ve probably encountered that frustrating issue where the clock shows the wrong time after switching from one OS to the other. It drove me crazy! This post is a quick reminder for my future self (and maybe you!) on why this happens and the best way I found to fix it permanently.
The heart of the problem lies in how Windows and Linux, by default, interpret the time stored in your computer’s Hardware Clock (also known as the RTC or CMOS clock). This is the clock that keeps running even when your PC is off, thanks to that little battery on the motherboard.
When you switch operating systems, they read the Hardware Clock based on their own assumption. One OS might then “correct” the Hardware Clock according to its standard, making it wrong for the other OS when you boot into it next. This back-and-forth causes the time drift.
The most robust solution is to make Windows adopt the same standard as Linux: interpreting the Hardware Clock as UTC. This requires a simple change in the Windows Registry.
Why this method is generally preferred:
Here are the steps:
Win + R
, type regedit
, and hit Enter. You’ll likely need to approve the User Account Control (UAC) prompt by clicking “Yes”.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
(Expand HKEY_LOCAL_MACHINE
, then SYSTEM
, CurrentControlSet
, Control
, and finally click on TimeZoneInformation
).
TimeZoneInformation
), right-click on an empty space.New
-> DWORD (32-bit) Value
.DWORD (32-bit) Value
.RealTimeIsUniversal
RealTimeIsUniversal
value you just created.1
.Hexadecimal
(though it makes no difference for the value 1).OK
.sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
Modify Your Nginx Server Block:
server { listen 443 ssl; server_name your_domain.com; ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; location / { # Your proxy or root configurations } }
sudo nginx -t sudo systemctl reload nginx
sudo nano /etc/systemd/system/battery-charge-threshold.service
[Unit] Description=Set battery charge threshold to 60% After=multi-user.target [Service] Type=oneshot ExecStart=/bin/bash -c 'echo 60 > /sys/class/power_supply/BAT0/charge_control_end_threshold' RemainAfterExit=yes [Install] WantedBy=multi-user.target
sudo systemctl daemon-reload sudo systemctl enable --now battery-charge-threshold.service
sudo dnf check-update
sudo dnf upgrade --refresh
sudo dnf autoremove
sudo dnf clean all
sudo add-apt-repository ppa:dotnet/backports
sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-9.0