Enabling NVIDIA GPU Support in Docker with nvidia-container-toolkit

Step-by-Step Guide to Leveraging GPU Power within Docker Containers

TL;DR To answer the request to use a GPU (nvidia) inside a Docker container, Docker has to be configured for GPU support. Normally a Docker container cannot access the host’s GPU resources. That is because Docker does not pass the host’s GPU devices through to the container, and the reason behind it is that the GPU driver and the CUDA libraries are not properly shared between the host and the container. To get around this, the GPU resources have to be passed through to the container with a tool such as nvidia-container-toolkit. [Read More]

A CLI Command That Only Updates Neovim Plugins

Just a command to update the neovim plugin

I only just learned the command that updates plugins in a Neovim (Vim) setup that uses vim-plug.

Until now I opened nvim, opened the : command window, and typed :PlugUpdate.
That is fine for a single machine, but repeating the same steps on several hosts is tedious.
It turns out you can run it from the command line as well.

$ nvim +PlugUpdate +qall

With this, you can drop it into a script or an Ansible playbook.

Getting an author Warning When Hugo Builds the Site

The author key in site configuration is deprecated. Use params.author.name instead

The following error started appearing when building with hugo

Start building sites …
hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew

WARN  The author key in site configuration is deprecated. Use params.author.name instead.

Apparently the warning started being emitted from version 0.120

Fixing config.toml

  • Before
[params]
  author = "Hugo"
  • After
[params]
  author.name = "Hugo"

If there is no author inside [params], add it

Getting UNIX-Style Focus Follows Mouse on a Mac with AutoRaise

Enable UNIX window autoraise(focus) on Mac

Ever since I started using a Mac, I kept wishing there were a feature like the one on Unix where simply moving the mouse cursor onto a window makes it active. It is late in the day, but I finally came across a piece of software with a Focus Follows Mouse feature (AutoRaise). Installing AutoRaise The installation instructions offer a disk image, a Zip file and manual compilation, but the disk image was not supported, so I go with manual compilation from Git. [Read More]

How to Exclude Files and Folders from Resilio Sync with IgnoreList

How to sync ignore resilio sync

Until a few years ago I had sync configured across several PCs with Dropgox, but a change for the worse in Dropbox put a limit on the number of devices, so these days I use Resilio Sync to keep my PCs in sync. Lately I have been using node-based tools such as React and Git frequently, and if I keep those working directories inside a Resilio Sync folder, an enormous number of files get synced. In particular, I do not want the contents of node_modules produced by node builds, or the git management folder, to be synced, so - late in the day though it is - I began to wonder whether Resilio Sync has an exclusion setting. [Read More]

Adding an HDD on Debian and Formatting It with xfs

how to add hdd and format it with xfs on Linux(Debian)

In Linux environments I often have occasion to add an HDD after the fact, so I am writing it down again. (About ten years ago I posted a similar article (adding an HDD with fdisk from the command line (in Japanese))) Environment The Linux used is Debian 12 The format is xfs The HDD to be added is 4TB I assume Linux (Debian) is already running and the HDD to be added is already installed [Read More]

Fixing network.external.name is deprecated in Docker Compose

howto configure network.external.name on docker

When I rebuilt and started, for the first time in a while, a container that uses external in order to communicate between containers in different Docker environments, I ran into the error below Copy network default: network.external.name is deprecated. Please set network.name with external: true The docker-compose.yml I had been using until then worked with the following Copy … networks: default: external: name: ${NETWORK} The compose version has gone up and the way it is written seems to have changed, and the format below is apparently the correct one [Read More]

Upgrading Debian 11 bullseye to Debian 12 bookworm

How to upgrade Debian 11 to 12

I have written about Debian upgrades several times, so this update is almost the same work as the previous Upgrading Debian 10 to 11 .

The only difference is a small change to sources.list when adding non-free.
After main in each repository stanza of /etc/apt/sources.list, add non-free non-free-firmware.

#deb cdrom:[Debian GNU/Linux 12 _Bookworm_ - Official Snapshot amd64 LIVE/INSTALL Binary 20230610-08:51]/ bookworm main non-

deb http://ftp.riken.jp/Linux/debian/debian/ bookworm main non-free non-free-firmware
deb-src http://ftp.riken.jp/Linux/debian/debian/ bookworm main non-free non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free non-free-firmware

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://ftp.riken.jp/Linux/debian/debian/ bookworm-updates main non-free non-free-firmware
deb-src http://ftp.riken.jp/Linux/debian/debian/ bookworm-updates main non-free non-free-firmware

As an aside, a direct jump from 10 to 12 failed in my case, so when upgrading from an older release it is safer to go in order (10→11→12).

Connecting to Samba Shared Folders from Windows 10 and 11

Can't connect to shared folders in Windows 10/11

At work I have been asked about not being able to connect to shared folders (Samba) since somewhere around Windows 10, and recently the questions from people who have updated to Windows 11 have increased as well. Let’s check the items below! Enabling the SMB1.0 client On Windows 11 the “SMB1.0 client” is disabled in the default settings. The “SMB1.0 client” standard is old and vulnerabilities have been reported for it, so Microsoft disables the “SMB1.0 client” from a security point of view, and that accounts for most of the cases where the connection fails [Read More]

Spinning Up a Samba Server for Testing with Docker

Testing Samba Server on Docker

At work there was a request to build a temporary Windows file sharing server on Linux and test against it. Since it was only temporary, I wanted to avoid dirtying the system by installing directly onto it, so I built it with Docker. That said, a Docker image already exists, so all I do is use it This repository looks comparatively recently updated and maintained [Read More]