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
Press Win + R
, type gpedit.msc
, and press Enter.
Navigate to:
Double-click “Disable Windows Error Reporting”
Set it to Enabled
Click Apply → OK
This disables WER across the system and prevents WerFault.exe
from launching.
Press Win + R
, type regedit
, and press Enter.
Navigate to:
If the
Windows Error Reporting
key doesn’t exist, right-clickMicrosoft\Windows
, choose New → Key, and name itWindows Error Reporting
.
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
Restart your PC for changes to take effect.
While disabling WER via policy or registry prevents it from activating, you can also disable its background service as an extra step:
Press Win + R
, type services.msc
, and press Enter.
Find: Windows Error Reporting Service
Right-click → Properties
Set Startup type to Disabled
Click Stop (if it’s running), then Apply and OK
Open PowerShell as Administrator.
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic Start-Service ssh-agent
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
You can define custom instructions in two ways:
.github/copilot-instructions.md
file in your workspacesettings.json
If you define custom instructions in both the .github/copilot-instructions.md
file and in settings, Copilot tries to combine instructions from both sources.
Custom instructions for code generation are not used for code completions and are only used in chat.
# Project coding standards ## TypeScript Guidelines - Use TypeScript for all new code - Follow functional programming principles where possible - Use interfaces for data structures and type definitions - Prefer immutable data (const, readonly) - Use optional chaining (?.) and nullish coalescing (??) operators ## React Guidelines - Use functional components with hooks - Follow the React hooks rules (no conditional hooks) - Use React.FC type for components with children - Keep components small and focused - Use CSS modules for component styling ## Naming Conventions - Use PascalCase for component names, interfaces, and type aliases - Use camelCase for variables, functions, and methods - Prefix private class members with underscore (_) - Use ALL_CAPS for constants ## Error Handling - Use try/catch blocks for async operations - Implement proper error boundaries in React components - Always log errors with contextual information
You can store custom instructions in your workspace or repository in a .github/copilot-instructions.md
file and describe your coding practices, preferred technologies, and project requirements by using Markdown.
VS Code automatically includes the instructions from the .github/copilot-instructions.md
file to every chat request and applies them for generating code.
To use a .github/copilot-instructions.md
file:
true
to instruct Copilot in VS Code to use the custom instructions file..github/copilot-instructions.md
file at the root of your workspace. If needed, create a .github
directory first.Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
.github/copilot-instructions.md
file. If you have a workspace that you use in both VS Code and Visual Studio, you can use the same file to define custom instructions for both editors.
You can also configure custom code-generation instructions in your user or workspace settings. The following table lists the settings for each type of custom instruction.
Type of instruction | Setting name |
---|---|
Code generation | github.copilot.chat.codeGeneration.instructions |
Test generation | github.copilot.chat.testGeneration.instructions |
Code review | github.copilot.chat.reviewSelection.instructions |
Commit message generation | github.copilot.chat.commitMessageGeneration.instructions |
Pull request title and description generation | github.copilot.chat.pullRequestDescriptionGeneration.instructions |
You can define the custom instructions as text in the settings value or reference an external file in your workspace.
The following code snippet shows how to define a set of instructions in the settings.json
file. To define instruction directly in settings, configure the text
property. To reference an external file, configure the file
property.
"github.copilot.chat.codeGeneration.instructions": [ { "text": "Always add a comment: 'Generated by Copilot'." }, { "text": "In TypeScript always use underscore for private field names." }, { "file": "general.instructions.md" // import instructions from file `general.instructions.md` }, { "file": "db.instructions.md" // import instructions from file `db.instructions.md` } ],
References
https://code.visualstudio.com/docs/copilot/copilot-customization
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