Category: Uncategorized

  • VSCode container and OAuth2 Web callback

    I use Fedora Silverblue and my VSCode runs inside a container. I manage the container with the “toolbox” CLI tool. I also, to get the last version of Firefox, I use it’s upstream Flatpak To be able to get VSCode’s OAuth2 callback to work properly, I had to do a bit of extra configuration.

    You need a .desktop file to overload VSCode’s default way to open web URL. We don’t want to rely on the default xdg-open configuration (e.g: xdg-open http://www.google.com) which would otherwise try to open up a a new web browser INSIDE the container.

    Prepare the code-url-handler.desktop file, you need to adjust the Exec to prefix the command with the toolbox run call:

    [Desktop Entry]
    Name=Visual Studio Code - URL Handler
    Comment=Code Editing. Redefined.
    GenericName=Text Editor
    Exec=toolbox run --container vscode /usr/share/code/code --open-url %U
    Icon=vscode
    Type=Application
    NoDisplay=true
    StartupNotify=true
    Categories=Utility;TextEditor;Development;IDE;
    MimeType=x-scheme-handler/vscode;
    Keywords=vscode;

    The goal here is to be sure we send back the vscode:// link to the correct instance of VSCode (within the container!).

    To install the .desktop, run these commands in your system (not in a container).

    desktop-file-install --dir=$HOME/.local/share/applications code-url-handler.desktop

    And refresh the local cache:

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

    Inside the container we need to also install flatpak-xdg-utils and use it instead of the default /usr/bin/xdg-open. This way your containerize VSCode will be able to open the web page inisde yet another container (the Flatpak app). This is a snippet of my Containerfile of my VSCode container:

    RUN dnf install -y flatpak-xdg-utils
    RUN ln -sf /usr/bin/flatpak-xdg-open /usr/bin/xdg-open

    See: https://github.com/microsoft/vscode-pull-request-github/issues/3472#issuecomment-1825008268

  • bsd-cloud-image.org 2nd^w3rd rewrite

    bsd-cloud-image.org aims to simplify the use of the BSD Operating Systems in a Cloud environment. It provides a series of Cloud-Ready images that can quickly be deployed and tested. The original target was OpenStack and Virt-Lightning. But the images should work with any Cloud-Init compatible environment.

    I released yesterday a new version of the website based on TypeScript + Vite + VueJS and Bootstrap5. After 5 years, the original static page was due for a rewrite. The definition of the images was lost deep inside a mix of HTTP code and Bootstrap class names. It’s not isolated in a clear JSON file. This will simplify the maintenance in the long run. It should also be easier to add new features. I’m dreaming about a way to spawn instances directly from the interface.

    Fun fact, I had a v2 rewrite mostly done that I never published. It’s based on Elixir, and it was super fun to do. It’s not a static website since it runs on top of the Erlang VM, I’m afraid the maintenance may be source of extra complexity and not sure this is the right strategy considering my limited free time.

    I also pushed new FreeBSD and NetBSD images during the last days. I’ve yet to prepare the NetBSD 10 build.

    Enjoy!

  • firewalld: add a new service

    Create a new service entry:

    firewall-cmd --permanent --new-service=ollama

    Associate the right port with new service:

    firewall-cmd --permanent --service=ollama --add-port=11434/tcp

    Restart the firewalld, so it’s aware of the new service:

    firewall-cmd --reload

    Finally, associate the service with the Zone. I don’t use --permanent here on purpose. This way the association will be lost when I will reboot the machine:

    firewall-cmd --add-service=ollama --zone=nm-shared

  • Sharing Internet connection on Fedora 40

    It’s surprisingly easy to build a router from a Fedora 40 box. Here eno1 is connected to my cable modem and enp8s0 is connected to my local network.

    To NAT the Internet connection:

    nmcli c add type ethernet con-name internet ifname eno1 connection.zone external ipv4.method auto

    And set up the DHCP on the local network, the machine will use the IP 10.42.0.1 IP by default:

    nmcli c add type ethernet con-name lebouder.net ifname enp8s0 connection.zone nm-shared ipv4.method=shared

  • Vidéotron Helix Fi 2

    Quick rant.

    Vidéotron Helix Fi 2 is the worst modem I ever seen and the fact the ISP force the customers to use it is embarassing:

    There is no IPv6 despite the fact that it’s supposed to kinda work on their website. That was the man reason why I switched to Vidéotron. There is no way to do something as basic as bridge mode. Their definition of a “bridge mode” is actually a bloody ugly double NAT. Also you cannot change the DNS and pretty much all the features that you expect from a modern router are just missing. Finally even the Wifi is pretty bad. My 7 years old router has pretty much the same coverage. What a sad disappointment for a $288 device.

  • AWS: How to retrieve a KeyPair private key

    Note for myself, this is how you can download a copy of a KeyPair private key:

    aws --region ca-central-1 ssm get-parameter --name /ec2/keypair/key-015b012fb114efc83 --with-decryption --query Parameter.Value --output text

  • NextCloud photos backups

    I’ve been doing the backups for my family for years now. In the past, I used several different systems including rsync and burp.

    Recently, I decided to stop hosting my own backup server and move to Nextcloud. I use the Nextcloud offer from Hetzner and I’m pretty happy with the result. I appreciate having a solution that just works without having to think about it.

    Regarding the clients applications. The Nextcloud application on Android works fine but is also not really pleasant to use. I ended up buying the FolderSync Pro application for myself. I strongly recommend it even if I would prefer a better free software solution. I use Webdav on Linux to synchronize my files. Both Nautilus and the davfs driver work as expected. MacOS is also able to mount the Webdav shares, this is a much better solution than the NextCloud application for Mac. However, iPhotos stores the pictures in some kind of local binary DB and there is no easy way to export them. iPhotos comes with an “Export” feature that is all manual and pathologically slow. But there is a solution! I recently discovered osxphotos and it’s an absolute gem.

  • My Gnome configuration and its extensions

    I’ve been using a slightly tweaked Gnome 3 for a while now. Before that, I was using the Awesome Window Manager and I was pretty fan of the key binding. In order to facilitate the transition, I tried to recreate them. The result is pretty good. I can navigate between my 9 different virtual desktops using the Windows(a.k.a SUPER) key+a number. Windows+f also works, it will turn on the Fullscreen mode for a given window. Years after the migration to Gnome, I still use the bindings intensively. The following script configures Gnome for with my configuration: https://gist.github.com/goneri/b57a96915ea4a98f81df3bb57a41913e

    It creates 9 virtual desktops on one single monitor that I can reach using the Super+$number key binding, e.g: Windows+6. In addition, it also turns off the animations and the annoying alert sound.

    I also use a couple of extensions:

    • Application volume mixer to be able to adjust my mic volume level during meeting link
    • Network stats to get some visibility on the network traffic link
    • Sound Output Device Chooser to be able to switch the sound output between my Bluetooth speaker and my headset. I use it several times every days, it’s super handy. link
  • BSD-Cloud-Image.org new images

    I just push 2 new images on BSD-Cloud-Image.org:

    • OpenBSD 7.2
    • DragonFlyBSD 6.2.2
  • Elixir: xmerl/include/xmerl.hrl could not be found

    I recently faced this error when trying to build an Elixir project.

    == Compilation error in file lib/swoosh/adapters/xml/helpers.ex ==
    ** (ArgumentError) lib file xmerl/include/xmerl.hrl could not be found
    (elixir 1.13.4) lib/record/extractor.ex:41: Record.Extractor.from_lib_file/1
    (elixir 1.13.4) lib/record/extractor.ex:18: Record.Extractor.from_or_from_lib_file/1
    (elixir 1.13.4) lib/record/extractor.ex:5: Record.Extractor.extract/2
    lib/swoosh/adapters/xml/helpers.ex:5: (module)
    (elixir 1.13.4) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
    could not compile dependency :swoosh, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile swoosh", update it with "mix deps.update swoosh" or clean it with "mix deps.clean swoosh"

    If you can the error above on Fedora, you probably need to install the erlang-xmerl package.