Saturday, April 25, 2026

Qwen-Code: Ollama Ignores num_ctx from settings.json

If you're running Ollama behind an OpenAI-compatible endpoint and setting num_ctx in your client's config, you may notice Ollama still loads the model with only 32k context. This is a silent failure — no errors, just ignored parameters.

Why It Happens

Ollama's /v1 OpenAI-compatible layer only forwards standard OpenAI parameters. Native Ollama options like num_ctx need to be passed inside an options: {} object in the raw request body. Most OpenAI-compatible clients don't do this, so the parameter is quietly dropped and Ollama falls back to the model's default context size.

The Fix

Bake num_ctx directly into the model via a custom Modelfile. This sidesteps the client entirely.

1. Export the existing Modelfile:

ollama show qwen3.6:27b --modelfile > qwen_custom.Modelfile

2. Add or update the num_ctx parameter in the file:

PARAMETER num_ctx 262144

3. Create a new model from it:

ollama create qwen3.6-256k -f qwen_custom.Modelfile

4. Update your client config to point to the new model name, then verify:

ollama ps

The context size shown in ollama ps should now reflect 262144 instead of 32768.

LibreWolf: Claude.ai freezes

If Claude streams responses fine in Firefox but randomly freezes in LibreWolf, you've hit a fingerprinting resistance quirk — not a Claude bug per se:

LibreWolf's Resist Fingerprinting (RFP) deliberately reduces Date.now() precision. This can make consecutive calls return the same value. Claude's frontend assumes time always moves forward — when the delta is zero, it loops forever and the tab freezes.
Create ~/.config/librewolf/librewolf/librewolf.overrides.cfg with the content:
defaultPref("privacy.resistFingerprinting", false);

gentoo: mask the use of new nvidia drivers for legacy cards

Latest nvidia drivers (595.58.03) will not work with old GPUs, e.g. (GTX 960), giving error:
probe with driver nvidia failed
In this case you can mask the newest driver and force gentoo to use older one. You can do this as follows:
echo '>=x11-drivers/nvidia-drivers-581' > /etc/portage/package.mask/nvidia-drivers then emerge =avtDUu @world

sudo: how to reset "too many failed attempts" lock

Run as user: faillock --reset

Friday, April 24, 2026

Open WebUI: Run as a temprorary container with Ollama support

docker run --rm --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 -e WEBUI_AUTH=False --name open-webui ghcr.io/open-webui/open-webui:main

Thursday, April 16, 2026

Distrobox with systemd: "save as" does not work in chromium and brave

If "save as" window does not work in chromium and brave executed in distrobox, this maybe because, container's systemd hijacked debus from the host. Thus you can disable it in the container and restart the container:
systemctl --user mask dbus.socket dbus-broker.service
systemctl --user stop dbus.socket dbus-broker.service

In my case I was using fedora 43 in the container, on gentoo host running systemd and xfce4 (x11). The XDG portal (xdg-desktop-portal-gtk) on host was installed and running.

Wednesday, April 15, 2026

Firefox: disable "Add appliction" notification for outlook and other email portals

1. Open a new tab.
2. Enter about:config instead of an address.
3. Agree to the warning.
4. In the search bar, enter browser.mailto.dualPrompt and set it to true (double click it to toggle). Next time you see the prompt, it will have a second button called Not now. Press it.


From: https://superuser.com/a/1932569/871038

Tuesday, April 14, 2026

Qwen-code CLI: Use Qwen 3.6 plus from OpenRouter

I qwen code CLI you can use models from OpenRouter or other providers. For example, to use Qwen 3.6 plus modify your .qwen/settings.json as follows: "env": {
"OPENROUTER_API_KEY": "your-openrouter-api-key"
},
"modelProviders": {
"openai": [
{
"id": "qwen/qwen3.6-plus",
"name": "Qwen3.6-plus (via OpenRouter)",
"envKey": "OPENROUTER_API_KEY",
"baseUrl": "https://openrouter.ai/api/v1",
"generationConfig": {
"timeout": 120000,
"maxRetries": 3,
"samplingParams": {
"temperature": 0.7
}
}
}
]
}

More here.

Monday, April 13, 2026

fedora: web-ext keep changes in a profile for testing and use firefox developer edition

web-ext run -f firefox-aurora --keep-profile-changes --firefox-profile=test

distrobox: firefox "Show in Folder" opens vscodium, not thunar or other file manager.

Run in distrobox (make sure thunar is installed in distrobox first):

xdg-mime default thunar.desktop inode/directory
xdg-mime default thunar.desktop x-scheme-handler/file

bedrock linux: krusader in arch strata does not open files with "Open with" menu from strata

On Bedrock Linux (hijacked gentoo with xfce4) with a non-KDE host session, Krusader's (installed in the arch linux strata) "Open With" silently fails for apps in a guest stratum because KDE's KRun launcher depends on session services that are never started outside a KDE session. The fix is to override the affected .desktop files locally and prepend their Exec lines with strat:
cp /bedrock/strata/arch/usr/share/applications/appname.desktop ~/.local/share/applications/appname.desktop

sed -i 's|^Exec=|Exec=strat arch |' ~/.local/share/applications/appname.desktop

update-desktop-database ~/.local/share/applications/



The simble bash script to do it automatically (fix-strata-desktop.sh) is: #!/bin/bash

STRATA="arch"
SRC="/bedrock/strata/$STRATA/usr/share/applications"
SRC_CROSS="/bedrock/strata/$STRATA/bedrock/cross/applications"
DEST="$HOME/.local/share/applications"

mkdir -p "$DEST"

for src_file in "$SRC"/*.desktop "$SRC_CROSS"/*.desktop; do
# Skip if not a regular file (e.g. broken symlinks from Bedrock cross-mount)
[[ ! -f "$src_file" ]] && echo "Skipping: $(basename $src_file)" && continue

filename=$(basename "$src_file")
dest_file="$DEST/$filename"

cp "$src_file" "$dest_file"

# Only modify Exec lines that don't already have strat
if ! grep -q "Exec=strat $STRATA" "$dest_file"; then
sed -i "s|^Exec=|Exec=strat $STRATA |" "$dest_file"
fi

echo "Processed: $filename"
done

update-desktop-database "$DEST"
echo "Done."

Sunday, April 12, 2026

distrobox: firefox does not open file chooser windows

If you run Firefox inside a Distrobox container on a Gentoo (or any) Linux host, you may notice that the "Save Page As" dialog simply never appears. You hit Ctrl+S, nothing happens. No window, no error, just silence.

The culprit is XDG Desktop Portals. Firefox tries to detect whether it's running inside a sandboxed environment like Flatpak, and when it thinks it is, it hands off file chooser dialogs to the XDG portal service instead of opening a native GTK window. Distrobox leaks enough container-like environment variables to trigger this heuristic, so Firefox dutifully tries to call the portal over D-Bus — but the portal either isn't reachable from inside the container or isn't running at all. The call fails silently and you never see a dialog.

The fix is a single preference change in about:config:
widget.use-xdg-desktop-portal.file-picker = 0
Setting this to 0 tells Firefox to never use the portal for the file picker, falling back to the plain GTK file chooser. The dialog comes back immediately, no restart required.

The default value of 2 means "auto-detect", which is the right call for a real Flatpak sandbox where portals are properly set up. In a Distrobox environment though, the detection fires incorrectly and there's no graceful fallback. Until Distrobox masks the relevant environment variables or Firefox improves its detection logic, flipping this preference manually is the most reliable workaround.

fedora: krusader can't change default application to open files.

Could not find the "keditfiletype" executable in PATH. Install: sudo dnf install keditfiletype

gentoo with systemd: simplescan from flatpak does not open Export save file window

Have to make sure that xdg-desktop-portal-gtk portal on gentoo is installed and running (run a regular user, not root): systemctl --user status xdg-desktop-portal-gtk.service If it is not running enable it: systemctl --user enable --now xdg-desktop-portal-gtk.service

gentoo with systemd and docker: use Nvidia runtime in distrobox through Nvidia container oolkit

Install nvidia container toolbox: sudo emerge -av nvidia-container-toolkit restart docker service: sudo systemctl restart docker Create and setup /etc/cdi: mkdir -p /etc/cdi
nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
Check if its working: nvidia-ctk cdi list Configure docker to use NVIDIA runtime: sudo nvidia-ctk runtime configure --runtime=docker Restart docker service again: sudo systemctl restart docker Before creating distrobox container, lets just perfrom basic check if nvidia is avaiable in docker: docker run --rm --device=nvidia.com/gpu=all ubuntu nvidia-smi If this shows your Nvidia driver and info about your gpu, than it works.

Create distrobox that uses nvidia (fedora 43 as an example): distrobox create -i quay.io/fedora/fedora:43 -n fbox -H ~/home-fbox --additional-flags "--device=nvidia.com/gpu=all"
Enter the distrobox container, fbox, in this example, and test using nvidia-smi: sudo nvidia-smi This should also give info about your nvidia gpu and its driver.

If inside the distrobox container, nvidia is only avaiable for root user, you have to check what group number is nvidia on the host: stat -c "%g" /dev/nvidia0 This will show a number, e.g. 27.
Then in the distrobox container, fbox in this example, you have to edit /etc/group and:
1. add yourself (i.e. normal user) to video group 2. Change video group number to match the one on the host, e.g. 27. For example, /etc/group in fbox
video:x:27:your-user-name

distrobox with nvidia through NVIDIA Container Toolkit

First setup NVIDIA Container Toolkit and docker support for it based on your host's distrubution. Then you can: distrobox create -i archlinux -n abox -H ~/home-abox --additional-flags "--device=nvidia.com/gpu=all" && distrobox enter abox -- bash -c "sudo pacman -Sy --noconfirm git base-devel && git clone https://aur.archlinux.org/yay-bin.git /tmp/yay-bin && cd /tmp/yay-bin && makepkg -si --noconfirm && rm -rf /tmp/yay-bin"

nixos: enable nvidia in distrobox container using Nvidia Container Toolkit

What worked for me on nixos with docker (check nixos wiki on Nvidia and Nvidia Container Toolkit) was:

distrobox create -i archlinux -n archbox --additional-flags "--device=nvidia.com/gpu=all"
Then in the distrobox container you can check if nvidia is detected, using for example glxinfo. It should show: name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:

Put the following in nixos configuration file: hardware.nvidia-container-toolkit.enable = true;
virtualisation.docker.daemon.settings.features.cdi = true;

Saturday, April 11, 2026

Gentoo and SDDM and Ligthdm: Fixing Inactive Mouse at Display Manager Startup in Gentoo with systemd

If you use Gentoo Linux with systemd and a display manager like SDDM or LightDM, you may have run into an annoying issue where the mouse is completely unresponsive on the display manager's login screen after a reboot or cold start. The keyboard works fine, but the mouse does nothing. A second reboot usually fixes it. The problem does not appear on other distributions like NixOS, Fedora, or Ubuntu.

This is a race condition. Gentoo's minimal default configuration does not add unnecessary delays or dependencies to services, which means your display manager can start before the kernel input subsystem and udev have finished initializing the mouse device. Other distributions work around this implicitly through their own service configurations, but on Gentoo you have to handle it yourself.

The fix is to make the display manager wait for udev to finish settling before it starts. Systemd has a built-in service for exactly this purpose called systemd-udev-settle. It blocks until udev has finished processing all queued device events, which includes input devices like your mouse. You wire your display manager to it using a systemd drop-in file.

For SDDM, first create the drop-in directory: mkdir -p /etc/systemd/system/sddm.service.d/

Then create the drop-in configuration file: cat > /etc/systemd/system/sddm.service.d/wait-for-input.conf << 'EOF'
[Unit] After=systemd-udev-settle.service
Wants=systemd-udev-settle.service
EOF


If you use LightDM instead, the steps are identical but with a different directory: mkdir -p /etc/systemd/system/lightdm.service.d/
cat > /etc/systemd/system/lightdm.service.d/wait-for-input.conf << 'EOF'
[Unit] After=systemd-udev-settle.service
Wants=systemd-udev-settle.service
EOF


After creating the file, reload the systemd daemon so it picks up the change: systemctl daemon-reload

That is all. On the next reboot, systemd will start systemd-udev-settle before launching your display manager, and it will wait for all input devices to be fully registered before the login screen appears. The mouse will work on the very first try.

The reason this only affects Gentoo is that you compile and configure everything yourself. There is no distribution maintainer quietly patching service files or adding conservative boot ordering on your behalf. That level of control is what makes Gentoo great, but it also means issues like this surface in a way they simply would not on a more opinionated distribution.

If the problem persists after applying this fix, the next thing to investigate is whether your mouse and evdev drivers are compiled as kernel modules rather than built into the kernel, and whether INPUT_DEVICES is correctly set in your /etc/portage/make.conf.

Fedora 43: Install latest foxitreader

Download latest version (FoxitReader.enu.setup.2.4.5.0727). Foxitreader is no longer maintained, so this is the oldest version.
wget https://cdn01.foxitsoftware.com/pub/foxit/reader/desktop/linux/2.x/2.4/en_us/FoxitReader.enu.setup.2.4.5.0727.x64.run.tar.gz
tar xzvf FoxitReader*.tar.gz
chmod +x ./"FoxitReader.enu.setup.2.4.5.0727(rb70e8df).x64.run"
sudo ./"FoxitReader.enu.setup.2.4.5.0727(rb70e8df).x64.run"
Follow the prompts.

gentoo with xfce4: krusader does not start from distrobox

kf.i18n: KLocalizedString: Domain is not set for this string, translation will not work. Please see https://api.kde.org/frameworks/ki18n/html/prg_guide.html msgid: "No jobs" msgid_plural: "" msgctxt: ""

Authorization required, but no authorization protocol specified

10:26:41.584-warning qt.qpa.xcb unknown@0 # could not connect to display :0.0 10:26:41.584-warning qt.qpa.plugin unknown@0 # From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. 10:26:41.584-info qt.qpa.plugin unknown@0 # Could not load the Qt platform plugin "xcb" in "" even though it was found. 10:26:41.584-fatal default unknown@0 # This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, wayland-brcm, wayland-egl, wayland, vkkhrdisplay, vnc, offscreen, xcb, minimalegl, eglfs, minimal.

install xhost in gentoo host: sudo emerge x11-apps/xhost
and allow access to display: xhost +
now can enter the fedora distrobox

Friday, April 10, 2026

bedrock with hijacked gentoo and xfce4: missing icons from strata in xfce4 application menu

sudo touch /usr/share/icons/hicolor
sudo gtk-update-icon-cache

based on: https://old.reddit.com/r/bedrocklinux/comments/llt5pp/buggy_icons_from_other_stratums_in_gnome/gnuo7tv/

gentoo and libvirt: Unable to find a satisfying virtiofsd

emerge --ask app-emulation/virtiofsd

Thursday, April 09, 2026

tigervnc with fluxbox example setup

/etc/tigervnc/vncserver-config-mandatory session=startfluxbox
securitytypes=none
geometry=2000x1200
localhost
alwaysshared

Gentoo install app-arch/ rar - license

To avoid license inssues in future, you can just accept all licenses in /etc/portage/make.conf: ACCEPT_LICENSE="*"

Monday, April 06, 2026